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:
parent
f28b5a0ed8
commit
18b7852940
1 changed files with 3 additions and 0 deletions
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue