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

(cherry picked from commit 18b7852940)
pull/20067/head
René Moser 8 years ago committed by Rene Moser
parent a8421e2424
commit f821d3a9f6

@ -263,6 +263,9 @@ class AnsibleCloudStack(object):
zone = self.module.params.get('zone')
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
if not zone:
self.zone = zones['zone'][0]

Loading…
Cancel
Save