Skip to content

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.

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.

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.

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