
supports user data as mime-multipart and handling types of text/x-shellscript - execute at rc.local text/cloud-config - feed to cloud config text/upstart-job - add to /etc/init as upstart job text/x-include-url - include urls as if they were in-line
14 lines
291 B
Python
14 lines
291 B
Python
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)
|