python-productmd/0001-update-the-other-two-_...

44 lines
1.5 KiB
Diff
Raw Normal View History

From e28a89916a484e05ccc77bc603e61ecf892d1055 Mon Sep 17 00:00:00 2001
From: Dennis Gilmore <dennis@ausil.us>
Date: Thu, 18 Feb 2016 19:50:52 -0600
Subject: [PATCH] update the other two _validate_version functions to allow for
Rawhide to be valid
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
---
productmd/common.py | 3 ++-
productmd/treeinfo.py | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/productmd/common.py b/productmd/common.py
index 3447c05..b23d71f 100644
--- a/productmd/common.py
+++ b/productmd/common.py
@@ -195,7 +195,8 @@ class Header(MetadataBase):
def _validate_version(self):
self._assert_type("version", six.string_types)
- self._assert_matches_re("version", [r"^\d+\.\d+$"])
+ if re.match('^\d', self.version):
+ self._assert_matches_re("version", [r"^\d+(\.\d+)*$"])
@property
def version_tuple(self):
diff --git a/productmd/treeinfo.py b/productmd/treeinfo.py
index a14305e..67f5ed9 100644
--- a/productmd/treeinfo.py
+++ b/productmd/treeinfo.py
@@ -166,7 +166,8 @@ class BaseProduct(productmd.common.MetadataBase):
def _validate_version(self):
self._assert_type("version", list(six.string_types))
- self._assert_matches_re("version", [r"^\d+(\.\d+)*$"])
+ if re.match('^\d', self.version):
+ self._assert_matches_re("version", [r"^\d+(\.\d+)*$"])
def _validate_short(self):
self._assert_type("short", list(six.string_types))
--
2.5.0