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

tools/build-rpms: fix ec2 client initialisation #4361

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

croissanne
Copy link
Member

@croissanne croissanne commented Sep 11, 2024

Fixes:

Error: Create EC2 instances  failed: 'ec2.ServiceResource' object has no attribute 'describe_images'
Traceback (most recent call last):
  File "/osbuild-composer/tools/build-rpms.py", line 218, in <module>
    stage_generate_rpms(cleanup_actions, args)
  File "/osbuild-composer/tools/build-rpms.py", line 175, in stage_generate_rpms
    create_ec2_instances, cleanup_actions, args, keyname)
  File "/osbuild-composer/tools/build-rpms.py", line 66, in stage
    ret = fun(*args)
  File "/osbuild-composer/tools/build-rpms.py", line 109, in create_ec2_instances
    img = ec2.describe_images(ImageIds=[arch_info[a]["ImageId"]])
AttributeError: 'ec2.ServiceResource' object has no attribute 'describe_images'

I didn't realise the difference between boto resources and boto clients. Rather confusing imo.

Fixes:
```
Error: Create EC2 instances  failed: 'ec2.ServiceResource' object has no attribute 'describe_images'
Traceback (most recent call last):
  File "/osbuild-composer/tools/build-rpms.py", line 218, in <module>
    stage_generate_rpms(cleanup_actions, args)
  File "/osbuild-composer/tools/build-rpms.py", line 175, in stage_generate_rpms
    create_ec2_instances, cleanup_actions, args, keyname)
  File "/osbuild-composer/tools/build-rpms.py", line 66, in stage
    ret = fun(*args)
  File "/osbuild-composer/tools/build-rpms.py", line 109, in create_ec2_instances
    img = ec2.describe_images(ImageIds=[arch_info[a]["ImageId"]])
AttributeError: 'ec2.ServiceResource' object has no attribute 'describe_images'
```
Copy link
Contributor

@schuellerf schuellerf left a comment

Choose a reason for hiding this comment

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

lgtm

@croissanne croissanne merged commit 0273908 into osbuild:main Sep 11, 2024
16 of 46 checks passed
@croissanne croissanne deleted the rpmbuild-boto3-ec2cli-fix branch September 11, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants