summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryuhuan.yang <yuhuan.yang@123.com>2017-07-18 00:12:38 +0800
committeryuhuan.yang <yuhuan.yang@123.com>2017-07-18 00:13:19 +0800
commitc8c46eef23bf9327f95cfa83400d1986e372202e (patch)
tree7538617cad500042bac0cceece26726927fba7b5
parent37990a24ee9d73b35db5cefa60af9ec6f9fb2338 (diff)
downloadmic-c8c46eef23bf9327f95cfa83400d1986e372202e.tar.gz
mic-c8c46eef23bf9327f95cfa83400d1986e372202e.tar.bz2
mic-c8c46eef23bf9327f95cfa83400d1986e372202e.zip
Amend mic cr option of run_script
Change-Id: Ib088fb9d56b08c9aeae01908827f5507d972cdec
-rwxr-xr-xplugins/imager/fs_plugin.py6
-rwxr-xr-xplugins/imager/loop_plugin.py6
-rwxr-xr-xplugins/imager/qcow_plugin.py4
-rwxr-xr-xplugins/imager/raw_plugin.py4
4 files changed, 6 insertions, 14 deletions
diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py
index a6b5cf8..b2701a0 100755
--- a/plugins/imager/fs_plugin.py
+++ b/plugins/imager/fs_plugin.py
@@ -17,7 +17,7 @@
import subprocess
from mic import chroot, msger, rt_util
-from mic.utils import misc, errors, fs_related
+from mic.utils import misc, errors, fs_related, runner
from mic.imager import fs
from mic.conf import configmgr
from mic.plugin import pluginmgr
@@ -118,10 +118,8 @@ class FsPlugin(ImagerPlugin):
#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()
+ runner.show(cmd)
except OSError,err:
msger.warning(str(err))
diff --git a/plugins/imager/loop_plugin.py b/plugins/imager/loop_plugin.py
index c3fa67b..6034a29 100755
--- a/plugins/imager/loop_plugin.py
+++ b/plugins/imager/loop_plugin.py
@@ -21,7 +21,7 @@ import shutil
import tempfile
from mic import chroot, msger, rt_util
-from mic.utils import misc, fs_related, errors
+from mic.utils import misc, fs_related, errors, runner
from mic.conf import configmgr
from mic.plugin import pluginmgr
from mic.imager.loop import LoopImageCreator, load_mountpoints
@@ -123,10 +123,8 @@ class LoopPlugin(ImagerPlugin):
#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()
+ runner.show(cmd)
except OSError,err:
msger.warning(str(err))
diff --git a/plugins/imager/qcow_plugin.py b/plugins/imager/qcow_plugin.py
index 27a712b..a81e291 100755
--- a/plugins/imager/qcow_plugin.py
+++ b/plugins/imager/qcow_plugin.py
@@ -154,10 +154,8 @@ class QcowPlugin(ImagerPlugin):
#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()
+ runner.show(cmd)
except OSError,err:
msger.warning(str(err))
diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py
index 554eac7..1524e74 100755
--- a/plugins/imager/raw_plugin.py
+++ b/plugins/imager/raw_plugin.py
@@ -117,10 +117,8 @@ class RawPlugin(ImagerPlugin):
#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()
+ runner.show(cmd)
except OSError,err:
msger.warning(str(err))