summaryrefslogtreecommitdiffstats
path: root/conf/__init__.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-08-14 14:27:06 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-14 14:27:06 +0000
commit2a4d03a1c5634c7d8b54bd9bda6c14b7a683de6e (patch)
tree5588bbaff2b78881d1aafab0ec40502e5c3dedf7 /conf/__init__.py
parent73025baf2e393c61c59957e8714d2ddd54d25e51 (diff)
parent6961a6fa333ca2cff055d7d7a889876263b673f5 (diff)
Merge "tests: L3, L4 and VxLAN tests for OVS & VPP"
Diffstat (limited to 'conf/__init__.py')
-rw-r--r--conf/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/conf/__init__.py b/conf/__init__.py
index e714a7bf..808cfc97 100644
--- a/conf/__init__.py
+++ b/conf/__init__.py
@@ -148,14 +148,15 @@ class Settings(object):
:returns: None
"""
- regex = re.compile("^(?P<digit_part>[0-9]+).*.conf$")
+ regex = re.compile("^(?P<digit_part>[0-9]+)(?P<alfa_part>[a-z]?)_.*.conf$")
def get_prefix(filename):
"""
Provide a suitable function for sort's key arg
"""
match_object = regex.search(os.path.basename(filename))
- return int(match_object.group('digit_part'))
+ return [int(match_object.group('digit_part')),
+ match_object.group('alfa_part')]
# get full file path to all files & dirs in dir_path
file_paths = os.listdir(dir_path)
@@ -166,7 +167,7 @@ class Settings(object):
file_paths = [x for x in file_paths if os.path.isfile(x) and
regex.search(os.path.basename(x))]
- # sort ascending on the leading digits
+ # sort ascending on the leading digits and afla (e.g. 03_, 05a_)
file_paths.sort(key=get_prefix)
# load settings from each file in turn