Skip to content

Commit

Permalink
improved log message when uuid cant be extracted
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed May 2, 2024
1 parent e2a7d19 commit df7f7b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,14 @@ def clean_sliver_inconsistencies(self):
# Extract UUID if found
if match:
sliver_id = match.group(1)
print("Sliver Id:", sliver_id)
if sliver_id not in cf_active_sliver_ids:
result_2 = self.execute_ansible(inventory_path=inventory_location,
playbook_path=vm_playbook_path,
extra_vars={"operation": "delete", "vmname": vm_name},
ansible_python_interpreter=ansible_python_interpreter)
self.logger.info(f"Deleted instance: {vm_name}; result: {result_2.get_json_result_ok()}")
else:
print("Sliver Id not found in the input string.")
self.logger.error(f"Sliver Id not found in the input string: {vm_name}")
except Exception as e:
self.logger.error(f"Failed to cleanup CF and openstack inconsistencies instance: {instance} vm: {vm_name}: {e}")
self.logger.error(traceback.format_exc())
Expand Down

0 comments on commit df7f7b2

Please sign in to comment.