\r
if args.ignore_ksrepo:\r
configmgr.create['ignore_ksrepo'] = args.ignore_ksrepo\r
+ if args.run_script:\r
+ configmgr.create['run_script'] = args.run_script\r
\r
creater = createrClass()\r
creater.do_create(args)\r
"extrarepos": {},
"ignore_ksrepo": False,
"strict_mode": False,
+ "run_script": None,
},
'chroot': {
"saveto": None,
# with this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import subprocess
from mic import chroot, msger, rt_util
from mic.utils import misc, errors, fs_related
from mic.imager import fs
finally:
creator.cleanup()
+ #Run script of --run_script after image created
+ if creatoropts['run_script']:
+ cmd = creatoropts['run_script']
+ msger.info("Running command in parameter run_script: "+"".join(cmd))
+ try:
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
+ p.communicate()
+ except OSError,err:
+ msger.warning(str(err))
+
+
msger.info("Finished.")
return 0
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os
+import subprocess
import shutil
import tempfile
finally:
creator.cleanup()
+ #Run script of --run_script after image created
+ if creatoropts['run_script']:
+ cmd = creatoropts['run_script']
+ msger.info("Running command in parameter run_script: "+"".join(cmd))
+ try:
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
+ p.communicate()
+ except OSError,err:
+ msger.warning(str(err))
+
msger.info("Finished.")
return 0
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os
+import subprocess
import shutil
from mic import msger, rt_util
finally:
creator.cleanup()
+ #Run script of --run_script after image created
+ if creatoropts['run_script']:
+ cmd = creatoropts['run_script']
+ msger.info("Running command in parameter run_script: "+"".join(cmd))
+ try:
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
+ p.communicate()
+ except OSError,err:
+ msger.warning(str(err))
+
+
msger.info("Finished.")
return 0
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os
+import subprocess
import shutil
import re
import tempfile
finally:
creator.cleanup()
+ #Run script of --run_script after image created
+ if creatoropts['run_script']:
+ cmd = creatoropts['run_script']
+ msger.info("Running command in parameter run_script: "+"".join(cmd))
+ try:
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
+ p.communicate()
+ except OSError,err:
+ msger.warning(str(err))
+
+
msger.info("Finished.")
return 0
parent_parser.add_argument('-i', '--interactive', action='store_true',
dest='interactive', default=True,
help='interactive output')
+ parent_parser.add_argument('--run_script', action='store', dest='run_script',
+ default=None, help='Run script on local PC after image created')
parser.set_defaults(alias="cr")