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 /cloudinit/CloudConfig/cc_rightscale_userdata.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 'cloudinit/CloudConfig/cc_rightscale_userdata.py')
-rw-r--r-- | cloudinit/CloudConfig/cc_rightscale_userdata.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cloudinit/CloudConfig/cc_rightscale_userdata.py b/cloudinit/CloudConfig/cc_rightscale_userdata.py index 61aa89d1..d6e93aa3 100644 --- a/cloudinit/CloudConfig/cc_rightscale_userdata.py +++ b/cloudinit/CloudConfig/cc_rightscale_userdata.py @@ -24,9 +24,9 @@ ## for cloud-init support, there will be a key named ## 'CLOUD_INIT_REMOTE_HOOK'. ## -## This cloud-config module will +## This cloud-config module will ## - read the blob of data from raw user data, and parse it as key/value -## - for each key that is found, download the content to +## - for each key that is found, download the content to ## the local instance/scripts directory and set them executable. ## - the files in that directory will be run by the user-scripts module ## Therefore, this must run before that. @@ -42,6 +42,7 @@ frequency = per_instance my_name = "cc_rightscale_userdata" my_hookname = 'CLOUD_INIT_REMOTE_HOOK' + def handle(_name, _cfg, cloud, log, _args): try: ud = cloud.get_userdata_raw() @@ -62,7 +63,7 @@ def handle(_name, _cfg, cloud, log, _args): first_e = None for url in mdict[my_hookname]: fname = "%s/rightscale-%02i" % (scripts_d, i) - i = i +1 + i = i + 1 try: content = util.readurl(url) util.write_file(fname, content, mode=0700) @@ -70,6 +71,6 @@ def handle(_name, _cfg, cloud, log, _args): if not first_e: first_e = None log.warn("%s failed to read %s: %s" % (my_name, url, e)) - + if first_e: raise(e) |