1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cloudstack: utils: fail friendlier if no zones available (#19332)

This commit is contained in:
René Moser 2016-12-14 11:37:26 +01:00 committed by GitHub
parent f28b5a0ed8
commit 18b7852940

View file

@ -407,6 +407,9 @@ class AnsibleCloudStack(object):
zone = os.environ.get('CLOUDSTACK_ZONE') zone = os.environ.get('CLOUDSTACK_ZONE')
zones = self.cs.listZones() zones = self.cs.listZones()
if not zones:
self.module.fail_json(msg="No zones available. Please create a zone first")
# use the first zone if no zone param given # use the first zone if no zone param given
if not zone: if not zone:
self.zone = zones['zone'][0] self.zone = zones['zone'][0]