Merge branch 'hotfix-0.4.4' into develop
authorNikos Skalkotos <skalkoto@grnet.gr>
Wed, 31 Jul 2013 12:53:59 +0000 (15:53 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Wed, 31 Jul 2013 12:53:59 +0000 (15:53 +0300)
Conflicts:
image_creator/os_type/unix.py
image_creator/version.py
version

ChangeLog
docs/conf.py
image_creator/os_type/__init__.py
image_creator/os_type/unix.py
image_creator/version.py
version

index dd3e87f..60271d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-31, v0.4.4
+       * Fix a bug where the system tried to use file scrubbing without
+          checking if it was supported
+
 2013-07-18, v0.4.3
        * Force TERM=linux when working on xterm. This makes dialog behave
          better under OpenSUSE
index 86eeb36..0f38fb5 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.4.3'
+version = '0.4.4'
 # The full version, including alpha/beta/rc tags.
-release = '0.4.3'
+release = '0.4.4'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index 69e45d9..cc7d39a 100644 (file)
@@ -138,6 +138,13 @@ class OSBase(object):
         self.meta = {}
         self.mounted = False
 
+        # Many guestfs compilations don't support scrub
+        self._scrub_support = True
+        try:
+            self.g.available(['scrub'])
+        except RuntimeError:
+            self._scrub_support = False
+
     def collect_metadata(self):
         """Collect metadata about the OS"""
         try:
index 504f2ad..7e3ba22 100644 (file)
@@ -121,12 +121,18 @@ class Unix(OSBase):
         if self.g.is_dir('/home/'):
             homedirs += self._ls('/home/')
 
+        action = self.g.rm_rf
+        if self._scrub_support:
+            action = self.g.scrub_file
+        else:
+            self.out.warn("Sensitive data won't be scrubbed (not supported)")
+
         for homedir in homedirs:
             for data in self.sensitive_userdata:
                 fname = "%s/%s" % (homedir, data)
                 if self.g.is_file(fname):
-                    self.g.scrub_file(fname)
+                    action(fname)
                 elif self.g.is_dir(fname):
-                    self._foreach_file(fname, self.g.scrub_file, ftype='r')
+                    self._foreach_file(fname, action, ftype='r')
 
 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
index f58201b..dc31a71 100644 (file)
@@ -1,8 +1,8 @@
 
-__version__ = "0.4.3next"
+__version__ = "0.4.4next"
 __version_vcs_info__ = {
     'branch': 'develop',
-    'revid': '64556e6',
-    'revno': 330}
+    'revid': 'c5effe0',
+    'revno': 370}
 __version_user_email__ = "skalkoto@grnet.gr"
 __version_user_name__ = "Nikos Skalkotos"
diff --git a/version b/version
index 9066278..15c226a 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-0.4.3next
+0.4.4next