call copy_attachment() after configure() and move attachment files
[tools/mic.git] / plugins / imager / qcow_plugin.py
old mode 100644 (file)
new mode 100755 (executable)
index 8acf572..a1d808a
@@ -15,6 +15,7 @@
 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 import os
+import subprocess
 import shutil
 
 from mic import msger, rt_util
@@ -133,7 +134,10 @@ class QcowPlugin(ImagerPlugin):
             creator.install()
             creator.configure(creatoropts["repomd"])
             creator.copy_kernel()
+            creator.copy_attachment()
+            creator.create_cpio_image()
             creator.unmount()
+            creator.copy_cpio_image()
             creator.package(creatoropts["destdir"])
             creator.create_manifest()
 
@@ -148,6 +152,15 @@ class QcowPlugin(ImagerPlugin):
         finally:
             creator.cleanup()
 
+        #Run script of --run_script after image created
+        if creatoropts['run_script']:
+            cmd = creatoropts['run_script']
+            try:
+                runner.show(cmd)
+            except OSError,err:
+                msger.warning(str(err))
+
+
         msger.info("Finished.")
         return 0