Sfoglia il codice sorgente

Used session to get project_id + fixed readme

Nuwan Goonasekera 8 anni fa
parent
commit
c7b46a3b4d
2 ha cambiato i file con 13 aggiunte e 5 eliminazioni
  1. 12 0
      README.rst
  2. 1 5
      cloudbridge/cloud/providers/openstack/services.py

+ 12 - 0
README.rst

@@ -27,20 +27,32 @@ conditional code for each cloud.
    :alt: 'Waffle.io - Issues in progress'
    :alt: 'Waffle.io - Issues in progress'
 
 
 .. |aws-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/1
 .. |aws-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/1
+              :target: https://travis-ci.org/gvlproject/cloudbridge
 .. |aws-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/3
 .. |aws-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/3
+              :target: https://travis-ci.org/gvlproject/cloudbridge
 .. |aws-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/5
 .. |aws-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/5
+              :target: https://travis-ci.org/gvlproject/cloudbridge
 
 
 .. |os-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/2
 .. |os-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/2
+             :target: https://travis-ci.org/gvlproject/cloudbridge
 .. |os-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/4
 .. |os-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/4
+             :target: https://travis-ci.org/gvlproject/cloudbridge
 .. |os-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/6
 .. |os-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/master/6
+             :target: https://travis-ci.org/gvlproject/cloudbridge
 
 
 .. |azure-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/azure_dev/2
 .. |azure-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/azure_dev/2
+                :target: https://travis-ci.org/gvlproject/cloudbridge/branches
 .. |azure-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/azure_dev/5
 .. |azure-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/azure_dev/5
+                :target: https://travis-ci.org/gvlproject/cloudbridge/branches
 .. |azure-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/azure_dev/8
 .. |azure-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/azure_dev/8
+                :target: https://travis-ci.org/gvlproject/cloudbridge/branches
 
 
 .. |gce-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/gce/3
 .. |gce-py27| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/gce/3
+              :target: https://travis-ci.org/gvlproject/cloudbridge/branches
 .. |gce-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/gce/6
 .. |gce-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/gce/6
+              :target: https://travis-ci.org/gvlproject/cloudbridge/branches
 .. |gce-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/gce/9
 .. |gce-pypy| image:: https://travis-matrix-badges.herokuapp.com/repos/gvlproject/cloudbridge/branches/gce/9
+              :target: https://travis-ci.org/gvlproject/cloudbridge/branches
 
 
 
 
 Build Status
 Build Status

+ 1 - 5
cloudbridge/cloud/providers/openstack/services.py

@@ -272,11 +272,7 @@ class OpenStackImageService(BaseImageService):
         """
         """
         project_id = None
         project_id = None
         if filter_by_owner:
         if filter_by_owner:
-            try:
-                project_id = self.provider.keystone.projects.list(
-                    name=self.provider.project_name)[0].id
-            except IndexError:
-                pass
+            project_id = self.provider.os_conn.session.get_project_id()
         os_images = self.provider.os_conn.image.images(
         os_images = self.provider.os_conn.image.images(
             owner=project_id,
             owner=project_id,
             limit=oshelpers.os_result_limit(self.provider, limit),
             limit=oshelpers.os_result_limit(self.provider, limit),