Skip to content

Commit

Permalink
added logging of traceroute even if debug flag is not set when error …
Browse files Browse the repository at this point in the history
…is not known. Added a few other logs
  • Loading branch information
XaverStiensmeier committed Aug 14, 2024
1 parent 44cb580 commit 90fbb7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bibigrid/core/actions/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def start_vpn_or_master(self, configuration, provider):
name = identifier(cluster_id=self.cluster_id, # pylint: disable=redundant-keyword-arg
additional=self.vpn_counter) # pylint: disable=redundant-keyword-arg
self.vpn_counter += 1
self.log.info(f"Starting instance/server {name} on {provider.cloud_specification['identifier']}")
self.log.info(f"Starting server {name} on {provider.cloud_specification['identifier']}")
flavor = instance_type["type"]
network = configuration["network"]
image = image_selection.select_image(provider, instance_type["image"], self.log,
Expand Down Expand Up @@ -223,10 +223,11 @@ def start_vpn_or_master(self, configuration, provider):
mount = next((mount for mount in configuration["masterMounts"] if mount["name"] == volume["name"]), None)
if mount.get("mountPoint"):
volume["mount_point"] = mount["mountPoint"]
self.log.debug(f"Added mount point {mount['mountPoint']} as a mount point in configuration.")

def start_workers(self, worker, worker_count, configuration, provider):
name = WORKER_IDENTIFIER(cluster_id=self.cluster_id, additional=worker_count)
self.log.info(f"Starting worker {name} on {provider.cloud_specification['identifier']}.")
self.log.info(f"Starting server {name} on {provider.cloud_specification['identifier']}.")
flavor = worker["type"]
network = configuration["network"]
image = image_selection.select_image(provider, worker["image"], self.log,
Expand All @@ -245,6 +246,7 @@ def start_workers(self, worker, worker_count, configuration, provider):
hosts = {"host_entries": {}}
hosts["host_entries"][name] = server["private_v4"]
ansible_configurator.write_yaml(a_rp.HOSTS_FILE, hosts, self.log)
self.log.debug(f"Added worker {name} to hosts file {a_rp.HOSTS_FILE}.")

def prepare_vpn_or_master_args(self, configuration, provider):
"""
Expand Down Expand Up @@ -481,8 +483,7 @@ def create(self): # pylint: disable=too-many-branches,too-many-statements
self.log.error(traceback.format_exc())
self.log.error(f"Configuration invalid: {str(exc)}")
except Exception as exc: # pylint: disable=broad-except
if self.debug:
self.log.error(traceback.format_exc())
self.log.error(traceback.format_exc())
self.log.error(f"Unexpected error: '{str(exc)}' ({type(exc)}) Contact a developer!)")
else:
return 0 # will be called if no exception occurred
Expand Down

0 comments on commit 90fbb7c

Please sign in to comment.