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/11/17 10:08:41 UTC

[incubator-datalab] branch DATALAB-2595 created (now d1b8cca)

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

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


      at d1b8cca  [DATALAB-2595]: aws instance status is checked only if instance id is present

This branch includes the following new commits:

     new d1b8cca  [DATALAB-2595]: aws instance status is checked only if instance id is present

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-2595]: aws instance status is checked only if instance id is present

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

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

commit d1b8ccad5230a9f870d7c4640b3c2f77b0a06d3b
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Nov 17 12:08:31 2021 +0200

    [DATALAB-2595]: aws instance status is checked only if instance id is present
---
 .../src/general/lib/aws/meta_lib.py                       | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/aws/meta_lib.py b/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
index 858c58d..063b215 100644
--- a/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
@@ -738,13 +738,14 @@ def get_list_instance_statuses(instance_ids):
     for h in instance_ids:
         host = {}
         try:
-            response = client.describe_instances(InstanceIds=[h.get('id')]).get('Reservations')
-            for i in response:
-                inst = i.get('Instances')
-                for j in inst:
-                    host['id'] = j.get('InstanceId')
-                    host['status'] = j.get('State').get('Name')
-                    data.append(host)
+            if 'id' in h:
+                response = client.describe_instances(InstanceIds=[h.get('id')]).get('Reservations')
+                for i in response:
+                    inst = i.get('Instances')
+                    for j in inst:
+                        host['id'] = j.get('InstanceId')
+                        host['status'] = j.get('State').get('Name')
+                        data.append(host)
         except Exception as err:
             host['id'] = i.get('id')
             host['status'] = 'terminated'

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