summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_resizefs.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-04-03 11:52:06 -0400
committerScott Moser <smoser@brickies.net>2017-04-03 11:52:06 -0400
commit3b2e493b51153cd5bc1fa91e6ac52f59d41fe3fb (patch)
tree678b118605245e5bb1b218565728270702aba5b4 /cloudinit/config/cc_resizefs.py
parente018fa910fdf0dbf3aa22e59e935461babd205c4 (diff)
parent61eb03fef92f435434d974fb46439189ef0b5f97 (diff)
downloadvyos-cloud-init-3b2e493b51153cd5bc1fa91e6ac52f59d41fe3fb.tar.gz
vyos-cloud-init-3b2e493b51153cd5bc1fa91e6ac52f59d41fe3fb.zip
merge from master at 0.7.9-90-g61eb03fe
Diffstat (limited to 'cloudinit/config/cc_resizefs.py')
-rw-r--r--cloudinit/config/cc_resizefs.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
index e028abf4..60e3ab53 100644
--- a/cloudinit/config/cc_resizefs.py
+++ b/cloudinit/config/cc_resizefs.py
@@ -71,25 +71,6 @@ RESIZE_FS_PREFIXES_CMDS = [
NOBLOCK = "noblock"
-def rootdev_from_cmdline(cmdline):
- found = None
- for tok in cmdline.split():
- if tok.startswith("root="):
- found = tok[5:]
- break
- if found is None:
- return None
-
- if found.startswith("/dev/"):
- return found
- if found.startswith("LABEL="):
- return "/dev/disk/by-label/" + found[len("LABEL="):]
- if found.startswith("UUID="):
- return "/dev/disk/by-uuid/" + found[len("UUID="):]
-
- return "/dev/" + found
-
-
def handle(name, cfg, _cloud, log, args):
if len(args) != 0:
resize_root = args[0]
@@ -121,7 +102,7 @@ def handle(name, cfg, _cloud, log, args):
# Ensure the path is a block device.
if (devpth == "/dev/root" and not os.path.exists(devpth) and
not container):
- devpth = rootdev_from_cmdline(util.get_cmdline())
+ devpth = util.rootdev_from_cmdline(util.get_cmdline())
if devpth is None:
log.warn("Unable to find device '/dev/root'")
return