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

Fixes filtering of lxc container nics options #94

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/fog/proxmox/helpers/nic_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ def self.flatten(nic_hash)
end
nic_value += ',' + Fog::Proxmox::Hash.stringify(options) unless options.empty?
else
nic_value = Fog::Proxmox::Hash.stringify(nic_hash.except(%i[id model macaddr])) unless nic_hash.empty?
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a test for the "flatten" method?

Copy link
Contributor Author

@Manisha15 Manisha15 Jul 30, 2024

Choose a reason for hiding this comment

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

Added the test in foreman_fog_proxmox: theforeman/foreman_fog_proxmox#340

options = nic_hash.reject do |key, _value|
%i[id model macaddr].include? key.to_sym
end
nic_value = Fog::Proxmox::Hash.stringify(options) unless options.empty?
end
{ "#{nic_hash[:id]}": nic_value }
end
Expand Down
Loading