summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index ab918433..c0ea8d91 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1553,3 +1553,10 @@ def keyval_str_to_dict(kvstring):
val = True
ret[key] = val
return ret
+
+
+def is_partition(device):
+ if device.startswith("/dev/"):
+ device = device[5:]
+
+ return os.path.isfile("/sys/class/block/%s/partition" % device)