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
Overriding queue name to generate an array of queue names #280
Overriding queue name to generate an array of queue names #280
Conversation
this allows us to create an array of child managers for our queue.
This PR relies on ManageIQ/manageiq#15711 |
Overriding queue_name on ::CloudManager was causing more problems than it solved. Moving this code to the Refeshwoker solves our multiple queues for one worker, while not causing (too many) new issues.
# of the Amazon inventory across all managers. | ||
def self.queue_name_for_ems(ems) | ||
return ems unless ems.kind_of?(ExtManagementSystem) | ||
["ems_#{ems.id}"] + ems.child_managers.collect { |manager| "ems_#{manager.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.
The parent implementation handles strange edge cases like if the input is a Host
.
Maybe this should be:
if ems.kind_of?(ExtManagementSystem)
["ems_#{ems.id}"] + ems.child_managers.collect { |manager| "ems_#{manager.id}" }
else
super
end
Then, let super
handle any of the edge cases.
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.
Yeah agreed. I think I was too happy to have found my last bug!
Checked commits https://github.com/juliancheal/manageiq-providers-amazon/compare/59f4b276c349f38281b90a360056d69b9fbf705c~...4f241f87cc779bfeef701be6f0e92319dfa49454 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@durandom @blomquisg merge? |
Dont we need the dependent PR merged first? |
To be honest, I don't know which PR needs merging first :( |
this allows us to create an array of child managers for our queue.