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

pr 6495 suggestions #16

Open
wants to merge 2 commits into
base: fixes-17148
Choose a base branch
from

Conversation

thomasmckay
Copy link

No description provided.

if self.hypervisor
guests = self.candlepin_consumer.virtual_guests
if !consumer_params.try(:[], 'guestIds').empty?
guests = FactValue.where("value IN (?)", consumer_params['guestIds']).pluck('host_id')
Copy link
Author

Choose a reason for hiding this comment

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

this line should find fact values only where fact name is "virt::uuid" (I think that is the syntax for candlepin facts). I wasn't sure how best to do that.

@@ -80,7 +84,7 @@ def consumer_attributes
product
end
end
attrs
HashWithIndifferentAccess.new(attrs)
Copy link
Author

Choose a reason for hiding this comment

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

Switching to HashWithIndifferentAccess will eliminate the need for those .try() in other methods. The data coming in via PUT /hosts were symbols not strings so the check 'guestIds' was failing to trigger the hypervisor=true check.

@@ -99,11 +99,13 @@ def pool_ids
end

def virtual_guests
return [] if self.uuid.nil?
Copy link
Author

Choose a reason for hiding this comment

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

There were candlepin.log errors triggered when making these calls during the host create via api since there is no uuid yet.

@@ -16,6 +16,7 @@ def plan(host, consumer_params = nil)
host.subscription_facet.update_from_consumer_attributes(consumer_params)
else
consumer_params = host.subscription_facet.consumer_attributes
host.subscription_facet.update_from_consumer_attributes(consumer_params)
Copy link
Author

Choose a reason for hiding this comment

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

This is the path taken on a PUT /host where things are being updated.

@thomasmckay
Copy link
Author

This PR may or may not be necessary for your main PR testing but it's worth running with.

theforeman/foreman-tasks#227

@ehelms ehelms force-pushed the fixes-17148 branch 2 times, most recently from c1df42b to 5f3ac1f Compare February 11, 2017 16:58
@ehelms ehelms force-pushed the fixes-17148 branch 2 times, most recently from a0e221b to 30856b3 Compare February 21, 2017 23:08
ehelms added a commit that referenced this pull request Aug 25, 2017
Don't remove packages when cloning Pulp
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