Skip to content

Commit

Permalink
Merge pull request #154 from sskaur/create-listener-wrong-gateway-name
Browse files Browse the repository at this point in the history
fix(grpc): throw error on wrong gateway listener
  • Loading branch information
sskaur authored Sep 6, 2023
2 parents 9e61b0e + f5fd4ac commit 639a2f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ def create_listener(self, request, context=None):
adrfam=request.adrfam,
)
self.logger.info(f"create_listener: {ret}")
else:
raise Exception(f"Gateway name must match current gateway"
f" ({self.gateway_name})")
except Exception as ex:
self.logger.error(f"create_listener failed with: \n {ex}")
if context:
Expand Down Expand Up @@ -432,6 +435,9 @@ def delete_listener(self, request, context=None):
adrfam=request.adrfam,
)
self.logger.info(f"delete_listener: {ret}")
else:
raise Exception(f"Gateway name must match current gateway"
f" ({self.gateway_name})")
except Exception as ex:
self.logger.error(f"delete_listener failed with: \n {ex}")
if context:
Expand Down

0 comments on commit 639a2f6

Please sign in to comment.