summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceOpenNebula.py
diff options
context:
space:
mode:
authorVlastimil Holer <vlastimil.holer@gmail.com>2013-09-04 16:36:00 +0200
committerVlastimil Holer <vlastimil.holer@gmail.com>2013-09-04 16:36:00 +0200
commit8a2a88e0bb4520eabe99b6686413a548f3d59652 (patch)
tree7c4157f1f255a05ebb6e8826c4222dccd7f0e180 /cloudinit/sources/DataSourceOpenNebula.py
parent1adc68b643b2f73a2a08ca7d19c3fc8e759f06c2 (diff)
downloadvyos-cloud-init-8a2a88e0bb4520eabe99b6686413a548f3d59652.tar.gz
vyos-cloud-init-8a2a88e0bb4520eabe99b6686413a548f3d59652.zip
Search for contextualization CDROM by LABEL=CONTEXT
Diffstat (limited to 'cloudinit/sources/DataSourceOpenNebula.py')
-rw-r--r--cloudinit/sources/DataSourceOpenNebula.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py
index 0ab23b25..fef7beac 100644
--- a/cloudinit/sources/DataSourceOpenNebula.py
+++ b/cloudinit/sources/DataSourceOpenNebula.py
@@ -239,15 +239,11 @@ def find_candidate_devs():
"""
Return a list of devices that may contain the context disk.
"""
- by_fstype = util.find_devs_with("TYPE=iso9660")
- by_fstype.sort()
-
- by_label = util.find_devs_with("LABEL=CDROM")
- by_label.sort()
-
- # combine list of items by putting by-label items first
- # followed by fstype items, but with dupes removed
- combined = (by_label + [d for d in by_fstype if d not in by_label])
+ combined = []
+ for f in ('LABEL=CONTEXT', 'LABEL=CDROM', 'TYPE=iso9660'):
+ for d in util.find_devs_with(f).sort():
+ if d not in combined:
+ combined.append(d)
return combined