From: Alexandru Avadanii Date: Fri, 21 Feb 2020 09:37:01 +0000 (+0100) Subject: validators: Allow uppercase iface names X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;ds=sidebyside;p=ta%2Fcm-plugins.git 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 --- 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)