summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-01-10 17:17:06 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-01-10 17:17:06 -0800
commit5cdaaee97ea850adc75a4e88dbd2578c84bded51 (patch)
tree61ff02248f3857ce165115fb17b98deb7585cad9 /cloudinit
parent6c7e09cc8ab6955fe2c03a925d74ebdce19e7b56 (diff)
downloadvyos-cloud-init-5cdaaee97ea850adc75a4e88dbd2578c84bded51.tar.gz
vyos-cloud-init-5cdaaee97ea850adc75a4e88dbd2578c84bded51.zip
Add ec2 utils tests and httpretty requirement for http mocking
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/ec2_utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/ec2_utils.py b/cloudinit/ec2_utils.py
index 605154bc..c46adc6b 100644
--- a/cloudinit/ec2_utils.py
+++ b/cloudinit/ec2_utils.py
@@ -81,9 +81,9 @@ class MetadataMaterializer(object):
if len(contents) > 1:
# What a PITA...
(ident, sub_contents) = contents
- checked_ident = util.safe_int(ident)
- if checked_ident is not None:
- resource = "%s/openssh-key" % (checked_ident)
+ ident = util.safe_int(ident)
+ if ident is not None:
+ resource = "%s/openssh-key" % (ident)
field_name = sub_contents
leaves[field_name] = resource
return (leaves, children)
@@ -145,7 +145,7 @@ def get_instance_userdata(api_version='latest',
return str(response)
except Exception:
util.logexc(LOG, "Failed fetching userdata from url %s", ud_url)
- return None
+ return ''
def get_instance_metadata(api_version='latest',