Skip to content

Pass keyword arguments correctly (#9332)#80

Merged
ekohl merged 1 commit intotheforeman:developfrom
ATIX-AG:fix_attrs
Feb 24, 2025
Merged

Pass keyword arguments correctly (#9332)#80
ekohl merged 1 commit intotheforeman:developfrom
ATIX-AG:fix_attrs

Conversation

@sbernhard
Copy link
Contributor

In Ruby 3.0 keyword arguments are handled separate from positional arguments1. This uses kwargs and passes it along.

In Ruby 3.0 keyword arguments are handled separate from positional
arguments[1]. This uses kwargs and passes it along.

[1]: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
@sbernhard
Copy link
Contributor Author

This solves:

Backtrace for 'Error has occurred while listing VMs on Google Cloud (europe-west3-c-Google)' error (ArgumentError): wrong number of arguments (given 2, expected 1)
/usr/share/gems/gems/foreman_google-2.0.1/app/lib/foreman_google/google_compute_adapter.rb:38:in `instances'
/usr/share/gems/gems/foreman_google-2.0.1/app/lib/google_cloud_compute/compute_collection.rb:6:in `initialize'
/usr/share/gems/gems/foreman_google-2.0.1/app/models/foreman_google/gce.rb:140:in `new'
/usr/share/gems/gems/foreman_google-2.0.1/app/models/foreman_google/gce.rb:140:in `vms'
/usr/share/foreman/app/controllers/compute_resources_vms_controller.rb:138:in `load_vms'
/usr/share/foreman/app/controllers/compute_resources_vms_controller.rb:18:in `index'

@sbernhard
Copy link
Contributor Author

Thoughts @ekohl ?

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Looks correct to me.

@ekohl ekohl added the bug Something isn't working label Feb 24, 2025
@ekohl ekohl merged commit 3eb14da into theforeman:develop Feb 24, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants