diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-07-21 13:06:11 +0100 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-07-21 13:06:11 +0100 |
commit | edc46ee7192376af65640a81c39335ebdfd196b6 (patch) | |
tree | ceeeff30704dbc3f07f0b2a072e22a3825e0c33f /cloudinit/config/cc_disk_setup.py | |
parent | 55487d9eb52343bd72271b072734740b52b25c1d (diff) | |
download | vyos-cloud-init-edc46ee7192376af65640a81c39335ebdfd196b6.tar.gz vyos-cloud-init-edc46ee7192376af65640a81c39335ebdfd196b6.zip |
Extend disk_setup and mounts to handle /dev/disk symlinks.
Diffstat (limited to 'cloudinit/config/cc_disk_setup.py')
-rw-r--r-- | cloudinit/config/cc_disk_setup.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py index e2ce6db4..92fa7a94 100644 --- a/cloudinit/config/cc_disk_setup.py +++ b/cloudinit/config/cc_disk_setup.py @@ -648,6 +648,8 @@ def mkpart(device, definition): table_type: Which partition table to use, defaults to MBR device: the device to work on. """ + LOG.debug('Ensuring that we have a real device, not a symbolic link') + device = os.path.realpath(device) LOG.debug("Checking values for %s definition" % device) overwrite = definition.get('overwrite', False) @@ -745,6 +747,9 @@ def mkfs(fs_cfg): fs_replace = fs_cfg.get('replace_fs', False) overwrite = fs_cfg.get('overwrite', False) + LOG.debug('Ensuring that we have a real device, not a symbolic link') + device = os.path.realpath(device) + # This allows you to define the default ephemeral or swap LOG.debug("Checking %s against default devices", device) |