You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by lf...@apache.org on 2020/03/05 10:20:20 UTC

[incubator-dlab] 01/02: [DLAB-1539]: changed if statement for custom tag

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

lfrolov pushed a commit to branch DLAB-1539
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 1a0355b049dfc244e1288ea5fee9f12fc36694ca
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Mar 5 10:50:46 2020 +0200

    [DLAB-1539]: changed if statement for custom tag
---
 .../scripts/gcp/common_notebook_configure_dataengine-service.py    | 5 +++--
 .../src/general/scripts/gcp/common_prepare_notebook.py             | 5 +++--
 .../src/general/scripts/gcp/dataengine-service_prepare.py          | 5 +++--
 .../src/general/scripts/gcp/dataengine_prepare.py                  | 7 ++++---
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py b/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py
index 14edcdf..41817fc 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py
@@ -81,8 +81,9 @@ if __name__ == "__main__":
         "product": "dlab",
         "computational_name": (os.environ['computational_name']).lower().replace('_', '-')
     }
-    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
-        notebook_config['cluster_labels'].update({'custom_tag': additional_tags['custom_tag']})
+    if additional_tags['custom_tag']:
+        if additional_tags['custom_tag'] != '':
+            notebook_config['cluster_labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     try:
         logging.info('[INSTALLING KERNELS INTO SPECIFIED NOTEBOOK]')
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py b/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
index ea41d99..f1707a1 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
@@ -148,8 +148,9 @@ if __name__ == "__main__":
                                  "product": "dlab"
                                  }
 
-    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
-        notebook_config['labels'].update({'custom_tag': additional_tags['custom_tag']})
+    if additional_tags['custom_tag']:
+        if additional_tags['custom_tag'] != '':
+            notebook_config['labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     # launching instance for notebook server
     try:
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
index cbeb85c..d6a3e11 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
@@ -94,8 +94,9 @@ if __name__ == "__main__":
         "product": "dlab",
         "computational_name": dataproc_conf['computational_name']
     }
-    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
-        dataproc_conf['cluster_labels'].update({'custom_tag': additional_tags['custom_tag']})
+    if additional_tags['custom_tag']:
+        if additional_tags['custom_tag'] != '':
+            dataproc_conf['cluster_labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     dataproc_conf['dataproc_service_account_name'] = '{0}-{1}-ps'.format(dataproc_conf['service_base_name'],
                                                                          dataproc_conf['project_name'])
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py b/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py
index a546592..8febaed 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py
@@ -166,9 +166,10 @@ if __name__ == "__main__":
                                     "type": "master",
                                     "notebook_name": data_engine['notebook_name'],
                                     "product": "dlab"}
-    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
-        data_engine['slave_labels'].update({'custom_tag': additional_tags['custom_tag']})
-        data_engine['master_labels'].update({'custom_tag': additional_tags['custom_tag']})
+    if additional_tags['custom_tag']:
+        if additional_tags['custom_tag'] != '':
+            data_engine['slave_labels'].update({'custom_tag': additional_tags['custom_tag']})
+            data_engine['master_labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     try:
         logging.info('[CREATE MASTER NODE]')


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