summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceConfigDrive.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-09-30 13:26:03 -0400
committerScott Moser <smoser@ubuntu.com>2014-09-30 13:26:03 -0400
commita429725ede3395a7e9c21b864a82e2c092657ae2 (patch)
tree3f3ae31e40ddd7f94c662c2d3f5f2108af5cda97 /cloudinit/sources/DataSourceConfigDrive.py
parentb76866ad72d433cc9008a137c464c7ed44401549 (diff)
parent87080e18f8fb2522a01ccbe58c60b5e06bfdd5d7 (diff)
downloadvyos-cloud-init-a429725ede3395a7e9c21b864a82e2c092657ae2.tar.gz
vyos-cloud-init-a429725ede3395a7e9c21b864a82e2c092657ae2.zip
FreeBSD: Support ConfigDrive
Add support for freebsd reading config drive. Primary work is related to re-factoring mount_cb to not be so linux specific. Other changes: * declare PATH in freebsd initscripts * list dependency on e2fsprogs (for blkid) * enable ConfigDrive in freebsd config * hosts.freebsd.tmpl added
Diffstat (limited to 'cloudinit/sources/DataSourceConfigDrive.py')
-rw-r--r--cloudinit/sources/DataSourceConfigDrive.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py
index 4e5d90de..27658073 100644
--- a/cloudinit/sources/DataSourceConfigDrive.py
+++ b/cloudinit/sources/DataSourceConfigDrive.py
@@ -37,7 +37,9 @@ DEFAULT_METADATA = {
VALID_DSMODES = ("local", "net", "pass", "disabled")
FS_TYPES = ('vfat', 'iso9660')
LABEL_TYPES = ('config-2',)
-OPTICAL_DEVICES = tuple(('/dev/sr%s' % i for i in range(0, 2)))
+POSSIBLE_MOUNTS = ('sr', 'cd')
+OPTICAL_DEVICES = tuple(('/dev/%s%s' % (z, i) for z in POSSIBLE_MOUNTS
+ for i in range(0, 2)))
class DataSourceConfigDrive(openstack.SourceMixin, sources.DataSource):
@@ -70,7 +72,15 @@ class DataSourceConfigDrive(openstack.SourceMixin, sources.DataSource):
if not found:
for dev in find_candidate_devs():
try:
- results = util.mount_cb(dev, read_config_drive)
+ # Set mtype if freebsd and turn off sync
+ if dev.startswith("/dev/cd"):
+ mtype = "cd9660"
+ sync = False
+ else:
+ mtype = None
+ sync = True
+ results = util.mount_cb(dev, read_config_drive, mtype=mtype,
+ sync=sync)
found = dev
except openstack.NonReadable:
pass