summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_resizefs.py
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-09-14 14:05:13 -0600
committerScott Moser <smoser@brickies.net>2017-09-15 14:42:35 -0400
commit024ecc1f758d36cc0aa5ebce65704eed6bd66d45 (patch)
tree870a26d70e4f4655a6e4512d73166ef1a49a89ef /cloudinit/config/cc_resizefs.py
parenta2f8ce9c80debdb788e7ab37401aa98c2c270f26 (diff)
downloadvyos-cloud-init-024ecc1f758d36cc0aa5ebce65704eed6bd66d45.tar.gz
vyos-cloud-init-024ecc1f758d36cc0aa5ebce65704eed6bd66d45.zip
resizefs: Drop check for read-only device file, do not warn on overlayroot.
As root user, os.access(<path>, os.W_OK) will always return True so that path will never get executed. Also avoid a warning if the root is overlayroot, which is the common case on a MAAS booted 'ephemeral' system.
Diffstat (limited to 'cloudinit/config/cc_resizefs.py')
-rw-r--r--cloudinit/config/cc_resizefs.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
index f42b6a63..f774baa3 100644
--- a/cloudinit/config/cc_resizefs.py
+++ b/cloudinit/config/cc_resizefs.py
@@ -192,6 +192,10 @@ def is_device_path_writable_block(devpath, info, log):
return False
log.debug("Converted /dev/root to '%s' per kernel cmdline", devpath)
+ if devpath == 'overlayroot':
+ log.debug("Not attempting to resize devpath '%s': %s", devpath, info)
+ return False
+
try:
statret = os.stat(devpath)
except OSError as exc:
@@ -205,14 +209,6 @@ def is_device_path_writable_block(devpath, info, log):
raise exc
return False
- if not os.access(devpath, os.W_OK):
- if container:
- log.debug("'%s' not writable in container. cannot resize: %s",
- devpath, info)
- else:
- log.warn("'%s' not writable. cannot resize: %s", devpath, info)
- return
-
if not stat.S_ISBLK(statret.st_mode) and not stat.S_ISCHR(statret.st_mode):
if container:
log.debug("device '%s' not a block device in container."