Use module level validation for params

This commit is contained in:
Darren Worrall 2015-08-28 08:21:20 +01:00
parent e8137d4065
commit 50d9589bc8

View file

@ -573,8 +573,6 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
'cpuSpeed': cpu_speed,
'memory': memory,
}]
elif any([cpu, cpu_speed, memory]):
self.module.fail_json(msg='cpu, cpu_speed and memory must be used together')
return res
def deploy_instance(self):
@ -857,6 +855,7 @@ def main():
),
required_together = (
['api_key', 'api_secret', 'api_url'],
['cpu', 'cpu_speed', 'memory'],
),
supports_check_mode=True
)