Ubuntu 10.04 LTS (Lucid Lynx) AMI: Difference between revisions

Line 158: Line 158:
base_url = 'http://169.254.169.254/%s/meta-data' % api_ver
base_url = 'http://169.254.169.254/%s/meta-data' % api_ver
my_ip = urllib.urlopen('%s/local-ipv4/' % base_url).read()
my_ip = urllib.urlopen('%s/local-ipv4/' % base_url).read()
my_fqdn = os.popen("/bin/cat /etc/hostname").read().rstrip()
my_fqdn = os.popen("/bin/hostname -f").read().rstrip()
ip = IP(my_ip)
ip = IP(my_ip)
my_arpa = ip.reverseName().rstrip('.')
my_arpa = ip.reverseName().rstrip('.')