Format: don't prevent to process all partitions if one of them failed.

parent 899c423e
......@@ -418,8 +418,8 @@ class Computer(object):
if alter_network:
self._speedHackAddAllOldIpsToInterface()
try:
for partition_index, partition in enumerate(self.partition_list):
for partition_index, partition in enumerate(self.partition_list):
try:
# Reconstructing User's
partition.path = os.path.join(self.instance_root, partition.reference)
partition.user.setPath(partition.path)
......@@ -479,12 +479,15 @@ class Computer(object):
address['addr']))
else:
raise ValueError('Address %r is incorrect' % address['addr'])
finally:
if alter_network and create_tap and self.interface.attach_to_tap:
try:
self.partition_list[0].tap.detach()
except IndexError:
pass
except:
self.logger.error('Error while processing partition %s:\n%s' % (
partition.user.name, traceback.format_exc()))
if alter_network and create_tap and self.interface.attach_to_tap:
try:
self.partition_list[0].tap.detach()
except IndexError:
pass
class Partition(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment