diff options
Diffstat (limited to 'cloudinit/sources')
-rw-r--r-- | cloudinit/sources/DataSourceAltCloud.py | 6 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceConfigDrive.py | 2 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceOpenStack.py | 12 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceSmartOS.py | 11 | ||||
-rw-r--r-- | cloudinit/sources/helpers/__init__.py | 1 | ||||
-rw-r--r-- | cloudinit/sources/helpers/openstack.py | 21 |
6 files changed, 34 insertions, 19 deletions
diff --git a/cloudinit/sources/DataSourceAltCloud.py b/cloudinit/sources/DataSourceAltCloud.py index a834f8eb..1e913a6e 100644 --- a/cloudinit/sources/DataSourceAltCloud.py +++ b/cloudinit/sources/DataSourceAltCloud.py @@ -115,6 +115,12 @@ class DataSourceAltCloud(sources.DataSource): ''' + uname_arch = os.uname()[4] + if uname_arch.startswith("arm") or uname_arch == "aarch64": + # Disabling because dmidecode in CMD_DMI_SYSTEM crashes kvm process + LOG.debug("Disabling AltCloud datasource on arm (LP: #1243287)") + return 'UNKNOWN' + cmd = CMD_DMI_SYSTEM try: (cmd_out, _err) = util.subp(cmd) diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py index 142e0eb8..0c35f83a 100644 --- a/cloudinit/sources/DataSourceConfigDrive.py +++ b/cloudinit/sources/DataSourceConfigDrive.py @@ -181,7 +181,7 @@ def get_previous_iid(paths): # hasn't declared itself found. fname = os.path.join(paths.get_cpath('data'), 'instance-id') try: - return util.load_file(fname) + return util.load_file(fname).rstrip("\n") except IOError: return None diff --git a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py index 72ec8075..0970d07b 100644 --- a/cloudinit/sources/DataSourceOpenStack.py +++ b/cloudinit/sources/DataSourceOpenStack.py @@ -88,11 +88,11 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource): md_urls = [] url2base = {} for url in urls: - md_url = url_helper.combine_url(url, 'openstack', - openstack.OS_LATEST, - 'meta_data.json') - md_urls.append(md_url) - url2base[md_url] = url + for version in openstack.OS_VERSIONS + (openstack.OS_LATEST,): + md_url = url_helper.combine_url(url, 'openstack', + version, 'meta_data.json') + md_urls.append(md_url) + url2base[md_url] = url (max_wait, timeout) = self._get_url_settings() start_time = time.time() @@ -120,7 +120,7 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource): read_metadata_service, args=[self.metadata_address], kwargs={'ssl_details': self.ssl_details, - 'version': openstack.OS_LATEST}) + 'version': openstack.OS_HAVANA}) except openstack.NonReadable: return False except (openstack.BrokenMetadata, IOError): diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py index 8d4a16e6..7c1eb09a 100644 --- a/cloudinit/sources/DataSourceSmartOS.py +++ b/cloudinit/sources/DataSourceSmartOS.py @@ -174,6 +174,12 @@ class DataSourceSmartOS(sources.DataSource): LOG.debug("Host does not appear to be on SmartOS") return False + uname_arch = os.uname()[4] + if uname_arch.startswith("arm") or uname_arch == "aarch64": + # Disabling because dmidcode in dmi_data() crashes kvm process + LOG.debug("Disabling SmartOS datasource on arm (LP: #1243287)") + return False + dmi_info = dmi_data() if dmi_info is False: LOG.debug("No dmidata utility found") @@ -203,7 +209,7 @@ class DataSourceSmartOS(sources.DataSource): # executed. It may be of any format that would be considered # executable in the guest instance. # - # We write 'user-script' and 'operator-script' into the + # We write 'user-script' and 'operator-script' into the # instance/data directory. The default vendor-data then handles # executing them later. data_d = os.path.join(self.paths.get_cpath(), 'instances', @@ -238,7 +244,8 @@ class DataSourceSmartOS(sources.DataSource): md['vendor-data'] = BUILTIN_VENDOR_DATA % { 'user_script': user_script, 'operator_script': operator_script, - 'per_boot_d': os.path.join(self.paths.get_cpath("scripts"), 'per-boot'), + 'per_boot_d': os.path.join(self.paths.get_cpath("scripts"), + 'per-boot'), } self.metadata = util.mergemanydict([md, self.metadata]) diff --git a/cloudinit/sources/helpers/__init__.py b/cloudinit/sources/helpers/__init__.py index 2cf99ec8..386225d5 100644 --- a/cloudinit/sources/helpers/__init__.py +++ b/cloudinit/sources/helpers/__init__.py @@ -11,4 +11,3 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. - diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py index a17148d3..0fac0335 100644 --- a/cloudinit/sources/helpers/openstack.py +++ b/cloudinit/sources/helpers/openstack.py @@ -44,12 +44,15 @@ KEY_COPIES = ( ('local-hostname', 'hostname', False), ('instance-id', 'uuid', True), ) +OS_LATEST = 'latest' +OS_FOLSOM = '2012-08-10' +OS_GRIZZLY = '2013-04-04' +OS_HAVANA = '2013-10-17' OS_VERSIONS = ( - '2012-08-10', # folsom - '2013-04-04', # grizzly - '2013-10-17', # havana + OS_FOLSOM, + OS_GRIZZLY, + OS_HAVANA, ) -OS_LATEST = 'latest' class NonReadable(IOError): @@ -176,12 +179,12 @@ class BaseReader(object): potential_version) if self._path_exists(path): if potential_version != version: - LOG.warn("Version '%s' not available, attempting to use" - " version '%s' instead", version, - potential_version) + LOG.debug("Version '%s' not available, attempting to use" + " version '%s' instead", version, + potential_version) return potential_version - LOG.warn("Version '%s' not available, attempting to use '%s'" - " instead", version, OS_LATEST) + LOG.debug("Version '%s' not available, attempting to use '%s'" + " instead", version, OS_LATEST) return OS_LATEST def read_v2(self, version=None): |