mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #31744 from brejoc/fix-attribute-error-with-older-libcloud/2015.5
Fix for AttributeError with libcloud <0.15
This commit is contained in:
commit
970ef0e445
1 changed files with 7 additions and 2 deletions
|
@ -6,7 +6,7 @@ CloudStack Cloud Module
|
|||
The CloudStack cloud module is used to control access to a CloudStack based
|
||||
Public Cloud.
|
||||
|
||||
:depends: libcloud
|
||||
:depends: libcloud >= 0.15
|
||||
|
||||
Use of this module requires the ``apikey``, ``secretkey``, ``host`` and
|
||||
``path`` parameters.
|
||||
|
@ -202,7 +202,12 @@ def get_project(conn, vm_):
|
|||
'''
|
||||
Return the project to use.
|
||||
'''
|
||||
projects = conn.ex_list_projects()
|
||||
try:
|
||||
projects = conn.ex_list_projects()
|
||||
except AttributeError:
|
||||
# with versions <0.15 of libcloud this is causing an AttributeError.
|
||||
log.warning('Cannot get projects, you may need to update libcloud to 0.15 or later')
|
||||
return False
|
||||
projid = config.get_cloud_config_value('projectid', vm_, __opts__)
|
||||
|
||||
if not projid:
|
||||
|
|
Loading…
Add table
Reference in a new issue