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

dmysakovets pushed a commit to branch odahu-integration
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/odahu-integration by this push:
     new c908b19  [odahu-integration] Created Odahu template
c908b19 is described below

commit c908b192221b8b3c4c8bf6de06347a4950ecddc9
Author: Demyan Mysakovets <demian.mysakove...@gmail.com>
AuthorDate: Tue Dec 17 10:51:49 2019 +0200

    [odahu-integration] Created Odahu template
---
 .../src/general/scripts/gcp/odahu_terminate.py          | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git 
a/infrastructure-provisioning/src/general/scripts/gcp/odahu_terminate.py 
b/infrastructure-provisioning/src/general/scripts/gcp/odahu_terminate.py
index 9cc4a5f..8bc4669 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/odahu_terminate.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/odahu_terminate.py
@@ -38,6 +38,12 @@ if __name__ == "__main__":
                         level=logging.DEBUG,
                         filename=local_log_filepath)
 
+    print('Generating infrastructure names and tags')
+    odahu_conf = dict()
+    odahu_conf['odahu_cluster_name'] = 
(os.environ['odahu_cluster_name']).lower().replace('_', '-')
+    odahu_conf['region'] = (os.environ['gcp_region'])
+
+
     print('Removing Odahu cluster')
     try:
         local('tf_runner destroy')
@@ -47,10 +53,19 @@ if __name__ == "__main__":
         sys.exit(1)
 
     try:
-        buckets = GCPMeta().get_list_buckets(args.service_base_name)
+        buckets = GCPMeta().get_list_buckets(odahu_conf['odahu_cluster_name'])
         if 'items' in buckets:
             for i in buckets['items']:
                 GCPActions().remove_bucket(i['name'])
     except Exception as err:
         print('Error: {0}'.format(err))
         sys.exit(1)
+
+    try:
+        static_addresses = 
GCPMeta().get_list_static_addresses(odahu_conf['region'], 
odahu_conf['odahu_cluster_name'])
+        if 'items' in static_addresses:
+            for i in static_addresses['items']:
+                GCPActions().remove_static_address(i['name'], 
odahu_conf['region'])
+    except Exception as err:
+        print('Error: {0}'.format(err))
+        sys.exit(1)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org
For additional commands, e-mail: commits-h...@dlab.apache.org

Reply via email to