libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-696) GCE Compute driver returns null for image.
Date Wed, 13 May 2015 21:56:00 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14542803#comment-14542803
] 

ASF GitHub Bot commented on LIBCLOUD-696:
-----------------------------------------

GitHub user erjohnso opened a pull request:

    https://github.com/apache/libcloud/pull/522

    [google compute] LIBCLOUD-696: improve node image detection

    Google removed 'image' from the instance resource a while ago, but sometimes set a sourceImage
on a persistent disk. This fix will consult the sourceImage attribute on the instance's (node's)
boot_disk to try and determine the image.  There is still no guarantee this will be set (e.g.
if a persistent disk was created from a snapshot, this will still be None), but this is an
improvement.
    
    Fixes https://issues.apache.org/jira/browse/LIBCLOUD-696

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/erjohnso/libcloud jira696

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/libcloud/pull/522.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #522
    
----
commit b5fd83947f6fb821c38618782f1de39d73a6e0a4
Author: Eric Johnson <erjohnso@google.com>
Date:   2015-05-13T21:52:39Z

    [google compute] LIBCLOUD-696: improve node image detection

----


> GCE Compute driver returns null for image.
> ------------------------------------------
>
>                 Key: LIBCLOUD-696
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-696
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Compute
>            Reporter: Jason DeTiberus
>            Assignee: Eric Johnson
>
> The GCE Compute driver is currently returning null for image.  The issue appears to be
related to a change in the data returned from the api.
> In libcloud/compute/drivers/gce.py:
> {code:none|title=_to_node}
> extra['image'] = node.get('image')
> ...
> for disk in extra['disks']:
>     if disk.get('boot') and disk.get('type') == 'PERSISTENT':
>         bd = self._get_components_from_path(disk['source'])
>         extra['boot_disk'] = self.ex_get_volume(bd['name'], bd['zone'])
>         extra['image'] = bd['name']
> ...
> if extra['image']:
>     image = self._get_components_from_path(extra['image'])['name']
> else:
>     image = None
> {code}
> This looks like it should be:
> {code:none}
> for disk in extra['disks']:
>     if disk.get('boot') and disk.get('type') == 'PERSISTENT':
>         bd = self._get_components_from_path(disk['source'])
>         extra['boot_disk'] = self.ex_get_volume(bd['name'], bd['zone'])
>         extra['image'] = bd['name']
> ...
> if extra['image']:
>     image = self._get_components_from_path(extra['image'])['name']
> else:
>     image = None
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message