Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SLE-12-GA'
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jan 9, 2015
2 parents 4d49da5 + bdb8057 commit bd63e35
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .rubocop.yml
@@ -1,5 +1,6 @@
# use the shared Yast defaults
inherit_from:
.rubocop_yast_style.yml
/usr/share/YaST2/data/devtools/data/rubocop_yast_style.yml

# TODO: this need some non-trivial refactoring...
Metrics/AbcSize:
Expand Down
37 changes: 0 additions & 37 deletions .rubocop_yast_style.yml

This file was deleted.

40 changes: 20 additions & 20 deletions src/clients/inst_scc.rb
Expand Up @@ -122,7 +122,7 @@ def register_base_system

# do not re-register during installation
if !Mode.normal && ::Registration::Registration.is_registered? &&
options.base_registered
options.base_registered

return :next
end
Expand Down Expand Up @@ -581,47 +581,47 @@ def start_workflow
sequence = {
"ws_start" => workflow_start,
"check" => {
auto: :auto,
abort: :abort,
cancel: :abort,
register: "register",
auto: :auto,
abort: :abort,
cancel: :abort,
register: "register",
extensions: "select_addons",
update: "update",
next: :next
update: "update",
next: :next
},
"update" => {
abort: :abort,
cancel: :abort,
next: "select_addons",
abort: :abort,
cancel: :abort,
next: "select_addons",
register: "register"
},
"register" => {
abort: :abort,
abort: :abort,
cancel: :abort,
skip: :next,
next: "select_addons"
skip: :next,
next: "select_addons"
},
"select_addons" => {
abort: :abort,
skip: "update_autoyast_config",
abort: :abort,
skip: "update_autoyast_config",
cancel: "check",
next: "addon_eula"
next: "addon_eula"
},
"addon_eula" => {
abort: :abort,
next: "register_addons"
next: "register_addons"
},
"register_addons" => {
abort: :abort,
next: "update_autoyast_config"
next: "update_autoyast_config"
},
"update_autoyast_config" => {
abort: :abort,
next: "pkg_manager"
next: "pkg_manager"
},
"pkg_manager" => {
abort: :abort,
next: :next
next: :next
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/registration/connect_helpers.rb
Expand Up @@ -69,7 +69,7 @@ def self.catch_registration_errors(message_prefix: "", show_update_hint: false,
rescue SocketError, Errno::ENETUNREACH => e
log.error "Network error: #{e.class}: #{e.message}"
if (Yast::Mode.installation || Yast::Mode.update) &&
!(Yast::Mode.autoinst || Yast::Mode.autoupgrade)
!(Yast::Mode.autoinst || Yast::Mode.autoupgrade)

if Yast::Popup.YesNo(
# Error popup
Expand Down Expand Up @@ -105,7 +105,7 @@ def self.catch_registration_errors(message_prefix: "", show_update_hint: false,
"%s to speed up the synchronization process.\n" \
"Just wait several minutes after logging in and then retry \n" \
"the upgrade again.") % \
SUSE::Connect::Client::DEFAULT_URL
SUSE::Connect::Client::DEFAULT_URL
end

# add the hint to the error details
Expand Down
2 changes: 1 addition & 1 deletion src/lib/registration/helpers.rb
Expand Up @@ -135,7 +135,7 @@ def self.copy_certificate_to_target
# write the current configuration to the configuration file
def self.write_config
config_params = {
url: UrlHelpers.registration_url,
url: UrlHelpers.registration_url,
insecure: insecure_registration
}

Expand Down
24 changes: 12 additions & 12 deletions src/lib/registration/registration.rb
Expand Up @@ -99,9 +99,9 @@ def get_addon_list
log.info "Reading available addons for product: #{base_product["name"]}"

remote_product = SUSE::Connect::Remote::Product.new(
arch: base_product["arch"],
identifier: base_product["name"],
version: base_product["version"],
arch: base_product["arch"],
identifier: base_product["name"],
version: base_product["version"],
release_type: base_product["release_type"]
)

Expand Down Expand Up @@ -133,9 +133,9 @@ def self.is_registered?
def set_registered(remote_product)
addon = Addon.find_all(self).find do |a|
a.arch == remote_product.arch &&
a.identifier == remote_product.identifier &&
a.version == remote_product.version &&
a.release_type == remote_product.release_type
a.identifier == remote_product.identifier &&
a.version == remote_product.version &&
a.release_type == remote_product.release_type
end

return unless addon
Expand All @@ -147,9 +147,9 @@ def set_registered(remote_product)
def service_for_product(product, &block)
if product.is_a?(Hash)
remote_product = SUSE::Connect::Remote::Product.new(
arch: product["arch"],
identifier: product["name"],
version: product["version"],
arch: product["arch"],
identifier: product["name"],
version: product["version"],
release_type: product["release_type"]
)
else
Expand Down Expand Up @@ -205,9 +205,9 @@ def store_ssl_error(context)

def connect_params(params = {})
default_params = {
language: ::Registration::Helpers.http_language,
debug: ENV["SCCDEBUG"],
verbose: ENV["Y2DEBUG"] == "1",
language: ::Registration::Helpers.http_language,
debug: ENV["SCCDEBUG"],
verbose: ENV["Y2DEBUG"] == "1",
# pass a verify_callback to get details about failed SSL verification
verify_callback: verify_callback
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/registration/ssl_certificate_details.rb
Expand Up @@ -32,9 +32,9 @@ def issuer

def summary(small_space: false)
summary = _("Certificate:") + "\n" + _("Issued To") + "\n" + subject +
"\n" + _("Issued By") + "\n" + issuer + "\n" + _("SHA1 Fingerprint: ") +
"\n" + INDENT + certificate.fingerprint(Fingerprint::SHA1).value + "\n" +
_("SHA256 Fingerprint: ") + "\n"
"\n" + _("Issued By") + "\n" + issuer + "\n" + _("SHA1 Fingerprint: ") +
"\n" + INDENT + certificate.fingerprint(Fingerprint::SHA1).value + "\n" +
_("SHA256 Fingerprint: ") + "\n"

sha256 = certificate.fingerprint(Fingerprint::SHA256).value
if small_space
Expand Down
16 changes: 8 additions & 8 deletions src/lib/registration/ui/autoyast_config_workflow.rb
Expand Up @@ -46,27 +46,27 @@ def run
sequence = {
"ws_start" => "general",
"general" => {
abort: :abort,
next: :next,
abort: :abort,
next: :next,
addons: "addons"
},
"addons" => {
abort: :abort,
next: "general",
abort: :abort,
next: "general",
download: "remote_addons"
},
"remote_addons" => {
addons: "addons",
abort: :abort,
next: "addons_eula"
abort: :abort,
next: "addons_eula"
},
"addons_eula" => {
abort: :abort,
next: "addons_regcodes"
next: "addons_regcodes"
},
"addons_regcodes" => {
abort: :abort,
next: "addons"
next: "addons"
}
}

Expand Down
12 changes: 6 additions & 6 deletions test/addon_spec.rb
Expand Up @@ -19,7 +19,7 @@
prod2 = addon_generator
registration = double(
activated_products: [],
get_addon_list: [prod1, prod2]
get_addon_list: [prod1, prod2]
)

expect(Registration::Addon.find_all(registration).size).to be 2
Expand All @@ -29,7 +29,7 @@
prod1 = addon_with_child_generator
registration = double(
activated_products: [],
get_addon_list: [prod1]
get_addon_list: [prod1]
)

expect(Registration::Addon.find_all(registration).size).to be 2
Expand All @@ -39,7 +39,7 @@
prod1 = addon_with_child_generator
registration = double(
activated_products: [],
get_addon_list: [prod1]
get_addon_list: [prod1]
)

addons = Registration::Addon.find_all(registration)
Expand All @@ -52,7 +52,7 @@
prod2 = addon_generator("name" => "prod2")
registration = double(
activated_products: [prod1],
get_addon_list: [prod1, prod2]
get_addon_list: [prod1, prod2]
)

addons = Registration::Addon.find_all(registration)
Expand All @@ -67,7 +67,7 @@
it "sets the registration status for dependent addons" do
registration = double(
activated_products: YAML.load_file(fixtures_file("activated_products.yml")),
get_addon_list: YAML.load_file(fixtures_file("pure_addons.yml"))
get_addon_list: YAML.load_file(fixtures_file("pure_addons.yml"))
)

addons = Registration::Addon.find_all(registration)
Expand Down Expand Up @@ -171,7 +171,7 @@
describe "#selectable?" do
let(:addons) do
Registration::Addon.find_all(double(
get_addon_list: [addon_with_child_generator],
get_addon_list: [addon_with_child_generator],
activated_products: []
))
end
Expand Down
2 changes: 1 addition & 1 deletion test/helpers_spec.rb
Expand Up @@ -164,7 +164,7 @@
expect(Registration::Helpers).to receive(:insecure_registration) \
.and_return(false)
expect(SUSE::Connect::YaST).to receive(:write_config).with(
url: url,
url: url,
insecure: false
)

Expand Down

0 comments on commit bd63e35

Please sign in to comment.