Skip to content
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

Remove storage references to multiple emses #19754

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Jan 23, 2020

Clean up technical debt in the storage to ems link.

There is a bit of cruft in the code to support a storage belonging to multiple emses. These optimizations were introduced to fix some performance issues with refresh.

Now that Storage has a single ems (via ems_id) instead of going throught the host_storages reference, these optimizations can be removed.

The PR that moved towards ems_id -- #19617


def ext_management_systems_with_authentication_status_ok_in_zone(zone_name)
ext_management_systems_with_authentication_status_ok.select { |ems| ems.my_zone == zone_name }
[ext_management_system]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe .compact to handle the case of an archived storage

ems = emss.detect { |e| smartstate_analysis_count_for_ems_id(e.id) < ::Settings.storage.max_parallel_scans_per_ems }
if ems.nil?
ems = ext_management_system
unless smartstate_analysis_count_for_ems_id(e.id) < ::Settings.storage.max_parallel_scans_per_ems
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this supposed to be ems.id or is e defined somewhere else?

@agrare
Copy link
Member

agrare commented Jan 27, 2020

Looks good @kbrock, few comments and the specs are failing

Storage now uses ems_id instead of host_storages for ems references
ManageIQ#19617

This further makes that change
@miq-bot
Copy link
Member

miq-bot commented Feb 5, 2020

Checked commit kbrock@ab68c94 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 🍪

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM!

@agrare agrare merged commit 595e9c3 into ManageIQ:master Feb 6, 2020
@agrare agrare added this to the Sprint 130 Ending Feb 17, 2020 milestone Feb 6, 2020
@himdel
Copy link
Contributor

himdel commented Feb 6, 2020

Fixing ui specs in ManageIQ/manageiq-ui-classic#6662,
but there's also this piece of code:

app/controllers/ops_controller/settings/schedules.rb
408:               "Storage.ext_management_systems-name",
555:      when "ems"     then {"CONTAINS" => {"field" => "Storage.ext_management_systems-name", "value" => params[:filter_value]}}

that's dead as well, right?
As well as any custom reports using Storage.ext_management_systems-anything?

@agrare
Copy link
Member

agrare commented Feb 6, 2020

@himdel we left Storage#ext_management_systems for compatibility so that should be okay.

@kbrock kbrock deleted the storage_ems_id branch February 6, 2020 16:28
@kbrock kbrock added technical debt and removed bug labels Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants