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 2021/05/18 14:17:02 UTC

[incubator-datalab] branch DATALAB-2125 created (now 72f67cd)

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

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


      at 72f67cd  [DATALAB-2125]: added retry for gcp vpc removal

This branch includes the following new commits:

     new 72f67cd  [DATALAB-2125]: added retry for gcp vpc removal

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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


[incubator-datalab] 01/01: [DATALAB-2125]: added retry for gcp vpc removal

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 72f67cdd6b90833fc3c3ac1cdcd141bcfde98bdf
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Tue May 18 17:16:39 2021 +0300

    [DATALAB-2125]: added retry for gcp vpc removal
---
 .../src/general/lib/gcp/actions_lib.py                        | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py b/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py
index d9b0648..77a9adb 100644
--- a/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/gcp/actions_lib.py
@@ -97,9 +97,16 @@ class GCPActions:
 
     def remove_vpc(self, vpc_name):
         request = self.service.networks().delete(project=self.project, network=vpc_name)
+        allow = False
+        count = 0
         try:
-            result = request.execute()
-            datalab.meta_lib.GCPMeta().wait_for_operation(result['name'])
+            while not allow and count < 5:
+                result = request.execute()
+                datalab.meta_lib.GCPMeta().wait_for_operation(result['name'])
+                if datalab.meta_lib.GCPMeta().get_vpc(vpc_name) == '':
+                    allow = True
+                else:
+                    count = count + 1
             print("VPC {} has been removed".format(vpc_name))
             return result
         except Exception as err:

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