From c8427f21e677189d7fcfcd0e2ff007a1560b6a29 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 21 Feb 2020 10:37:01 +0100 Subject: [PATCH] validators: Allow uppercase iface names Predictable interface names for PCI devices on non-zero PCI domains get assigned (by systemd-udev) names like enPpsf, e.g. enP2p1s0f0, which are currently rejected by our validators. For PCI domain 0000, the "P" is omitted, resulting in all lowercase iface names. Allow uppercase iface names by making the re.match test case-insensitive. Signed-off-by: Alexandru Avadanii Change-Id: I2bda550c95737fba57b5916a71a3c3b9df66e22d --- validators.spec | 2 +- validators/src/NetworkProfilesValidation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/validators.spec b/validators.spec index 8627308..bd59e73 100644 --- a/validators.spec +++ b/validators.spec @@ -14,7 +14,7 @@ Name: validators Version: %{_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: Configuration validators License: %{_platform_licence} Source0: %{name}-%{version}.tar.gz diff --git a/validators/src/NetworkProfilesValidation.py b/validators/src/NetworkProfilesValidation.py index ae8ad1a..d43c1c3 100644 --- a/validators/src/NetworkProfilesValidation.py +++ b/validators/src/NetworkProfilesValidation.py @@ -763,7 +763,7 @@ class NetworkProfilesValidation(cmvalidator.CMValidator): return self.DEFAULT_MTU def validate_iface_name(self, context, iface): - if not isinstance(iface, basestring) or not re.match(self.IFACE_NAME_MATCH, iface): + if not isinstance(iface, basestring) or not re.match(self.IFACE_NAME_MATCH, iface, re.IGNORECASE): self.err_invalid_iface_name(context) if len(iface) > self.MAX_IFACE_NAME_LEN: self.err_iface_name_len(context) -- 2.16.6