-
Notifications
You must be signed in to change notification settings - Fork 343
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
Unable to import amazon.aws.ec2_instance due to invalid syntax #925
Comments
Files identified in the description:
If these files are inaccurate, please update the |
Hi @tobiasehlert, We have sanity tests which should generally block code that can't be imported. Looking at the information you've provided, it looks like you're using Python 2.7. This collection has dropped support for Python 2.7 due to the boto3 and botocore SDKs dropping support for Python 2.7. Assuming you're trying to use a recent copy of the collection rather than the version shipped with Ansible 2.9, the most likely cause of the problem is that Python 3+ syntax is now in the ec2_instance module. As this issue appears to be both a version of Ansible which is no longer supported by upstream, and a version of Python which is no longer supported by this collection, I'm going to close this issue. If you're able to reproduce the issue with Python >= 3.6 then feel free to reopen the issue. If you're running Ansible Tower / Ansible Automation Platform and the ec2_instance module that shipped with the product, then please open a support case with Red Hat support |
Just a quick note ec2_instance does indeed have non-Python 2.7 code:
It is however valid Python 3.6+:
|
Thanks @tremble! Switched to a Ubuntu based GitHub runner from Amazon Linux 2 and there Ansible was running with Python 3. |
…ons#925) New module for creating Cloudfront header policies… .. used for response headers SUMMARY New Cloudfront module for CF response headers policies, see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-response-headers.html This is still a relavily new feature, see https://aws.amazon.com/de/blogs/networking-and-content-delivery/amazon-cloudfront-introduces-response-headers-policies/ ISSUE TYPE New Module Pull Request COMPONENT NAME cloudfront_response_headers_policy.py Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Stefan Horning <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: Markus Bergholz <[email protected]>
…ons#925) New module for creating Cloudfront header policies… .. used for response headers SUMMARY New Cloudfront module for CF response headers policies, see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-response-headers.html This is still a relavily new feature, see https://aws.amazon.com/de/blogs/networking-and-content-delivery/amazon-cloudfront-introduces-response-headers-policies/ ISSUE TYPE New Module Pull Request COMPONENT NAME cloudfront_response_headers_policy.py Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Stefan Horning <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: Markus Bergholz <[email protected]>
…ons#925) New module for creating Cloudfront header policies… .. used for response headers SUMMARY New Cloudfront module for CF response headers policies, see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-response-headers.html This is still a relavily new feature, see https://aws.amazon.com/de/blogs/networking-and-content-delivery/amazon-cloudfront-introduces-response-headers-policies/ ISSUE TYPE New Module Pull Request COMPONENT NAME cloudfront_response_headers_policy.py Reviewed-by: Mark Woolley <[email protected]> Reviewed-by: Stefan Horning <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: Markus Bergholz <[email protected]>
Summary
I try to use the amazon.aws.ec2_instance module from the amazon.aws collection, but it returns that there is some syntax error when importing.
Works perfect to run various other modules, it's just the ec2_instance one that always fails (tested multiple examples as well).
Issue Type
Bug Report
Component Name
ec2_instance
Ansible Version
Collection Versions
AWS SDK versions
Configuration
$ ansible-config dump --only-changed
OS / Environment
Amazon Linux 2 on ami-0917076ab9780844d (amzn2-ami-kernel-5.10-hvm-2.0.20220606.1-x86_64-gp2)
Steps to Reproduce
Expected Results
I expected a message saying that the instance with that ID doesn't exist so it can't restart it.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: