Don't stop reporting/Destroying, even if something bad happens to an instance.

Do it as well for the reporting loop.
parent b03b0192
...@@ -876,6 +876,7 @@ class Slapgrid(object): ...@@ -876,6 +876,7 @@ class Slapgrid(object):
#Now we loop through the different computer partitions to report #Now we loop through the different computer partitions to report
report_usage_issue_cp_list = [] report_usage_issue_cp_list = []
for computer_partition in computer_partition_list: for computer_partition in computer_partition_list:
try:
filename_delete_list = [] filename_delete_list = []
computer_partition_id = computer_partition.getId() computer_partition_id = computer_partition.getId()
instance_path = os.path.join(self.instance_root, computer_partition_id) instance_path = os.path.join(self.instance_root, computer_partition_id)
...@@ -917,6 +918,14 @@ class Slapgrid(object): ...@@ -917,6 +918,14 @@ class Slapgrid(object):
for filename in filename_delete_list: for filename in filename_delete_list:
os.remove(os.path.join(dir_reports, filename)) os.remove(os.path.join(dir_reports, filename))
# Whatever happens, don't stop processing other instances
except Exception:
computer_partition_id = computer_partition.getId()
exception = traceback.format_exc()
issue = "Cannot run usage script(s) for %r: %s" % (
computer_partition_id, exception)
logger.info(issue)
for computer_partition_usage in computer_partition_usage_list: for computer_partition_usage in computer_partition_usage_list:
logger.info('computer_partition_usage_list : %s - %s' % \ logger.info('computer_partition_usage_list : %s - %s' % \
(computer_partition_usage.usage, computer_partition_usage.getId())) (computer_partition_usage.usage, computer_partition_usage.getId()))
......
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