Skip to content

Commit

Permalink
improved exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverStiensmeier committed Nov 30, 2024
1 parent eb74156 commit 51d0208
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bibigrid/core/actions/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class Create: # pylint: disable=too-many-instance-attributes,too-many-arguments
The class Create holds necessary methods to execute the Create-Action
"""

def __init__(self, providers, configurations, config_path, log, debug=False,
# pylint: disable=too-many-positional-arguments
def __init__(self, *, providers, configurations, config_path, log, debug=False,
cluster_id=None):
"""
Additionally sets (unique) cluster_id, public_key_commands (to copy public keys to master) and key_name.
Expand Down Expand Up @@ -379,8 +378,11 @@ def prepare_vpn_or_master_args(self, configuration):
instance_type = configuration["vpnInstance"]
identifier = VPN_WORKER_IDENTIFIER
else:
self.log.warning("Configuration %s has no vpngtw or master and is therefore unreachable.", configuration)
raise KeyError
self.log.warning(
f"Configuration {configuration['cloud_identifier']} "
f"has no vpngtw or master and is therefore unreachable.")
raise ConfigurationException(
f"Configuration {configuration['cloud_identifier']} has neither vpngtw nor masterInstance")
return identifier, instance_type

def initialize_instances(self):
Expand Down

0 comments on commit 51d0208

Please sign in to comment.