-
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
Fix import export smartstate analysis #17697
Fix import export smartstate analysis #17697
Conversation
Based on an example from Brant Evans. This should now be more consistant to other exports.
Checked commits juliancheal/manageiq@a41a8d5~...4cab72d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@miq-bot assign @gtanzillo |
@@ -4,11 +4,14 @@ class ScanProfiles | |||
def export(options = {}) | |||
export_dir = options[:directory] | |||
|
|||
ScanItemSet.all.each do |p| | |||
next if p.read_only | |||
next if p.members.map { |m| m.slice(:filename) } |
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.
What was the intention for this line originally? Is this something we should fix rather than remove?
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.
So @branic was saying it's next if p.read_only
was to stop exporting non editable profiles aka read only.
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 next if p.read_only
line is handled by now checking if --all
was specified. I don't know what the p.members.map { |m| m.slice(:filename) }
was doing, but in my tests it always returned true and so never exported any profiles.
irb(main):006:0> p.members.map { |m| m.slice(:filename) }
=> [{"filename"=>nil}, {"filename"=>nil}, {"filename"=>nil}, {"filename"=>nil}]
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.
I was working from someone else code to start with so p.members.map { |m| m.slice(:filename) }
I assumed was needed. Should have done more research. Ho hum.
Fixes BZ https://bugzilla.redhat.com/show_bug.cgi?id=1344589