Fix for AttributeError with libcloud <0.15

ex_list_projects is introduced in version 0.15 of libcloud. I'm simply
cathing the AttributeError here to return False, just like there would
be not project.

Fixes #31729
This commit is contained in:
Jochen Breuer 2016-03-08 14:37:40 +01:00
parent 9162925dd0
commit 72eab406cd

View file

@ -202,7 +202,11 @@ 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.
return False
projid = config.get_cloud_config_value('projectid', vm_, __opts__)
if not projid: