You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2020/10/26 14:07:17 UTC

[incubator-datalab] 01/01: [DATALAB-2120]: added check if nar route exists before its removal

This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DATALAB-2120
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit fa95a42104f1c91cdf9e6ffb3223a07ec556d3f8
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Mon Oct 26 15:52:55 2020 +0200

    [DATALAB-2120]: added check if nar route exists before its removal
---
 .../src/general/scripts/gcp/project_terminate.py                      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py b/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py
index a2b6416..4b8581b 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py
@@ -142,7 +142,9 @@ def terminate_edge_node(endpoint_name, project_name, service_base_name, region,
     print("Removing nat route")
     try:
         nat_route_name = '{0}-{1}-{2}-nat-route'.format(service_base_name, project_name, endpoint_name)
-        GCPActions.delete_nat_route(nat_route_name)
+        route = GCPMeta.get_route(nat_route_name)
+        if route:
+            GCPActions.delete_nat_route(nat_route_name)
     except Exception as err:
         datalab.fab.append_result("Failed to remove nat route", str(err))
         sys.exit(1)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org