Fix backward compat change - create custom required_together statement (#19642)

This commit is contained in:
Rob 2017-01-04 14:11:56 +00:00 committed by John R Barker
parent dceace6bb2
commit 927218d99d

9
lib/ansible/modules/cloud/amazon/ec2_eip.py Normal file → Executable file
View file

@ -365,10 +365,7 @@ def main():
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
required_together=[
('device_id', 'private_ip_address'),
]
supports_check_mode=True
)
if not HAS_BOTO:
@ -386,6 +383,10 @@ def main():
reuse_existing_ip_allowed = module.params.get('reuse_existing_ip_allowed')
release_on_disassociation = module.params.get('release_on_disassociation')
# Parameter checks
if private_ip_address is not None and device_id is None:
module.fail_json(msg="parameters are required together: ('device_id', 'private_ip_address')")
if instance_id:
warnings = ["instance_id is no longer used, please use device_id going forward"]
is_instance = True