Merge branch 'hotfix-0.5.1' into debian-precise
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 23 Aug 2013 14:15:02 +0000 (17:15 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 23 Aug 2013 14:15:02 +0000 (17:15 +0300)
ChangeLog
docs/conf.py
image_creator/dialog_util.py
image_creator/dialog_wizard.py
image_creator/image.py
image_creator/kamaki_wrapper.py
image_creator/os_type/__init__.py
image_creator/os_type/unix.py
image_creator/version.py
version

index 831952d..67b0dc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-23, v0.5.1
+       * Allow more characters in the cloud name
+       * Fix various bugs
+       * Handle kamaki config errors
+
 2013-08-04, v0.5
        * Add support for sysprep-parameters
        * Add support for syspreping Windows media
@@ -5,7 +10,7 @@
 
 2013-07-31, v0.4.4
        * Fix a bug where the system tried to use file scrubbing without
-          checking if it was supported
+         checking if it was supported
 
 2013-07-18, v0.4.3
        * Force TERM=linux when working on xterm. This makes dialog behave
index 377b013..8392d22 100644 (file)
@@ -50,9 +50,9 @@ copyright = u'2012, 2013 GRNET S.A. All rights reserved'
 # built documents.
 #
 # The short X.Y version.
-version = '0.5'
+version = '0.5.1'
 # The full version, including alpha/beta/rc tags.
-release = '0.5'
+release = '0.5.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index ec5be5f..af5e425 100644 (file)
@@ -180,10 +180,10 @@ def extract_image(session):
 def _check_cloud(session, name, description, url, token):
     """Checks if the provided info for a cloud are valid"""
     d = session['dialog']
-    regexp = re.compile('^[a-zA-Z0-9_]+$')
+    regexp = re.compile('^[~@#$:\-\w]+$')
 
     if not re.match(regexp, name):
-        d.msgbox("Allowed characters for name: [a-zA-Z0-9_]", width=WIDTH)
+        d.msgbox("Allowed characters for name: a-zA-Z0-9_~@#$:-", width=WIDTH)
         return False
 
     if len(url) == 0:
index 0856d8a..ffabecf 100644 (file)
@@ -414,7 +414,8 @@ def create_image(session):
         out.clear()
 
         #Sysprep
-        image.os.sysprep_params.update(wizard['SysprepParams'])
+        if 'SysprepParams' in wizard:
+            image.os.sysprep_params.update(wizard['SysprepParams'])
         image.os.do_sysprep()
         metadata = image.os.meta
 
index 686fad6..7eb8ad8 100644 (file)
@@ -293,7 +293,12 @@ class Image(object):
             return self.size
 
         part_dev = "%s%d" % (self.guestfs_device, last_part['part_num'])
-        self.g.e2fsck_f(part_dev)
+
+        if self.check_guestfs_version(1, 15, 17) >= 0:
+            self.g.e2fsck(part_dev, forceall=1)
+        else:
+            self.g.e2fsck_f(part_dev)
+
         self.g.resize2fs_M(part_dev)
 
         out = self.g.tune2fs_l(part_dev)
index c515fa6..3669526 100644 (file)
@@ -38,6 +38,8 @@ The library is used to upload images to and register them with a Synnefo
 deployment.
 """
 
+import sys
+
 from os.path import basename
 
 from kamaki.cli.config import Config
@@ -46,8 +48,11 @@ from kamaki.clients.image import ImageClient
 from kamaki.clients.pithos import PithosClient
 from kamaki.clients.astakos import AstakosClient
 
-
-config = Config()
+try:
+    config = Config()
+except Exception as e:
+    sys.stderr.write("Kamaki config error: %s\n" % str(e))
+    sys.exit(1)
 
 
 class Kamaki(object):
index 19e63fc..5298569 100644 (file)
@@ -320,6 +320,10 @@ class OSBase(object):
 
         * exclude: Exclude all files that follow this pattern.
         """
+        if not self.image.g.is_dir(directory):
+            self.out.warn("Directory: `%s' does not exist!" % directory)
+            return
+
         maxdepth = None if 'maxdepth' not in kargs else kargs['maxdepth']
         if maxdepth == 0:
             return
index 8779b76..7255f44 100644 (file)
@@ -108,9 +108,7 @@ class Unix(OSBase):
     def cleanup_mail(self):
         """Remove all files under /var/mail and /var/spool/mail"""
 
-        if self.image.g.is_dir('/var/spool/mail'):
-            self._foreach_file('/var/spool/mail', self.image.g.rm_rf,
-                               maxdepth=1)
+        self._foreach_file('/var/spool/mail', self.image.g.rm_rf, maxdepth=1)
 
         self._foreach_file('/var/mail', self.image.g.rm_rf, maxdepth=1)
 
index ef9765b..59db0cb 100644 (file)
@@ -1,7 +1,7 @@
-__version__ = "0.5"
-__version_info__ = ['0', '5']
+__version__ = "0.5.1"
+__version_info__ = ['0', '5', '1']
 __version_vcs_info__ = {
-    'branch': 'master',
-    'revid': '5079560',
-    'revno': 387}
+    'branch': 'hotfix-0.5.1',
+    'revid': 'b25b422',
+    'revno': 393}
 __version_user_info__ = "skalkoto@darkstar.admin.grnet.gr"
diff --git a/version b/version
index 2eb3c4f..4b9fcbe 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-0.5
+0.5.1