diff options
author | Scott Moser <smoser@ubuntu.com> | 2010-02-03 18:09:48 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2010-02-03 18:09:48 -0500 |
commit | aed1c1e9fda1e78d19305e90f554d0dcb5388cd7 (patch) | |
tree | 7f0dd15537201ea49217ba6ec3040ede9b0426f4 /cloudinit/execute.py | |
parent | ff522791cb2b58e83da4efea1be76757f05a1f1f (diff) | |
download | vyos-cloud-init-aed1c1e9fda1e78d19305e90f554d0dcb5388cd7.tar.gz vyos-cloud-init-aed1c1e9fda1e78d19305e90f554d0dcb5388cd7.zip |
globally remove ec2init and rename to cloudinit
Diffstat (limited to 'cloudinit/execute.py')
-rw-r--r-- | cloudinit/execute.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cloudinit/execute.py b/cloudinit/execute.py new file mode 100644 index 00000000..033da8f7 --- /dev/null +++ b/cloudinit/execute.py @@ -0,0 +1,13 @@ +def run(list,cfg): + import subprocess + retcode = subprocess.call(list) + + if retcode == 0: + return + + if retcode < 0: + str="Cmd terminated by signal %s\n" % -retcode + else: + str="Cmd returned %s\n" % retcode + str+=' '.join(list) + raise Exception(str) |