[cloud][testing] New integration tests for ec2_asg (#30554)

* Add some integration tests for ec2_asg.

* Remove exception handling from ec2_asg boto3 connection since it is handled in boto3_conn().

* Update test failure assertions

* Use yaml anchor for credentials and remove unnecessary dependencies.

* Move AWS boto3 module credentials tests to separate target

* Remove filters from tests
This commit is contained in:
Sloane Hertel 2018-01-08 11:21:49 -05:00 committed by Ryan Brown
parent 46263d77f1
commit 788010d0f0
9 changed files with 510 additions and 11 deletions

View file

@ -1416,16 +1416,12 @@ def main():
replace_instances = module.params.get('replace_instances')
replace_all_instances = module.params.get('replace_all_instances')
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
try:
connection = boto3_conn(module,
conn_type='client',
resource='autoscaling',
region=region,
endpoint=ec2_url,
**aws_connect_params)
except (botocore.exceptions.NoCredentialsError, botocore.exceptions.ProfileNotFound) as e:
module.fail_json(msg="Can't authorize connection. Check your credentials and profile.",
exceptions=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))
connection = boto3_conn(module,
conn_type='client',
resource='autoscaling',
region=region,
endpoint=ec2_url,
**aws_connect_params)
changed = create_changed = replace_changed = False
if state == 'present':