Conversation
| 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') |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
This is the path taken on a PUT /host where things are being updated.
|
This PR may or may not be necessary for your main PR testing but it's worth running with. |
c1df42b to
5f3ac1f
Compare
a0e221b to
30856b3
Compare
Don't remove packages when cloning Pulp
No description provided.