From 8a2a88e0bb4520eabe99b6686413a548f3d59652 Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Wed, 4 Sep 2013 16:36:00 +0200 Subject: Search for contextualization CDROM by LABEL=CONTEXT --- cloudinit/sources/DataSourceOpenNebula.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'cloudinit') 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 -- cgit v1.2.3