← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~i.galic/cloud-init:fix/fbsd-resizefs into cloud-init:master


Igor Galić has proposed merging ~i.galic/cloud-init:fix/fbsd-resizefs into cloud-init:master.

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:

If the device name doesn't start with `/dev/` check there for its existence!
Your team cloud-init commiters is requested to review the proposed merge of ~i.galic/cloud-init:fix/fbsd-resizefs into cloud-init:master.
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
index 2edddd0..0e72626 100644
--- a/cloudinit/config/cc_resizefs.py
+++ b/cloudinit/config/cc_resizefs.py
@@ -197,6 +197,11 @@ def maybe_get_writable_device_path(devpath, info, log):
     if devpath.startswith('gpt/'):
         log.debug('We have a gpt label - just go ahead')
         return devpath
+    # Alternatively, our device could simply be a name as returned by gpart,
+    # such as da0p3
+    if not devpath.startswith('/dev/'):
+        log.debug("We'll try '%s' as our device", devpath)
+        devpath = "/dev/" + devpath
         statret = os.stat(devpath)

Follow ups