-
Notifications
You must be signed in to change notification settings - Fork 897
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
move #my_zone from ArchivedMixin to OldEmsMixin #17539
Conversation
Not every model that needs ArchivedMixin has old_ext_management_sytem. For those do need now they should include OldEmsMixin.
@bzwei unrecognized command 'label', ignoring... Accepted commands are: add_label, add_reviewer, assign, close_issue, move_issue, remove_label, rm_label, set_milestone |
Checked commit bzwei@8e753a1 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/mixins/old_ems_mixin.rb
|
Looks good to me, let me run the kubernetes and openshift specs with this applied to master and I'll merge if that's green |
@miq-bot add_label Gaprindashvili/yes |
Kubernetes and Openshift specs pass |
move #my_zone from ArchivedMixin to OldEmsMixin (cherry picked from commit 8bd1664) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1595418
Gaprindashvili backport details:
|
end | ||
|
||
# Needed for metrics | ||
def my_zone |
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.
Just saw this now, but this is a really weird place for this method. I get that OldEmsMixin should enhance the method, but it feels more correct for there to be a method in the base class that does my_zone
normally, and this method can do what it does followed by calling super
. @agrare ?
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.
@Fryguy yeah I see what you mean, there doesn't seem to be a whole lot that the base model's my_zone
method does though, they all look like:
def my_zone
ems = ext_management_system
ems ? ems.my_zone : MiqServer.my_zone
end
So we would have to refactor them all to allow this to get in the middle before falling back to MiqServer.my_zone
.
Maybe a method my_ems
which my_zone
would call then this mixin could enhance the my_ems
method?
Not every model that needs
ArchivedMixin
hasext_management_system
or#old_ext_management_sytem
. For those do need to use#old_ext_management_system
now they should includeOldEmsMixin
.This is a followup PR of #17480
Fixes issue #17535
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1594873
Gap backport: #17540