summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2010-01-22 09:26:15 -0500
committerScott Moser <smoser@ubuntu.com>2010-01-22 09:26:15 -0500
commit025a7f478cacfeddfc15ac1e2f7ba586394ae03e (patch)
tree4acdd165c3106f1b045ecbb5bd25a51bfe868461
parentd32830e30b669a9eb08962531d2e4cf33d565596 (diff)
downloadvyos-cloud-init-025a7f478cacfeddfc15ac1e2f7ba586394ae03e.tar.gz
vyos-cloud-init-025a7f478cacfeddfc15ac1e2f7ba586394ae03e.zip
typo fixes to ec2-get-info (LP: #510773)
LP: #510773
-rwxr-xr-xec2-get-info.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/ec2-get-info.py b/ec2-get-info.py
index 6af780ef..ad8388be 100755
--- a/ec2-get-info.py
+++ b/ec2-get-info.py
@@ -35,26 +35,20 @@ ec2Data = ['ami-id',
'public-hostname',
'public-ipv4',
'ramdisk-id',
- 'reserveration-id',
+ 'reservation-id',
'security-groups']
def ec2Version():
- os.system("cat /etc/ec2_version")
+ print file("/etc/ec2_version").read()
def getData(ec2data):
api_ver = '2008-02-01'
- metadata = None
base_url = 'http://169.254.169.254/%s/meta-data' % api_ver
- data = urllib.urlopen('%s/%s' %(base_url,ec2data)).read()
- print "%s: %s" %(ec2data,data)
+ print "%s: %s" %(ec2data,urllib.urlopen('%s/%s' %(base_url,ec2data)).read())
-def showAllData(ec2Data):
- api_ver = '2008-02-01'
- metadata = None
- base_url = 'http://169.254.169.254/%s/meta-data' % api_ver
+def getAllData(ec2Data):
for x in ec2Data:
- data = urllib.urlopen('%s/%s' %(base_url,x)).read()
- print "%s: %s" %(ec2data,data)
+ getData(x)
def main():
usage = "usage: %prog [options]"
@@ -116,8 +110,7 @@ def main():
if options.ec2:
ec2Version()
if options.all:
- for i in range(0,15):
- getData(ec2Data[i])
+ getAllData(ec2Data)
if __name__ == "__main__":
main()