-
Notifications
You must be signed in to change notification settings - Fork 899
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
Workflow cloud_tenant fix #19237
Workflow cloud_tenant fix #19237
Conversation
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.
Crap... I guess you called this. Well, if there is a bug then no helping. 👍
@kbrock I believe the fix is actually a little different and as you stated in the description it does not make sense that the I was thinking that there must be some additional column that is needed for the Through a little trail and error I found that adding the irb(main):001:0> vms = VmOrTemplate.where(:id => 3773)
=> #<ActiveRecord::Relation [#<ManageIQ::Providers::Openstack::CloudManager::Template id: 3773, vendor: "openstack"...
irb(main):002:0> vms = vms.select(:id, :name, :guid, :uid_ems, :ems_id, :cloud_tenant_id)
=> #<ActiveRecord::Relation [#<VmOrTemplate id: 3773, name: "HUIS-EvmSnapshot", guid: "6e45d27a-3d57-11e6-ab22-6003089fa294"...
irb(main):003:0> vms.first.cloud_tenant
NoMethodError (undefined method `cloud_tenant' for #<VmOrTemplate:0x00007fe989c36778>)
irb(main):004:0> vms = vms.select(:id, :name, :guid, :uid_ems, :ems_id, :cloud_tenant_id, :type)
=> #<ActiveRecord::Relation [#<ManageIQ::Providers::Openstack::CloudManager::Template id: 3773, name: "HUIS-EvmSnapshot"...
irb(main):005:0> vms.first.cloud_tenant
=> #<ManageIQ::Providers::Openstack::CloudManager::CloudTenant id: 10, name: "admin", description: "admin tenant"... In the end I think the proper code change is to add # Only select the colums we need
- vms = vms.select(:id, :name, :guid, :uid_ems, :ems_id, :cloud_tenant_id)
+ vms = vms.select(:id, :name, :guid, :uid_ems, :ems_id, :cloud_tenant_id, :type) |
@gmcculloug oh yeah, that makes so much sense now. Since I was the original author to this mess, I am happy to here that the @kbrock we probably should have a test case for this if possible, but unsure how you would do that. |
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.
See Greg M's comment
b570cc9
to
c988392
Compare
Checked commit kbrock@c988392 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
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.
Looks good. I would suggest updating the PR description as well.
…ud_tenant Workflow cloud_tenant fix (cherry picked from commit b598db0) https://bugzilla.redhat.com/show_bug.cgi?id=1746931
Ivanchuk backport details:
|
fixes https://bugzilla.redhat.com/show_bug.cgi?id=1746931
Introduced #18353
This did not bring back the
type
column so all classes wereVmOrType
.Since the
cloud_tenant
method is introduced in a subclass, it was missing.Now that we are instantiating the correct class (with help from
type
) all is well.