diff options
-rw-r--r-- | debian/changelog | 9 | ||||
-rw-r--r-- | debian/patches/lp-1553158-bigstep.patch | 87 | ||||
-rw-r--r-- | debian/patches/series | 1 |
3 files changed, 97 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 91d461de..11f41249 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +cloud-init (0.7.5-0ubuntu1.19) trusty; urgency=medium + + * Bigstep: + - debian/patches/lp-1553158-bigstep.patch (LP: #1553158): + - Add the data source for the Bigstep cloud + - Enable password changing via a hashed string + + -- Daniel Watkins <daniel.watkins@canonical.com> Tue, 31 May 2016 13:42:32 +0100 + cloud-init (0.7.5-0ubuntu1.18) trusty-security; urgency=medium * No change rebuild in the -security pocket. diff --git a/debian/patches/lp-1553158-bigstep.patch b/debian/patches/lp-1553158-bigstep.patch new file mode 100644 index 00000000..2ad4fbfd --- /dev/null +++ b/debian/patches/lp-1553158-bigstep.patch @@ -0,0 +1,87 @@ +Author: Alexandru Sirbu <alexandru.sirbu@bigstep.com> +Bug: https://bugs.launchpad.net/bugs/1553158 +Applied-Upstream: yes (revno 1175) +Description: Add Bigstep data source +--- /dev/null ++++ b/cloudinit/sources/DataSourceBigstep.py +@@ -0,0 +1,57 @@ ++# ++# Copyright (C) 2015-2016 Bigstep Cloud Ltd. ++# ++# Author: Alexandru Sirbu <alexandru.sirbu@bigstep.com> ++# ++ ++import json ++import errno ++ ++from cloudinit import log as logging ++from cloudinit import sources ++from cloudinit import util ++from cloudinit import url_helper ++ ++LOG = logging.getLogger(__name__) ++ ++ ++class DataSourceBigstep(sources.DataSource): ++ def __init__(self, sys_cfg, distro, paths): ++ sources.DataSource.__init__(self, sys_cfg, distro, paths) ++ self.metadata = {} ++ self.vendordata_raw = "" ++ self.userdata_raw = "" ++ ++ def get_data(self, apply_filter=False): ++ url = get_url_from_file() ++ if url is None: ++ return False ++ response = url_helper.readurl(url) ++ decoded = json.loads(response.contents) ++ self.metadata = decoded["metadata"] ++ self.vendordata_raw = decoded["vendordata_raw"] ++ self.userdata_raw = decoded["userdata_raw"] ++ return True ++ ++ ++def get_url_from_file(): ++ try: ++ content = util.load_file("/var/lib/cloud/data/seed/bigstep/url") ++ except IOError as e: ++ # If the file doesn't exist, then the server probably isn't a Bigstep ++ # instance; otherwise, another problem exists which needs investigation ++ if e.errno == errno.ENOENT: ++ return None ++ else: ++ raise ++ return content ++ ++# Used to match classes to dependencies ++datasources = [ ++ (DataSourceBigstep, (sources.DEP_FILESYSTEM, sources.DEP_NETWORK)), ++] ++ ++ ++# Return a list of data sources that match this set of dependencies ++def get_datasource_list(depends): ++ return sources.list_from_depends(depends, datasources) +--- a/cloudinit/distros/__init__.py ++++ b/cloudinit/distros/__init__.py +@@ -375,6 +375,10 @@ + if 'plain_text_passwd' in kwargs and kwargs['plain_text_passwd']: + self.set_passwd(name, kwargs['plain_text_passwd']) + ++ # Set password if hashed password is provided and non-empty ++ if 'hashed_passwd' in kwargs and kwargs['hashed_passwd']: ++ self.set_passwd(name, kwargs['hashed_passwd'], hashed=True) ++ + # Default locking down the account. 'lock_passwd' defaults to True. + # lock account unless lock_password is False. + if kwargs.get('lock_passwd', True): +--- a/cloudinit/settings.py ++++ b/cloudinit/settings.py +@@ -42,6 +42,7 @@ + 'CloudSigma', + 'CloudStack', + 'SmartOS', ++ 'Bigstep', + # At the end to act as a 'catch' when none of the above work... + 'None', + ], diff --git a/debian/patches/series b/debian/patches/series index 01704796..a7788446 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -21,3 +21,4 @@ lp-1506244-azure-ssh-key-values.patch lp-1506187-azure_use_unique_vm_id.patch lp-1540965-SmartOS-Add-support-for-Joyent-LX-Brand-Zones.patch lp-1551419-azure-handle-flipped-uuid-endianness.patch +lp-1553158-bigstep.patch |