diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-03-27 15:19:51 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-03-27 15:19:51 -0400 |
commit | bf52085a1fa3529329a5c48097a12a6e9b93eb22 (patch) | |
tree | 72f1b5d67af99b9507efa12f2304ff2cd3a1c69d | |
parent | 24fdc71db366dc4ea9a0d164bb6af7d38609478a (diff) | |
download | vyos-cloud-init-bf52085a1fa3529329a5c48097a12a6e9b93eb22.tar.gz vyos-cloud-init-bf52085a1fa3529329a5c48097a12a6e9b93eb22.zip |
NoCloud: the local portion of NoCloud incorrectly claimed datasources
The intent has always been for the local datasource (NoCloud) to require
the provider of metadata to provide 'dsmode=local'. If that wasn't found,
then the default 'dsmode' would be 'net', and the NoCloudNet datasource
would then find the data.
The bug here was that the default 'net' wasn't being set when
data was found on a local source.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceNoCloud.py | 5 |
2 files changed, 4 insertions, 2 deletions
@@ -28,6 +28,7 @@ (LP: #1422388) - readurl, read_file_or_url returns bytes, user must convert as necessary - SmartOS: use v2 metadata service (LP: #1436417) [Daniel Watkins] + - NoCloud: fix local datasource claiming found without explicit dsmode 0.7.6: - open 0.7.6 - Enable vendordata on CloudSigma datasource (LP: #1303986) diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py index c26a645c..6a861af3 100644 --- a/cloudinit/sources/DataSourceNoCloud.py +++ b/cloudinit/sources/DataSourceNoCloud.py @@ -124,7 +124,7 @@ class DataSourceNoCloud(sources.DataSource): # that is more likely to be what is desired. If they want # dsmode of local, then they must specify that. if 'dsmode' not in mydata['meta-data']: - mydata['dsmode'] = "net" + mydata['meta-data']['dsmode'] = "net" LOG.debug("Using data from %s", dev) found.append(dev) @@ -193,7 +193,8 @@ class DataSourceNoCloud(sources.DataSource): self.vendordata = mydata['vendor-data'] return True - LOG.debug("%s: not claiming datasource, dsmode=%s", self, md['dsmode']) + LOG.debug("%s: not claiming datasource, dsmode=%s", self, + mydata['meta-data']['dsmode']) return False |