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

EC2 object has no attribute KeyPairInfo #3472

Closed
utkonos opened this issue Oct 30, 2022 · 4 comments
Closed

EC2 object has no attribute KeyPairInfo #3472

utkonos opened this issue Oct 30, 2022 · 4 comments
Assignees
Labels
ec2 needs-review p2 This is a standard priority issue resources

Comments

@utkonos
Copy link

utkonos commented Oct 30, 2022

Describe the issue

The documentation for boto3 has a section for KeyPairInfo. If you run the example code, it raises an exeption.

ec2 = boto3.client('ec2')
key_pair_info = ec2.KeyPairInfo('test')

Exception:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In [99], line 1
----> 1 key_pair_info = ec2.KeyPairInfo('test')

File ~/venv/lib/python3.11/site-packages/botocore/client.py:859, in BaseClient.__getattr__(self, item)
    856 if event_response is not None:
    857     return event_response
--> 859 raise AttributeError(
    860     f"'{self.__class__.__name__}' object has no attribute '{item}'"
    861 )

AttributeError: 'EC2' object has no attribute 'KeyPairInfo'

Looking at old issues: here is one that mentions this documentation problem and that someone was looking into fixing it. However, that issue was closed automatically after a period of time.

#1945 (comment)

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#keypairinfo

@utkonos utkonos added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Oct 30, 2022
@aBurmeseDev aBurmeseDev self-assigned this Nov 1, 2022
@aBurmeseDev aBurmeseDev added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 1, 2022
@aBurmeseDev
Copy link
Contributor

Hi @utkonos, thanks for reaching out.

I was able to reproduce the same behavior and can confirm that it's inconsistent with what the documentation says. I reached out to the EC2 team for further investigation and confirm such behavior. I will post an update here once I hear back from the team.

Best,
John

@aBurmeseDev aBurmeseDev added the ec2 label Nov 1, 2022
@utkonos
Copy link
Author

utkonos commented Nov 1, 2022

I think the section for KeyPair along with the section for KeyPairInfo need to be fixed.

This line of code in the KeyPair example is correct:

key_pair = ec2.KeyPair('name')

However, this returns a KeyPairInfo object. That object has all the various attributes and methods listed on the KeyPairInfo section. Someone needs to review both of these sections and edit them so that they are correct. As it is now, both are basically wrong/confusing.

@aBurmeseDev
Copy link
Contributor

Thanks for providing additional inputs. I requested the team to look into both sections and they will hopefully clear up any confusion. Again I will make sure to post an update once I hear back and thank you for being patient with us!

@aBurmeseDev aBurmeseDev added the p3 This is a minor priority issue label Nov 3, 2022
@aBurmeseDev
Copy link
Contributor

Hi @utkonos - I appreciate your patience while we look into this. I have created a backlog item internally for boto3 team to further investigate. While I wasn't given any timeframe as to when to expect an update, I'll let you know when I receive any updates from them.

P74602266

@aBurmeseDev aBurmeseDev added needs-review p2 This is a standard priority issue and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. p3 This is a minor priority issue documentation This is a problem with documentation. labels Nov 10, 2022
@tim-finnigan tim-finnigan added documentation This is a problem with documentation. resources labels Nov 18, 2022
@aBurmeseDev aBurmeseDev removed the documentation This is a problem with documentation. label Dec 1, 2022
@utkonos utkonos closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ec2 needs-review p2 This is a standard priority issue resources
Projects
None yet
Development

No branches or pull requests

3 participants