libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [libcloud] kartiksubbarao commented on issue #1346: GCE ex_list_instancegroups('all') raises KeyError 'zone'
Date Tue, 24 Dec 2019 16:34:32 GMT
kartiksubbarao commented on issue #1346: GCE ex_list_instancegroups('all') raises KeyError
   Thanks for the response @Kami . I don't have access to that GCE environment anymore so
I can't test, but I compared the August libcloud code to the current code and it doesn't seem
like there were any changes to `libcloud/compute/drivers/` that would have fixed this
   Hopefully the example object I provided above might shed some light into how GCP can return
objects that have regions (but not zones) populated.
   Also, here is some code that I came up with to work around the issue, perhaps this may
help in developing a proper fix:
   def list_all_instancegroups(gcp, projectid):
       instance_groups = []
       resp = gcp.connection.request('/aggregated/instanceGroups').object
       if 'items' in resp:
           for v in resp['items'].values():
               for ig in v.get('instanceGroups', []):
                   if 'zone' in ig:
                       try: instance_groups.append(gcp._to_instancegroup(ig))
                           e = sys.exc_info()
                           print('{}: instancegroup: {}'.format(
                                projectid, e[1].value['message']), file=sys.stderr)
                           if e[0] !=
       return instance_groups

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message