Skip to content

Commit

Permalink
small log change and fix of schema key vpnInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverStiensmeier committed May 13, 2024
1 parent ea2d47f commit 03771a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions bibigrid/core/utility/validate_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ def validate(self):
@return:
"""
success = bool(self.providers)
self.log.info("Validating config file...")

success = validate_schema.validate_configurations(self.configurations, self.log) and success

checks = [("master/vpn", self.check_master_vpn_worker), ("servergroup", self.check_server_group),
Expand Down
6 changes: 4 additions & 2 deletions bibigrid/core/utility/validate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@
{'infrastructure': str, 'cloud': str, 'sshUser': str, Or('subnet', 'network'): str, 'cloud_identifier': str,
Optional('waitForServices'): [str], Optional('features'): [str], 'workerInstances': [
{'type': str, 'image': str, Optional('count'): int, Optional('onDemand'): bool, Optional('partitions'): [str],
Optional('features'): [str]}], 'vpngtw': {'type': str, 'image': str}})
Optional('features'): [str]}], 'vpnInstance': {'type': str, 'image': str}})


def validate_configurations(configurations, log):
log.info("Validating config file...")
configuration = None
try:
configuration = configurations[0]
if configuration.get("region") or configuration.get("availabilityZone"):
log.warning(
"Keys region and availabilityZone are deprecated! Check will return False if you use one of them."
"Keys 'region' and 'availabilityZone' are deprecated! Check will return False if you use one of them."
"Just remove them. They are no longer required.")
master_schema.validate(configuration)
log.debug(f"Master configuration '{configuration['cloud_identifier']}' valid.")
Expand All @@ -50,6 +51,7 @@ def validate_configurations(configurations, log):
"Just remove them. They are no longer required.")
other_schema.validate(configuration)
log.debug(f"Configuration '{configuration['cloud_identifier']}' valid.")
log.debug("Entire configuration valid.")
return True
except SchemaError as err:
log.warning(
Expand Down

0 comments on commit 03771a1

Please sign in to comment.