diff options
author | Gonéri Le Bouder <goneri@lebouder.net> | 2019-05-28 15:39:48 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-05-28 15:39:48 +0000 |
commit | 6197c347c3960254dbcdb28eb73989d062ad9689 (patch) | |
tree | 047c3e31145795baddafa19ac36ec503add14523 /cloudinit/util.py | |
parent | 0f8695323262e41c699588c7cd140f6b58c62017 (diff) | |
download | vyos-cloud-init-6197c347c3960254dbcdb28eb73989d062ad9689.tar.gz vyos-cloud-init-6197c347c3960254dbcdb28eb73989d062ad9689.zip |
freebsd: ability to grow root file system
- UFS file system support
- GPT partition table support
- add support for newfs's -L parameter (label)
- move freebsd specific test from Azure to freebsd
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index ea4199cd..aa23b3f3 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -2337,17 +2337,21 @@ def parse_mtab(path): return None -def find_freebsd_part(label_part): - if label_part.startswith("/dev/label/"): - target_label = label_part[5:] - (label_part, _err) = subp(['glabel', 'status', '-s']) - for labels in label_part.split("\n"): +def find_freebsd_part(fs): + splitted = fs.split('/') + if len(splitted) == 3: + return splitted[2] + elif splitted[2] in ['label', 'gpt', 'ufs']: + target_label = fs[5:] + (part, _err) = subp(['glabel', 'status', '-s']) + for labels in part.split("\n"): items = labels.split() - if len(items) > 0 and items[0].startswith(target_label): - label_part = items[2] + if len(items) > 0 and items[0] == target_label: + part = items[2] break - label_part = str(label_part) - return label_part + return str(part) + else: + LOG.warning("Unexpected input in find_freebsd_part: %s", fs) def get_path_dev_freebsd(path, mnt_list): |