-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: fixes-17148
Are you sure you want to change the base?
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.
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) |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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.