Fix an error with the project init
authorHasan Wan <hasan.wan@intel.com>
Thu, 31 Oct 2013 03:03:41 +0000 (03:03 +0000)
committerGerrit Code Review <gerrit2@otctools.jf.intel.com>
Mon, 4 Nov 2013 05:49:53 +0000 (21:49 -0800)
Change-Id: Ic979ab0574df02b23b65f3f9374a2b7bf30fdfc0
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
common/snapshot.py

index 4d422fd..f3dd4aa 100644 (file)
@@ -9,6 +9,7 @@ import os
 from datetime import datetime
 
 from common.backenddb import BackendDBError
+from common.backenddb import EntityError
 from common.repomaker import ARCH_MAP
 
 
@@ -123,7 +124,12 @@ class Snapshot(object):
 
     def inc(self):
         """Increment stapshot."""
-        sdtime, snum = self.release_id.split('.')
+        try:
+            sdtime, snum = self.release_id.split('.')
+        except EntityError:
+            sdtime = None
+            snum = 0
+
         cdtime = datetime.now().strftime("%Y%m%d")
         if sdtime == cdtime:
             # datetime is the same - increment the number