Skip to content

Commit

Permalink
merged with master
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed May 27, 2016
2 parents bf7717a + ec69349 commit e14c0d1
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 16 deletions.
21 changes: 20 additions & 1 deletion package/yast2-installation.changes
@@ -1,8 +1,27 @@
-------------------------------------------------------------------
Wed May 25 13:48:05 CEST 2016 - schubi@suse.de
Wed May 27 13:48:05 CEST 2016 - schubi@suse.de

- AutoYaST support for ssh_import module.
Fate#319624
- 3.1.190

-------------------------------------------------------------------
Thu May 26 13:17:42 UTC 2016 - kanderssen@suse.com

- System Role: centered dialog (ncurses).

-------------------------------------------------------------------
Wed May 25 15:49:41 UTC 2016 - kanderssen@suse.com

- More visual improvements in the SSH keys importing proposal
summary based on blog entry feedback. (Fate#319624)
- 3.1.189

-------------------------------------------------------------------
Wed May 25 13:07:59 UTC 2016 - lslezak@suse.cz

- Start the Ruby debugger at the beginning of installation
when Y2DEBUGGER is set (FATE#318421)
- 3.1.188

-------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions package/yast2-installation.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-installation
Version: 3.1.188
Version: 3.1.190
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -26,7 +26,8 @@ Source0: %{name}-%{version}.tar.bz2
Group: System/YaST
License: GPL-2.0
Url: http://github.com/yast/yast-installation
Requires: yast2-ruby-bindings >= 3.1.8
# yast/debugger
Requires: yast2-ruby-bindings >= 3.1.47

Summary: YaST2 - Installation Parts

Expand Down
6 changes: 6 additions & 0 deletions src/lib/installation/clients/inst_pre_install.rb
Expand Up @@ -94,6 +94,12 @@ def main
read_ssh_info(device, mount_point)
end

# The ssh_import proposal doesn't make sense if there is no
# configuration to import from.
if ::Installation::SshImporter.instance.configurations.empty?
ProductControl.DisableSubProposal("inst_initial", "ssh_import")
end

# free the memory
@useful_partitions = nil

Expand Down
24 changes: 24 additions & 0 deletions src/lib/installation/clients/installation.rb
Expand Up @@ -30,19 +30,26 @@
# $Id$
module Yast
class InstallationClient < Client
include Yast::Logger

def main
textdomain "installation"

Yast.import "Wizard"
Yast.import "Stage"
Yast.import "Report"
Yast.import "Hooks"
Yast.import "Linuxrc"

Hooks.search_path.join!("installation")

# Initialize the UI
UI.SetProductLogo(true)
Wizard.OpenLeftTitleNextBackDialog

# start the debugger if requested (FATE#318421)
start_debugger

Wizard.SetContents(
# title
"",
Expand Down Expand Up @@ -97,5 +104,22 @@ def main

deep_copy(@ret)
end

private

# start the Ruby debugger if booted with the Y2DEBUGGER option
def start_debugger
return unless (Linuxrc.InstallInf("Cmdline") || "").match(/\bY2DEBUGGER=(.*)\b/i)

option = Regexp.last_match[1]
log.info "Y2DEBUGGER option: #{option}"

if option == "1" || option == "remote" || option == "manual"
require "yast/debugger"
Debugger.start(remote: option == "remote", start_client: option != "manual")
else
log.warn "Unknown Y2DEBUGGER value: #{option}"
end
end
end
end
31 changes: 22 additions & 9 deletions src/lib/installation/dialogs/ssh_import.rb
Expand Up @@ -34,7 +34,7 @@ def initialize
# Event callback for the 'ok' button
def next_handler
partition = UI.QueryWidget(Id(:device), :Value)
partition = nil if partition == :none
partition = nil unless UI.QueryWidget(Id(:import_ssh_key), :Value)
copy_config = UI.QueryWidget(Id(:copy_config), :Value)
log.info "SshImportDialog partition => #{partition} copy_config => #{copy_config}"
importer.device = partition
Expand Down Expand Up @@ -63,10 +63,25 @@ def copy_config
def dialog_content
HSquash(
VBox(
Left(Label(_("System to Import SSH Host Keys from"))),
partitions_list_widget,
VSpacing(1),
Left(copy_config_widget)
CheckBoxFrame(
Id(:import_ssh_key),
_("I would like to import SSH keys from a previous installation"),
true,
VBox(
HStretch(),
VSpacing(1),
HBox(
HSpacing(2),
partitions_list_widget
),
VSpacing(3),
HBox(
HSpacing(2),
Left(copy_config_widget)
)
)
),
HStretch()
)
)
end
Expand All @@ -82,7 +97,7 @@ def help_text
"thus the identity- of its SSH server. The key files found in /etc/ssh " \
"(one pair of files per host key) will be copied to the new system " \
"being installed.</p>" \
"<p>Check <b>Copy Whole SSH Configuration</b> to also copy other files " \
"<p>Check <b>Import SSH Configuration</b> to also copy other files " \
"found in /etc/ssh, in addition to the keys.</p>"
)
end
Expand All @@ -96,8 +111,6 @@ def partitions_list_widget
RadioButtonGroup(
Id(:device),
VBox(
# TRANSLATORS: option to select no partition for SSH keys import
Left(RadioButton(Id(:none), _("None"), device.nil?)),
*part_widgets
)
)
Expand All @@ -112,7 +125,7 @@ def partition_widget(dev, partition)
end

def copy_config_widget
CheckBox(Id(:copy_config), _("Copy Whole SSH Configuration"), copy_config)
CheckBox(Id(:copy_config), _("Import SSH Configuration"), copy_config)
end
end
end
10 changes: 6 additions & 4 deletions src/lib/installation/select_system_role.rb
Expand Up @@ -53,10 +53,12 @@ def help_text
end

def dialog_content
VBox(
Left(Label(Yast::ProductControl.GetTranslatedText("roles_text"))),
VSpacing(2),
role_buttons
HSquash(
VBox(
Left(Label(Yast::ProductControl.GetTranslatedText("roles_text"))),
VSpacing(2),
role_buttons
)
)
end

Expand Down

0 comments on commit e14c0d1

Please sign in to comment.