summaryrefslogtreecommitdiff
path: root/cloudinit/execute.py
blob: 033da8f79f7427031aaa00b0310014d1d34419c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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)