diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2-get-info.py ec2-init.devel-submit/ec2-get-info.py --- ec2-init.devel/ec2-get-info.py 2010-01-22 16:10:22.765851900 +0000 +++ ec2-init.devel-submit/ec2-get-info.py 2010-01-22 17:58:16.705849967 +0000 @@ -44,7 +44,7 @@ def getData(ec2data): api_ver = '2008-02-01' base_url = 'http://169.254.169.254/%s/meta-data' % api_ver - print "%s: %s" %(ec2data,urllib.urlopen('%s/%s' %(base_url,ec2data)).read()) + print "%s: %s" %(ec2data,urllib.urlopen('%s/%s' %(base_url,ec2data),proxies={}).read()) def getAllData(ec2Data): for x in ec2Data: @@ -61,7 +61,7 @@ parser.add_option('--block-device', dest='block', action='store_true', help='Display the block device id.') parser.add_option('--instance-id', dest='id', action='store_true', help='Display the instance id.') parser.add_option('--instance-type', dest='type', action='store_true', help='Display the instance type.') - parser.add_option('--local-hostname', dest='lhostname', action='store_true', help='Display the local hostname.') + parser.add_option('--local-hostname', dest='lhostname', action='store_true', help='Display the local hostname.') parser.add_option('--local-ipv4', dest='lipv4', action='store_true', help='Display the local ipv4 IP address.') parser.add_option('--kernel-id', dest='aki', action='store_true', help='List the AKI.') parser.add_option('--product-codes', dest='code', action='store_true', help='List the product codes associated with thsi AMI.') diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2init/boto_utils.py ec2-init.devel-submit/ec2init/boto_utils.py --- ec2-init.devel/ec2init/boto_utils.py 2010-01-21 19:19:44.016153878 +0000 +++ ec2-init.devel-submit/ec2init/boto_utils.py 2010-01-22 15:48:41.846164423 +0000 @@ -35,6 +35,8 @@ # affiliates. import urllib2 import sys +import boto +import time def retry_url(url, retry_on_404=True): for i in range(0, 10): @@ -52,11 +54,11 @@ return '' except: pass - boto.log.exception('Caught exception reading instance data') - sys.stderr.write('Caught exception reading instance data') + boto.log.exception('Caught exception reading instance data: %s' % url) + sys.stderr.write('Caught exception reading instance data: %s\n' % url) time.sleep(2**i) - #boto.log.error('Unable to read instance data, giving up') - sys.stderr.write('Caught exception reading instance data') + boto.log.error('Unable to read instance data, giving up') + sys.stderr.write('Caught exception reading instance data\n') return '' def get_instance_metadata(version='latest'): diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2init/CloudConfig.py ec2-init.devel-submit/ec2init/CloudConfig.py --- ec2-init.devel/ec2init/CloudConfig.py 2010-01-22 20:00:31.046163228 +0000 +++ ec2-init.devel-submit/ec2init/CloudConfig.py 2010-01-22 20:00:33.766145376 +0000 @@ -187,8 +187,8 @@ disable_root = util.get_cfg_option_bool(self.cfg, "disable_root", True) keys = self.cloud.get_public_ssh_keys() apply_credentials(keys,user,disable_root) - except: - warn("applying credentials failed!\n") + except Exception as e: + warn("Applying credentials failed: %s\n" % e) send_ssh_keys_to_console() @@ -251,5 +251,5 @@ def warn(str): - sys.stderr.write("Warning:%s\n" % str) + sys.stderr.write("Warning: %s\n" % str) diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2init/DataSourceEc2.py ec2-init.devel-submit/ec2init/DataSourceEc2.py --- ec2-init.devel/ec2init/DataSourceEc2.py 2010-01-21 19:19:44.016153878 +0000 +++ ec2-init.devel-submit/ec2init/DataSourceEc2.py 2010-01-22 16:11:15.876162232 +0000 @@ -36,6 +36,7 @@ try: if not self.wait_for_metadata_service(): + print "No metadata service" return False self.userdata_raw = boto_utils.get_instance_userdata(self.api_ver) self.metadata = boto_utils.get_instance_metadata(self.api_ver) diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2init/__init__.py ec2-init.devel-submit/ec2init/__init__.py --- ec2-init.devel/ec2init/__init__.py 2010-01-22 19:48:12.375838667 +0000 +++ ec2-init.devel-submit/ec2init/__init__.py 2010-01-22 19:52:21.765851188 +0000 @@ -87,7 +87,7 @@ pass if not conf.has_key("cloud_type"): - conf["cloud_type"]=None + conf["cloud_type"]='auto' return(conf) diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2init/UserDataHandler.py ec2-init.devel-submit/ec2init/UserDataHandler.py --- ec2-init.devel/ec2init/UserDataHandler.py 2010-01-21 19:19:44.026163466 +0000 +++ ec2-init.devel-submit/ec2init/UserDataHandler.py 2010-01-21 19:47:19.565849739 +0000 @@ -25,7 +25,7 @@ # is just a list of urls, one per line for line in str.splitlines(): if line == "#include": continue - content = urllib.urlopen(line).read() + content = urllib.urlopen(line,proxies={}).read() process_includes(email.message_from_string(decomp_str(content)),parts) def process_includes(msg,parts): diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2-init.py ec2-init.devel-submit/ec2-init.py --- ec2-init.devel/ec2-init.py 2010-01-22 19:54:24.886162465 +0000 +++ ec2-init.devel-submit/ec2-init.py 2010-01-22 19:54:25.935849562 +0000 @@ -16,7 +16,7 @@ cloud.get_data_source() except Exception as e: print e - sys.stderr.write("Failed to get instance data") + sys.stderr.write("Failed to get instance data\n") sys.exit(1) hostname = cloud.get_hostname() diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/ec2-is-compat-env ec2-init.devel-submit/ec2-is-compat-env --- ec2-init.devel/ec2-is-compat-env 2010-01-21 19:19:44.026163466 +0000 +++ ec2-init.devel-submit/ec2-is-compat-env 2010-01-22 14:30:26.996163007 +0000 @@ -7,7 +7,7 @@ CR=" " VERBOSE=1 -META_DATA_URL=http://169.254.169.254/2009-04-04 +META_DATA_URL=http://169.254.169.254/2009-04-04/meta-data check_md=0 Usage() { @@ -49,8 +49,8 @@ index=$(wget --connect-timeout=2 --tries 2 -O - -q "${META_DATA_URL}") || xit 1 - # exit true if content of url a line with 'meta-data' at start - [ "${index#*${CR}meta-data}" = "${index}" ] || xit 0 + # exit true if content of url a line with 'instance-id' at start + [ "${index#*${CR}instance-id}" = "${index}" ] || xit 0 xit 1 fi diff -x upstart -x .bzr -x build -x debian -urN ec2-init.devel/setup.py ec2-init.devel-submit/setup.py --- ec2-init.devel/setup.py 2010-01-21 19:19:44.026163466 +0000 +++ ec2-init.devel-submit/setup.py 2010-01-22 20:01:35.515850692 +0000 @@ -30,6 +30,7 @@ url='http://launchpad.net/ec2-init/', packages=['ec2init'], scripts=['ec2-init.py', + 'ec2-get-info.py', 'ec2-is-compat-env', 'cloud-init-run-module.py', 'cloud-init-cfg.py'