return_methods = None
for _source_name, klass in self.get_plugins('source').items():
if _source_name == source_name:
- for _method_name in methods.keys():
+ for _method_name in methods:
if not hasattr(klass, _method_name):
msger.warning("Unimplemented %s source interface for: %s"\
% (_method_name, _source_name))
for num in range(len(self.partitions)):
part = self.partitions[num]
- if not self.disks.has_key(part['disk_name']):
+ if part['disk_name'] not in self.disks:
raise ImageError("No disk %s for partition %s" \
% (part['disk_name'], part['mountpoint']))
def __format_disks(self):
self.layout_partitions()
- for dev in self.disks.keys():
+ for dev in self.disks:
disk = self.disks[dev]
msger.debug("Initializing partition table for %s" % \
(disk['disk'].device))
os.rename(source, image_file + '.p%d' % part['num'])
def create(self):
- for dev in self.disks.keys():
+ for dev in self.disks:
disk = self.disks[dev]
disk['disk'].create()