diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-10-04 17:43:26 -0700 |
|---|---|---|
| committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-10-04 17:43:26 -0700 |
| commit | 82314d806e8c7fd876bce2765ad3bb5ba235d09b (patch) | |
| tree | 3ea839cb1167d442d34a1b38275a65fcd660c8e3 | |
| parent | d65ed7106072b9a882592de69ebfe36ba69d6fbc (diff) | |
| parent | ab1b27294ce852a5d67b230971a1c28c99940e50 (diff) | |
| download | vyos-cloud-init-82314d806e8c7fd876bce2765ad3bb5ba235d09b.tar.gz vyos-cloud-init-82314d806e8c7fd876bce2765ad3bb5ba235d09b.zip | |
For now pull this in.
| -rw-r--r-- | cloudinit/sources/DataSourceConfigDrive.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py index b8154367..b1cf942e 100644 --- a/cloudinit/sources/DataSourceConfigDrive.py +++ b/cloudinit/sources/DataSourceConfigDrive.py @@ -85,6 +85,16 @@ class DataSourceConfigDrive(sources.DataSource): md = results['metadata'] md = util.mergedict(md, DEFAULT_METADATA) + # Perform some metadata 'fixups' + # + # OpenStack uses the 'hostname' key + # while most of cloud-init uses the metadata + # 'local-hostname' key instead so if it doesn't + # exist we need to make sure its copied over. + for (tgt, src) in [('local-hostname', 'hostname')]: + if tgt not in md and src in md: + md[tgt] = md[src] + user_dsmode = results.get('dsmode', None) if user_dsmode not in VALID_DSMODES + (None,): LOG.warn("user specified invalid mode: %s" % user_dsmode) |
