Skip to content

Commit

Permalink
sanity check for misconfigured gateways (#2265)
Browse files Browse the repository at this point in the history
  • Loading branch information
waleedhammam committed Jan 17, 2021
1 parent 3aa033a commit 80d7f2a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jumpscale/sals/marketplace/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ def _get_gateways_pools(self, farm_name, identity_name=None):
farms_ids_with_gateways = [
gateway_farm.farm_id for gateway_farm in deployer._explorer.gateway.list() if gateway_farm.farm_id > 0
]
# verify gateway farms is already there
for farm_id in farms_ids_with_gateways.copy():
try:
deployer._explorer.farms.get(farm_id)
except:
j.logger.warning(f"farm {farm_id} doesn't exist anymore, skipping that gateway")
farms_ids_with_gateways.remove(farm_id)

farms_names_with_gateways = set(
map(lambda farm_id: deployer._explorer.farms.get(farm_id=farm_id).name, farms_ids_with_gateways)
)
Expand Down

0 comments on commit 80d7f2a

Please sign in to comment.