summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceConfigDrive.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-03-16 11:20:02 -0400
committerScott Moser <smoser@brickies.net>2017-03-24 15:30:28 -0400
commit443095f4d4b6feba30c7011b7ab48adb2a40fcf5 (patch)
treeac22adfa49afc7acc3620361089421dceaf0cb60 /cloudinit/sources/DataSourceConfigDrive.py
parent20a628c122583e159782c88547128fec1983376c (diff)
downloadvyos-cloud-init-443095f4d4b6feba30c7011b7ab48adb2a40fcf5.tar.gz
vyos-cloud-init-443095f4d4b6feba30c7011b7ab48adb2a40fcf5.zip
ConfigDrive: support reading config drive data from /config-drive.
This is thie cloud-init part of a fix to allow nova-lxd to provide config drive data. The other part will be done in nova-lxd. The agreement here is that nova-lxd will copy the contents of the config drive to /config-drive in the container. LP: #1673411
Diffstat (limited to 'cloudinit/sources/DataSourceConfigDrive.py')
-rw-r--r--cloudinit/sources/DataSourceConfigDrive.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py
index 8a448dc9..46dd89e0 100644
--- a/cloudinit/sources/DataSourceConfigDrive.py
+++ b/cloudinit/sources/DataSourceConfigDrive.py
@@ -54,13 +54,16 @@ class DataSourceConfigDrive(openstack.SourceMixin, sources.DataSource):
found = None
md = {}
results = {}
- if os.path.isdir(self.seed_dir):
+ for sdir in (self.seed_dir, "/config-drive"):
+ if not os.path.isdir(sdir):
+ continue
try:
- results = read_config_drive(self.seed_dir)
- found = self.seed_dir
+ results = read_config_drive(sdir)
+ found = sdir
+ break
except openstack.NonReadable:
- util.logexc(LOG, "Failed reading config drive from %s",
- self.seed_dir)
+ util.logexc(LOG, "Failed reading config drive from %s", sdir)
+
if not found:
for dev in find_candidate_devs():
try: