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

parent 899c423e
...@@ -418,8 +418,8 @@ class Computer(object): ...@@ -418,8 +418,8 @@ class Computer(object):
if alter_network: if alter_network:
self._speedHackAddAllOldIpsToInterface() 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 # Reconstructing User's
partition.path = os.path.join(self.instance_root, partition.reference) partition.path = os.path.join(self.instance_root, partition.reference)
partition.user.setPath(partition.path) partition.user.setPath(partition.path)
...@@ -479,12 +479,15 @@ class Computer(object): ...@@ -479,12 +479,15 @@ class Computer(object):
address['addr'])) address['addr']))
else: else:
raise ValueError('Address %r is incorrect' % address['addr']) raise ValueError('Address %r is incorrect' % address['addr'])
finally: except:
if alter_network and create_tap and self.interface.attach_to_tap: self.logger.error('Error while processing partition %s:\n%s' % (
try: partition.user.name, traceback.format_exc()))
self.partition_list[0].tap.detach()
except IndexError: if alter_network and create_tap and self.interface.attach_to_tap:
pass try:
self.partition_list[0].tap.detach()
except IndexError:
pass
class Partition(object): 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