Skip to content

Commit

Permalink
More restricted version pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
JayZ12138 committed Oct 24, 2019
1 parent 812498d commit 870ecb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ubiconfig/_impl/loaders/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def load(self, file_name, version=None):
# ubi7.1.
version = os.path.basename(os.path.dirname(os.path.abspath(file_path)))

if not re.search("ubi[0-9.]+$", version):
if not re.search(r"ubi[0-9]{1}\.?([0-9]{0,2})$", version):
raise ValueError(
"Expect directories named in format ubi[0-9.]+$, but got %s" % version
"Expect directories named in format ubi[0-9]{1}.?([0-9]{0,2})$', but got %s"
% version
)

LOG.info("Loading configuration file locally: %s", file_path)
Expand Down

0 comments on commit 870ecb9

Please sign in to comment.