diff options
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | debian/patches/lp-1456684-eu-central-1.patch | 21 | ||||
-rw-r--r-- | debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch | 62 | ||||
-rw-r--r-- | debian/patches/series | 2 |
5 files changed, 96 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index aace33a0..65158959 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 <daniel.watkins@canonical.com> 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 --git a/debian/control b/debian/control index fdf36565..78c24f08 100644 --- a/debian/control +++ b/debian/control @@ -23,6 +23,7 @@ Depends: cloud-utils, python-cheetah, python-configobj, python-oauth, + python-serial, python-software-properties, python-yaml, ${misc:Depends}, diff --git a/debian/patches/lp-1456684-eu-central-1.patch b/debian/patches/lp-1456684-eu-central-1.patch new file mode 100644 index 00000000..7043d82e --- /dev/null +++ b/debian/patches/lp-1456684-eu-central-1.patch @@ -0,0 +1,21 @@ +Description: Add central as a direction for EC2 AZs +Author: Scott Moser <smoser@ubuntu.com> +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 --git a/debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch b/debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch new file mode 100644 index 00000000..70dcd7b7 --- /dev/null +++ b/debian/patches/lp-1464253-handle-new-cloudstack-passwords.patch @@ -0,0 +1,62 @@ +Description: Use wget to fetch CloudStack passwords. +Author: Daniel Watkins <daniel.watkins@canonical.com> +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 --git a/debian/patches/series b/debian/patches/series index 77b19b8c..d7ff135c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -28,3 +28,5 @@ lp-1378441-backport-gce-data-source.patch 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 |