diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-01-17 14:41:29 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-01-17 14:41:29 -0500 |
commit | 15e3241ba725a21604e0f3570e755a91b5edba00 (patch) | |
tree | d84be61c3a56ddc03eb927d5de5433afacadf64b /cloud-init.py | |
parent | 2f7227c7092ad873757167f62c2a82fb4ee69472 (diff) | |
download | vyos-cloud-init-15e3241ba725a21604e0f3570e755a91b5edba00.tar.gz vyos-cloud-init-15e3241ba725a21604e0f3570e755a91b5edba00.zip |
[PATCH] PEP8 coding style fixes.
From: Juerg Haefliger <juerg.haefliger@hp.com>
This pulls in the named patch for LP: #914739 with a few other changes.
Diffstat (limited to 'cloud-init.py')
-rwxr-xr-x | cloud-init.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cloud-init.py b/cloud-init.py index 9806c22c..f9f71949 100755 --- a/cloud-init.py +++ b/cloud-init.py @@ -30,15 +30,17 @@ import logging import errno import os + def warn(wstr): sys.stderr.write("WARN:%s" % wstr) + def main(): util.close_stdin() - cmds = ( "start", "start-local" ) - deps = { "start" : ( ds.DEP_FILESYSTEM, ds.DEP_NETWORK ), - "start-local" : ( ds.DEP_FILESYSTEM, ) } + cmds = ("start", "start-local") + deps = {"start": (ds.DEP_FILESYSTEM, ds.DEP_NETWORK), + "start-local": (ds.DEP_FILESYSTEM, )} cmd = "" if len(sys.argv) > 1: @@ -92,7 +94,7 @@ def main(): if cmd == "start": print netinfo.debug_info() - stop_files = ( cloudinit.get_ipath_cur("obj_pkl"), nonet_path ) + stop_files = (cloudinit.get_ipath_cur("obj_pkl"), nonet_path) # if starting as the network start, there are cases # where everything is already done for us, and it makes # most sense to exit early and silently @@ -102,7 +104,7 @@ def main(): fp.close() except: continue - + log.debug("no need for cloud-init start to run (%s)\n", f) sys.exit(0) elif cmd == "start-local": @@ -172,10 +174,10 @@ def main(): cc_path = cloudinit.get_ipath_cur('cloud_config') cc_ready = cc.cfg.get("cc_ready_cmd", ['initctl', 'emit', 'cloud-config', - '%s=%s' % (cloudinit.cfg_env_name, cc_path) ]) + '%s=%s' % (cloudinit.cfg_env_name, cc_path)]) if cc_ready: if isinstance(cc_ready, str): - cc_ready = [ 'sh', '-c', cc_ready] + cc_ready = ['sh', '-c', cc_ready] subprocess.Popen(cc_ready).communicate() module_list = CC.read_cc_modules(cc.cfg, "cloud_init_modules") |