From aed1c1e9fda1e78d19305e90f554d0dcb5388cd7 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 3 Feb 2010 18:09:48 -0500 Subject: globally remove ec2init and rename to cloudinit --- cloudinit/execute.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 cloudinit/execute.py (limited to 'cloudinit/execute.py') 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) -- cgit v1.2.3