Skip to content
Permalink
Browse files

Code review update

  • Loading branch information...
lslezak committed Oct 6, 2017
1 parent aa9eb63 commit df12f3407590a62dc17ca1bed2bce23397b921cc
Showing with 17 additions and 11 deletions.
  1. +14 −10 src/lib/registration/addon.rb
  2. +3 −1 src/lib/registration/clients/inst_scc.rb
@@ -46,16 +46,7 @@ def find_all(registration)
res.concat(yast_addons)
end

# dump the downloaded data to a file for easier debugging,
# avoid write failures when running as an unprivileged user (rspec tests)
if File.writable?("/var/log/YaST2")
require "yaml"
header = "# see " \
"https://github.com/yast/yast-registration/tree/master/devel/dump_reader.rb\n" \
"# for an example how to read this dump file\n"
File.write("/var/log/YaST2/registration_addons.yml",
header + @cached_addons.to_yaml)
end
dump_addons

@cached_addons
end
@@ -237,5 +228,18 @@ def matches_remote_product?(remote_product)
send(attr) == remote_product.send(attr)
end
end

def self.dump_addons
# dump the downloaded data to a file for easier debugging,
# avoid write failures when running as an unprivileged user (rspec tests)
return unless File.writable?("/var/log/YaST2")

require "yaml"
header = "# see " \
"https://github.com/yast/yast-registration/tree/master/devel/dump_reader.rb\n" \
"# for an example how to read this dump file\n"
File.write("/var/log/YaST2/registration_addons.yml",
header + @cached_addons.to_yaml)
end
end
end
@@ -63,6 +63,8 @@ def main

initialize_regcodes

# FIXME: Add a separate client, changing the behavior completely acording to
# the passed parameters is not nice
media_workflow? ? ::Registration::UI::MediaAddonWorkflow.run(WFM.Args[1]) : start_workflow
end

@@ -343,5 +345,5 @@ def first_run

::Registration::Helpers.reset_registration_status
end
end unless defined?(InstSccClient)
end
end

0 comments on commit df12f34

Please sign in to comment.
You can’t perform that action at this time.