Add sysprep method in os_type classes.
[snf-image-creator] / image_creator / main.py
index 3b25bc5..c08906f 100644 (file)
@@ -65,14 +65,18 @@ def parse_options(input_args):
     parser.add_option("-f", "--force", dest="force", default=False,
         action="store_true", help="Overwrite output files if they exist")
 
-    parser.add_option("--no-shrink", dest="shrink", default=True,
-        help="Don't shrink any partition before extracting the image",
-        action="store_false")
-
     parser.add_option("--no-cleanup", dest="cleanup", default=True,
         help="Don't cleanup sensitive data before extracting the image",
         action="store_false")
 
+    parser.add_option("--no-sysprep", dest="sysprep", default=True,
+        help="Don't perform system preperation before extracting the image",
+        action="store_false")
+
+    parser.add_option("--no-shrink", dest="shrink", default=True,
+        help="Don't shrink any partition before extracting the image",
+        action="store_false")
+
     parser.add_option("-u", "--upload", dest="upload", default=False,
         help="Upload image to a pithos repository using kamaki",
         action="store_true")
@@ -118,6 +122,9 @@ def main():
         osclass = get_os_class(dev.distro, dev.ostype)
         image_os = osclass(dev.root, dev.g)
         metadata = image_os.get_metadata()
+
+        if options.sysprep:
+            image_os.sysprep()
         
         if options.cleanup:
             image_os.data_cleanup()