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 reference to job.guid from VmOrTemplate #15009

Merged

Conversation

yrudman
Copy link
Contributor

@yrudman yrudman commented May 4, 2017

There is no need to include job.guid into error message when proxy for smart state analysis not available - proxy is instance of MiqServer and does not depend on job instance.

This PR:

  • introduced new method VmOrTemplate#log_all_proxies' which does not accept job`
  • refactor `VmOrTemplate#proxies4job' to:
    • remove references to job
    • remove logic related to registered Host been proxy for SmartState Analysis

Follow-up PR will remove not used VmOrTemplate#log_proxies and replace call to it to log_all_proxies for redhat provider

@miq-bot add-label technical debt

yrudman added 2 commits May 5, 2017 08:57
…es are instances of MiqServer and does not depend on 'job'.

proxy can not be instance of Host and we do not need to check for registred hosts
…s of SmartState proxy through registered hosts: proxy can not be instance of Host - only MiqServer

$rspec: no need for tests SmartState proxy through registered hosts
@yrudman yrudman force-pushed the remove-reference-to-job-guid-from-vm branch from c8a7238 to 8758d7b Compare May 5, 2017 13:00
@yrudman yrudman changed the title [WIP] Remove reference to job.guid from VmOrTemplate Remove reference to job.guid from VmOrTemplate May 5, 2017
Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

This looks good to me 👍 I would like to get another set of eyes on it, though, before merging. @jrafanie, can you please review? Thanks!

@gtanzillo gtanzillo requested a review from jrafanie May 5, 2017 15:55
@gtanzillo gtanzillo self-assigned this May 5, 2017

log_all_proxies(all_proxy_list, msg) if proxies.empty?
Copy link
Member

Choose a reason for hiding this comment

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

Can log_proxies be removed down below? Are there other callers?

Copy link
Member

Choose a reason for hiding this comment

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

Follow-up PR will remove not used VmOrTemplate#log_proxies and replace call to it to log_all_proxies for redhat provider

Lol, now I see it, sorry

if job && !job.kind_of?(ActiveRecord::Base)
jobid = job
job = Job.find_by(:guid => jobid)
end
Copy link
Member

Choose a reason for hiding this comment

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

Wow, we do all that work with the job just for logging... Nice find. We don't need it.

elsif proxies.empty?
"Provide credentials for this VM's Host to perform SmartState Analysis"
else
'Perform SmartState Analysis on this VM'
Copy link
Member

Choose a reason for hiding this comment

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

@yrudman I'm good with this whole PR but this code is not sufficiently covered by tests, did you run SSA for the 3 conditionals you're handling here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jrafanie I've added missing test

@yrudman yrudman force-pushed the remove-reference-to-job-guid-from-vm branch from a266405 to ee3d7e0 Compare May 6, 2017 01:51
@miq-bot
Copy link
Member

miq-bot commented May 6, 2017

Checked commits yrudman/manageiq@17e8652~...ee3d7e0 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@jrafanie jrafanie merged commit aeccf24 into ManageIQ:master May 8, 2017
@jrafanie jrafanie deleted the remove-reference-to-job-guid-from-vm branch May 8, 2017 17:58
@jrafanie jrafanie added this to the Sprint 60 Ending May 8, 2017 milestone May 8, 2017
yrudman added a commit to yrudman/manageiq that referenced this pull request May 9, 2017
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