Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into registered_status
Browse files Browse the repository at this point in the history
Conflicts:
	package/yast2-registration.changes
  • Loading branch information
lslezak committed May 12, 2014
2 parents 2bb4f9e + ad18fd4 commit d2965ca
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 29 deletions.
3 changes: 3 additions & 0 deletions package/yast2-registration.changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Fri May 9 12:27:20 UTC 2014 - lslezak@suse.cz
- remember registered extensions, do not register them again
and disable the checkboxes (extensions cannot be "unregistered")
- display registered status in the main dialog
- use "extension" term consistently (bnc#875199)
- allow registering extensions in installed system without
re-registering the base product (bnc#876328)

-------------------------------------------------------------------
Wed May 7 13:17:23 UTC 2014 - lslezak@suse.cz
Expand Down
46 changes: 26 additions & 20 deletions src/clients/inst_scc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ def register_base_system

base_product["reg_code"] = reg_code
registered_services = @registration.register_product(base_product)

# remember the base products for later (to get the respective addons)
::Registration::Storage::BaseProduct.instance.product = base_product
options.base_registered = true

registered_services
Expand Down Expand Up @@ -182,12 +179,12 @@ def scc_credentials_dialog

if !Mode.normal
# add a paragraph separator
info << "\n\n"
info += "\n\n"

# label text describing the registration (2/2),
# not displayed in installed system
# use \n to split to more lines if needed (use max. 76 chars/line)
info << _("If you skip the registration now be sure to do so in the installed system.")
info += _("If you skip the registration now be sure to do so in the installed system.")
end

registered = ::Registration::Registration.is_registered?
Expand Down Expand Up @@ -303,7 +300,7 @@ def addon_selection_dialog_content(addons)
VSpacing(0.4),
HBox(
HSpacing(1),
Left(CheckBox(Id(:media), _("In&clude Add-on Products from Separate Media"),
Left(CheckBox(Id(:media), _("In&clude Extensions from Separate Media"),
Installation.add_on_selected)),
)
)
Expand Down Expand Up @@ -333,7 +330,7 @@ def addon_selection_dialog_content(addons)
Left(Label(_("Details"))),
MinHeight(8,
VWeight(25, RichText(Id(:details), Opt(:disabled), "<small>" +
_("Select an addon to show details here") + "</small>")),
_("Select an extension to show details here") + "</small>")),
),
media_checkbox,
VSpacing(0.4),
Expand Down Expand Up @@ -446,8 +443,8 @@ def select_addons
_("Extension Selection"),
addon_selection_dialog_content(addons),
# help text for add-ons installation, %s is URL
_("<p>\nTo install an add-on product from separate media together with &product;, select\n" +
"<b>Include Add-on Products from Separate Media</b>.</p>\n" +
_("<p>\nTo install an extension product from separate media together with the product, select\n" +
"<b>Include Extensions from Separate Media</b>.</p>\n" +
"<p>If you need specific hardware drivers for installation, see <i>%s</i> site.</p>") %
"http://drivers.suse.com",
GetInstArgs.enable_back || Mode.normal,
Expand Down Expand Up @@ -516,6 +513,8 @@ def get_available_addons
@available_addons = ::Registration::Storage::Cache.instance.available_addons
return @available_addons if @available_addons

init_registration

@available_addons = Popup.Feedback(
_(CONTACTING_MESSAGE),
_("Loading Available Add-on Products and Extensions...")) do
Expand Down Expand Up @@ -615,7 +614,7 @@ def register_addons
if missing_regcodes.empty?
Wizard.SetContents(
# dialog title
_("Registering Selected Add-on Products and Extensions"),
_("Register Extensions"),
# display only the products which need a registration code
Empty(),
# FIXME: help text
Expand All @@ -628,7 +627,7 @@ def register_addons
else
Wizard.SetContents(
# dialog title
_("Enter Registration Codes for Selected Add-on Products and Extensions"),
_("Extension Registration Codes"),
# display only the products which need a registration code
addon_regcodes_dialog_content(missing_regcodes),
# FIXME: help text
Expand Down Expand Up @@ -664,8 +663,12 @@ def media_addons
def registered_dialog
VBox(
Heading(_("The system is already registered.")),
VSpacing(2),
# button label
PushButton(Id(:register), _("Register Again")),
VSpacing(1),
PushButton(Id(:register), _("Register Again"))
# button label
PushButton(Id(:extensions), _("Select Extensions"))
)
end

Expand All @@ -682,7 +685,7 @@ def display_registered_dialog

Wizard.SetNextButton(:next, Label.FinishButton) if Mode.normal

continue_buttons = [:next, :back, :cancel, :abort, :register]
continue_buttons = [:next, :back, :cancel, :abort, :register, :extensions]

ret = nil
while !continue_buttons.include?(ret) do
Expand Down Expand Up @@ -723,11 +726,12 @@ def start_workflow
sequence = {
"ws_start" => "check",
"check" => {
:auto => :auto,
:abort => :abort,
:cancel => :abort,
:register => "register",
:next => :next
:auto => :auto,
:abort => :abort,
:cancel => :abort,
:register => "register",
:extensions => "select_addons",
:next => :next
},
"register" => {
:abort => :abort,
Expand Down Expand Up @@ -755,8 +759,10 @@ def start_workflow
end

def init_registration
url = ::Registration::Helpers.registration_url
@registration = ::Registration::Registration.new(url)
if !@registration
url = ::Registration::Helpers.registration_url
@registration = ::Registration::Registration.new(url)
end
end

# helper method for accessing the registered addons
Expand Down
4 changes: 2 additions & 2 deletions src/clients/scc_auto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ def refresh_widget_state
def configure_registration
caption = _("Product Registration")
help_text = "<p><b>#{caption}</b></p>"
help_text << _(
help_text += _(
"<p>Product registration includes your product in SUSE Customer Center database,\n"+
"enabling you to get online updates and technical support.\n"+
"To register while installing automatically, select <b>Run Product Registration</b>.</p>"
)
help_text << _(
help_text += _(
"<p>If your network deploys a custom registration server, set the correct URL of the server\n" +
"and the location of the SMT certificate in <b>SMT Server Settings</b>. Refer\n" +
"to your SMT manual for further assistance.</p>"
Expand Down
4 changes: 2 additions & 2 deletions src/lib/registration/registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def register_product(product)

def get_addon_list
# extensions for base product
base_product = ::Registration::Storage::BaseProduct.instance.product
base_product = ::Registration::SwMgmt.find_base_product
params = connect_params(:product_ident => {:name => base_product["name"]})

log.info "Reading available addons for product: #{base_product["name"]}"
Expand All @@ -110,7 +110,7 @@ def connect_params(params)
:verify_callback => lambda do |verify_ok, context|
# we cannot raise an exception with details here (all exceptions in
# verify_callback are caught and ignored), we need to store the error
# details is a global instance
# details in a global instance
if !verify_ok
log.error "SSL verification failed: #{context.error}: #{context.error_string}"
Storage::SSLErrors.instance.ssl_error_code = context.error
Expand Down
5 changes: 0 additions & 5 deletions src/lib/registration/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ class RegCodes < Struct.new(:reg_codes)
include Singleton
end

# remember the registered base product
class BaseProduct < Struct.new(:product)
include Singleton
end

# remember the values entered by user
class InstallationOptions
include Singleton
Expand Down

0 comments on commit d2965ca

Please sign in to comment.