diff -Nru cloud-init-0.6.3/debian/changelog cloud-init-0.6.3/debian/changelog --- cloud-init-0.6.3/debian/changelog 2015-03-11 16:56:20.000000000 +0000 +++ cloud-init-0.6.3/debian/changelog 2015-07-17 17:22:15.000000000 +0000 @@ -1,3 +1,13 @@ +cloud-init (0.6.3-0ubuntu1.18) precise; urgency=medium + + * d/patches/lp-1456684-eu-central-1.patch: + - Add central as a direction for EC2 availability zones (LP: #1456684). + * d/patches/lp-1464253-handle-new-cloudstack-passwords.patch: + - Handle both old and new CloudStack password servers (LP: #1464253). + * Add python-serial to Depends (LP: #1381776). + + -- Daniel Watkins Thu, 16 Jul 2015 17:14:18 +0100 + cloud-init (0.6.3-0ubuntu1.17) precise; urgency=medium * Backport support for fetching passwords in CloudStack (LP: #1422388). diff -Nru cloud-init-0.6.3/debian/control cloud-init-0.6.3/debian/control --- cloud-init-0.6.3/debian/control 2014-09-18 22:24:36.000000000 +0000 +++ cloud-init-0.6.3/debian/control 2015-07-17 17:22:15.000000000 +0000 @@ -23,6 +23,7 @@ python-cheetah, python-configobj, python-oauth, + python-serial, python-software-properties, python-yaml, ${misc:Depends}, diff -Nru cloud-init-0.6.3/debian/patches/lp-1456684-eu-central-1.patch cloud-init-0.6.3/debian/patches/lp-1456684-eu-central-1.patch --- cloud-init-0.6.3/debian/patches/lp-1456684-eu-central-1.patch 1970-01-01 00:00:00.000000000 +0000 +++ cloud-init-0.6.3/debian/patches/lp-1456684-eu-central-1.patch 2015-07-17 17:22:15.000000000 +0000 @@ -0,0 +1,21 @@ +Description: Add central as a direction for EC2 AZs +Author: Scott Moser +Origin: upstream, http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/1108 +Bug: https://bugs.launchpad.net/cloud-init/+bug/1456684 +--- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py ++++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py +@@ -313,8 +313,12 @@ + # search through the 'search' entries, and fallback appropriately + # return a dict with only {name: mirror} entries. + +- ec2_az_re = ("^[a-z][a-z]-(%s)-[1-9][0-9]*[a-z]$" % +- "north|northeast|east|southeast|south|southwest|west|northwest") ++ # ec2 availability zones are named cc-direction-[0-9][a-d] (us-east-1b) ++ # the region is us-east-1. so region = az[0:-1] ++ directions_re = '|'.join([ ++ 'central', 'east', 'north', 'northeast', 'northwest', ++ 'south', 'southeast', 'southwest', 'west']) ++ ec2_az_re = ("^[a-z][a-z]-(%s)-[1-9][0-9]*[a-z]$" % directions_re) + + subst = {} + if availability_zone: diff -Nru cloud-init-0.6.3/debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch cloud-init-0.6.3/debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch --- cloud-init-0.6.3/debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch 1970-01-01 00:00:00.000000000 +0000 +++ cloud-init-0.6.3/debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch 2015-07-17 17:22:15.000000000 +0000 @@ -0,0 +1,62 @@ +Description: Use wget to fetch CloudStack passwords. +Author: Daniel Watkins +Origin: upstream, http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/1118 +Bug: https://bugs.launchpad.net/cloud-init/+bug/1464253 + +--- a/cloudinit/DataSourceCloudStack.py ++++ b/cloudinit/DataSourceCloudStack.py +@@ -28,8 +28,6 @@ + import boto.utils as boto_utils + from struct import pack + +-import httplib as http_client +- + + class CloudStackPasswordServerClient(object): + """ +@@ -39,35 +37,22 @@ + has documentation about the system. This implementation is following that + found at + https://github.com/shankerbalan/cloudstack-scripts/blob/master/cloud-set-guest-password-debian +- +- The CloudStack password server is, essentially, a broken HTTP +- server. It requires us to provide a valid HTTP request (including a +- DomU_Request header, which is the meat of the request), but just +- writes the text of its response on to the socket, without a status +- line or any HTTP headers. This makes HTTP libraries sad, which +- explains the screwiness of the implementation of this class. +- +- This should be fixed in CloudStack by commit +- a72f14ea9cb832faaac946b3cf9f56856b50142a in December 2014. + """ + + def __init__(self, virtual_router_address): + self.virtual_router_address = virtual_router_address + + def _do_request(self, domu_request): +- # We have to provide a valid HTTP request, but a valid HTTP +- # response is not returned. This means that getresponse() chokes, +- # so we use the socket directly to read off the response. +- # Because we're reading off the socket directly, we can't re-use the +- # connection. +- conn = http_client.HTTPConnection(self.virtual_router_address, 8080) +- try: +- conn.request('GET', '', headers={'DomU_Request': domu_request}) +- conn.sock.settimeout(30) +- output = conn.sock.recv(1024).decode('utf-8').strip() +- finally: +- conn.close() +- return output ++ # The password server was in the past, a broken HTTP server, but is now ++ # fixed. wget handles this seamlessly, so it's easier to shell out to ++ # that rather than write our own handling code. ++ output, _ = util.subp([ ++ 'wget', '--quiet', '--tries', '3', '--timeout', '20', ++ '--output-document', '-', '--header', ++ 'DomU_Request: {0}'.format(domu_request), ++ '{0}:8080'.format(self.virtual_router_address) ++ ]) ++ return output.strip() + + def get_password(self): + password = self._do_request('send_my_password') diff -Nru cloud-init-0.6.3/debian/patches/series cloud-init-0.6.3/debian/patches/series --- cloud-init-0.6.3/debian/patches/series 2015-03-11 16:56:17.000000000 +0000 +++ cloud-init-0.6.3/debian/patches/series 2015-07-17 17:22:15.000000000 +0000 @@ -28,3 +28,5 @@ lp-1383794-gce-short_name.patch lp-1404311-gce-data_encoding.patch lp-1422388-cloudstack-passwords.patch +lp-1456684-eu-central-1.patch +lp-1464253-handle-new-cloudstack-passwords.patch