Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes after rebase an already approved PR:24767 #40088

Merged
merged 11 commits into from
May 14, 2018

Conversation

rsubra13
Copy link
Contributor

SUMMARY

Rebase changes after an already approved PR:24767

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ec2_ami_copy

ANSIBLE VERSION

ansible 2.5.2

ADDITIONAL INFORMATION

Nil

Will Thames and others added 5 commits May 14, 2018 09:50
When `tag_equality` is set true, use tags to determine
if AMIs in different accounts are the same, and don't
copy the AMI twice if they are the same.

Use AnsibleAWSModule and make imports more consistent
with other modules
@ansibot
Copy link
Contributor

ansibot commented May 14, 2018

@ansibot ansibot added aws cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. labels May 14, 2018
version_added: "2.2"
kms_key_id:
description:
- KMS key id used to encrypt image. If not specified, uses default EBS Customer Master Key (CMK) for your account.
required: false
default: null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to re-add these docs, as the default for any non-specified param is null

if module.params.get('wait'):
delay = 15
ec2.get_waiter('image_available').wait(ImageIds=[image['ImageId']])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to wait twice - the below lines do the same "wait" while respecting max wait time.

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label May 14, 2018
default: "default"
description:
description:
- An optional human-readable string describing the contents and purpose of the new AMI.
encrypted:
description:
- Whether or not the destination snapshots of the copied AMI should be encrypted.
required: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should also be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed them! Thanks @ryansb


module = AnsibleAWSModule(argument_spec=argument_spec)
# TODO: Check botocore version
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
ec2 = boto3_conn(module, conn_type='client', resource='ec2', region=region, endpoint=ec2_url,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, these 2 lines can be replaced with ec2 = module.client('ec2') and the boto3_conn and get_aws_connection_info imports can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Thanks.

@ansibot
Copy link
Contributor

ansibot commented May 14, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:0: syntax-error unexpected indent (<string>, line 146)

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "test/sanity/code-smell/docs-build.py", line 101, in <module>
    main()
  File "test/sanity/code-smell/docs-build.py", line 17, in main
    raise subprocess.CalledProcessError(sphinx.returncode, cmd, output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['make', 'singlehtmldocs']' returned non-zero exit status 2.

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 2.7 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 146) (in /root/ansible/test/runner/.tox/minimal-py27/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 3.5 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 146) (in /root/ansible/test/runner/.tox/minimal-py35/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 3.6 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 146) (in /root/ansible/test/runner/.tox/minimal-py36/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 3.7 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 146) (in /root/ansible/test/runner/.tox/minimal-py37/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: IndentationError: unexpected indent

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:5: E113 unexpected indentation

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: E401 Python SyntaxError while parsing module
test/sanity/validate-modules/ignore.txt:44:1: A102 Remove since "lib/ansible/modules/cloud/amazon/ec2_ami_copy.py" passes "E325" test

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:146:4: python-syntax-error unexpected indent (<unknown>, line 146)

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels May 14, 2018
Copy link
Contributor Author

@rsubra13 rsubra13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished with the changes!

@ansibot
Copy link
Contributor

ansibot commented May 14, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:0: syntax-error unexpected indent (&lt;string&gt;, line 143)

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test compile --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: SyntaxError: from botocore.exceptions import ClientError, NoCredentialsError, WaiterError

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Traceback (most recent call last):
  File "test/sanity/code-smell/docs-build.py", line 101, in <module>
    main()
  File "test/sanity/code-smell/docs-build.py", line 17, in main
    raise subprocess.CalledProcessError(sphinx.returncode, cmd, output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['make', 'singlehtmldocs']' returned non-zero exit status 2.

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 2.7 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 143) (in /root/ansible/test/runner/.tox/minimal-py27/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 3.5 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 143) (in /root/ansible/test/runner/.tox/minimal-py35/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 3.6 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 143) (in /root/ansible/test/runner/.tox/minimal-py36/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: IndentationError: unexpected indent

The test ansible-test sanity --test import --python 3.7 [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: IndentationError: unexpected indent (ec2_ami_copy.py, line 143) (in /root/ansible/test/runner/.tox/minimal-py37/bin/importer.py:82)
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: IndentationError: unexpected indent

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:5: E113 unexpected indentation

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:0:0: E401 Python SyntaxError while parsing module
test/sanity/validate-modules/ignore.txt:44:1: A102 Remove since "lib/ansible/modules/cloud/amazon/ec2_ami_copy.py" passes "E325" test

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/ec2_ami_copy.py:143:4: python-syntax-error unexpected indent (<unknown>, line 143)

click here for bot help

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels May 14, 2018
@s-hertel s-hertel merged commit 3955e52 into ansible:devel May 14, 2018
@s-hertel
Copy link
Contributor

Thanks for your first contribution @rsubra13!

oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 14, 2018
…ible#40088)

* Allow idempotent use of ec2_ami_copy

When `tag_equality` is set true, use tags to determine
if AMIs in different accounts are the same, and don't
copy the AMI twice if they are the same.

Use AnsibleAWSModule and make imports more consistent
with other modules

* Update version added

* More code review changes

* Review changes - Recommended way to start EC2 connection
tonal pushed a commit to tonal/ansible that referenced this pull request May 15, 2018
…ible#40088)

* Allow idempotent use of ec2_ami_copy

When `tag_equality` is set true, use tags to determine
if AMIs in different accounts are the same, and don't
copy the AMI twice if they are the same.

Use AnsibleAWSModule and make imports more consistent
with other modules

* Update version added

* More code review changes

* Review changes - Recommended way to start EC2 connection
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 15, 2018
…ible#40088)

* Allow idempotent use of ec2_ami_copy

When `tag_equality` is set true, use tags to determine
if AMIs in different accounts are the same, and don't
copy the AMI twice if they are the same.

Use AnsibleAWSModule and make imports more consistent
with other modules

* Update version added

* More code review changes

* Review changes - Recommended way to start EC2 connection
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 15, 2018
…ible#40088)

* Allow idempotent use of ec2_ami_copy

When `tag_equality` is set true, use tags to determine
if AMIs in different accounts are the same, and don't
copy the AMI twice if they are the same.

Use AnsibleAWSModule and make imports more consistent
with other modules

* Update version added

* More code review changes

* Review changes - Recommended way to start EC2 connection
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
…ible#40088)

* Allow idempotent use of ec2_ami_copy

When `tag_equality` is set true, use tags to determine
if AMIs in different accounts are the same, and don't
copy the AMI twice if they are the same.

Use AnsibleAWSModule and make imports more consistent
with other modules

* Update version added

* More code review changes

* Review changes - Recommended way to start EC2 connection
@ansible ansible locked and limited conversation to collaborators May 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws cloud community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants