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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 5ef5fab86 [DATALAB-3076]: Fix for unsuccessful notebook creation
     new d1dda0596 Merge pull request #1748 from OleksandrRepnikov/DATALAB-3076
5ef5fab86 is described below

commit 5ef5fab867d02018c81f250360e9fc4d4dfc1aea
Author: orepnikov <[email protected]>
AuthorDate: Tue Sep 27 15:07:29 2022 +0300

    [DATALAB-3076]: Fix for unsuccessful notebook creation
---
 .../src/general/scripts/aws/common_prepare_notebook.py            | 8 +++++---
 .../src/general/scripts/azure/common_prepare_notebook.py          | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git 
a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
 
b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
index b16dfcd86..7f6eadafe 100644
--- 
a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
+++ 
b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
@@ -72,9 +72,11 @@ if __name__ == "__main__":
             notebook_config['exploratory_name'] = 
os.environ['exploratory_name'].lower()
         except:
             notebook_config['exploratory_name'] = ''
-        notebook_config['custom_tag'] = 
json.loads(os.environ['tags'].replace("'", '"'))['custom_tag']
-        if notebook_config['custom_tag']:
-            notebook_config['custom_tag'] = 
';custom_tag:{}'.format(notebook_config['custom_tag'])
+        notebook_config['custom_tag'] = ''
+        if 'custom_tag' in os.environ['tags']:
+            notebook_config['custom_tag'] = 
json.loads(os.environ['tags'].replace("'", '"'))['custom_tag']
+            if notebook_config['custom_tag']:
+                notebook_config['custom_tag'] = 
';custom_tag:{}'.format(notebook_config['custom_tag'])
         notebook_config['instance_type'] = 
os.environ['aws_notebook_instance_type']
         notebook_config['key_name'] = os.environ['conf_key_name']
         notebook_config['instance_name'] = 
'{}-{}-{}-nb-{}-{}'.format(notebook_config['service_base_name'],
diff --git 
a/infrastructure-provisioning/src/general/scripts/azure/common_prepare_notebook.py
 
b/infrastructure-provisioning/src/general/scripts/azure/common_prepare_notebook.py
index 122be0e39..206c291e5 100644
--- 
a/infrastructure-provisioning/src/general/scripts/azure/common_prepare_notebook.py
+++ 
b/infrastructure-provisioning/src/general/scripts/azure/common_prepare_notebook.py
@@ -68,9 +68,11 @@ if __name__ == "__main__":
                                    "endpoint_tag": 
notebook_config['endpoint_tag'],
                                    "Exploratory": 
notebook_config['exploratory_name'],
                                    "product": "datalab"}
-        notebook_config['custom_tag'] = 
json.loads(os.environ['tags'].replace("'", '"'))['custom_tag']
-        if notebook_config['custom_tag']:
-            notebook_config['tags']['custom_tag'] = 
notebook_config['custom_tag']
+        notebook_config['custom_tag'] = ''
+        if 'custom_tag' in os.environ['tags']:
+            notebook_config['custom_tag'] = 
json.loads(os.environ['tags'].replace("'", '"'))['custom_tag']
+            if notebook_config['custom_tag']:
+                notebook_config['tags']['custom_tag'] = 
notebook_config['custom_tag']
         notebook_config['network_interface_name'] = 
notebook_config['instance_name'] + "-nif"
         notebook_config['security_group_name'] = 
'{}-{}-{}-nb-sg'.format(notebook_config['service_base_name'],
                                                                          
notebook_config['project_name'],


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to