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

Fix import export smartstate analysis #17697

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

juliancheal
Copy link
Member

@juliancheal juliancheal commented Jul 12, 2018

  • Added info log level
  • Changed how scanlines are tested for blanks

Fixes BZ https://bugzilla.redhat.com/show_bug.cgi?id=1344589

@juliancheal juliancheal changed the title Fix import export smartstate analysis [WIP] Fix import export smartstate analysis Jul 12, 2018
Based on an example from Brant Evans.

This should now be more consistant to other exports.
@miq-bot
Copy link
Member

miq-bot commented Jul 12, 2018

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
1 file checked, 0 offenses detected
Everything looks fine. 👍

@juliancheal juliancheal changed the title [WIP] Fix import export smartstate analysis Fix import export smartstate analysis Jul 12, 2018
@juliancheal
Copy link
Member Author

@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) }
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Contributor

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}]

Copy link
Member Author

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.

@miq-bot miq-bot removed the wip label Jul 12, 2018
@carbonin carbonin assigned carbonin and unassigned gtanzillo Jul 12, 2018
@carbonin carbonin added the core label Jul 12, 2018
@carbonin carbonin merged commit eb9b52a into ManageIQ:master Jul 12, 2018
@carbonin carbonin added this to the Sprint 90 Ending Jul 16, 2018 milestone Jul 12, 2018
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.

5 participants