diff options
Diffstat (limited to 'cloudinit/CloudConfig/cc_runcmd.py')
-rw-r--r-- | cloudinit/CloudConfig/cc_runcmd.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cloudinit/CloudConfig/cc_runcmd.py b/cloudinit/CloudConfig/cc_runcmd.py index d255223b..cb297568 100644 --- a/cloudinit/CloudConfig/cc_runcmd.py +++ b/cloudinit/CloudConfig/cc_runcmd.py @@ -18,12 +18,13 @@ import cloudinit.util as util -def handle(_name,cfg,cloud,log,_args): - if not cfg.has_key("runcmd"): + +def handle(_name, cfg, cloud, log, _args): + if "runcmd" not in cfg: return - outfile="%s/runcmd" % cloud.get_ipath('scripts') + outfile = "%s/runcmd" % cloud.get_ipath('scripts') try: content = util.shellify(cfg["runcmd"]) - util.write_file(outfile,content,0700) + util.write_file(outfile, content, 0700) except: log.warn("failed to open %s for runcmd" % outfile) |