cloud-init/ec2init/execute.py
Scott Moser 7e387c478e functional state now in kvm tests
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
2010-01-07 16:07:01 -05:00

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)