diff --git a/.rubocop.yml b/.rubocop.yml index c8b52025..264c849a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ # use the shared Yast defaults inherit_from: - /usr/share/YaST2/data/devtools/data/rubocop-0.71.0_yast_style.yml + /usr/share/YaST2/data/devtools/data/rubocop-1.24.1_yast_style.yml # Offense count: 82 Metrics/AbcSize: @@ -21,7 +21,7 @@ Metrics/CyclomaticComplexity: # Offense count: 152 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes. # URISchemes: http, https -Metrics/LineLength: +Layout/LineLength: Max: 110 # Offense count: 117 diff --git a/src/clients/dasd_proposal.rb b/src/clients/dasd_proposal.rb index e8a9f2d2..6f7df67b 100644 --- a/src/clients/dasd_proposal.rb +++ b/src/clients/dasd_proposal.rb @@ -40,7 +40,8 @@ def main @ret = {} # Make proposal for installation/configuration... - if @func == "MakeProposal" + case @func + when "MakeProposal" @summary = DASDController.Summary if Builtins.isempty(@summary) # text for installation summary @@ -53,7 +54,7 @@ def main "warning_level" => nil } # Run an interactive workflow - elsif @func == "AskUser" + when "AskUser" Wizard.CreateDialog storage = Y2Storage::StorageManager.instance # Deactivate high level devices (RAID, multipath, LVM, encryption...) @@ -68,7 +69,7 @@ def main # Fill return map @ret = { "workflow_sequence" => @sequence } # Return human readable titles for the proposal - elsif @func == "Description" + when "Description" return nil if !DASDController.IsAvailable # Fill return map @@ -82,7 +83,7 @@ def main ), "id" => "dasd" } - elsif @func == "Write" + when "Write" DASDController.Write end diff --git a/src/clients/s390-disk-controller.rb b/src/clients/s390-disk-controller.rb index 093195ca..95b6f4d2 100644 --- a/src/clients/s390-disk-controller.rb +++ b/src/clients/s390-disk-controller.rb @@ -113,10 +113,11 @@ def main @ret = nil while @ret.nil? @ret = UI.UserInput - if @ret == :dasd + case @ret + when :dasd WFM.call("dasd") @ret = nil - elsif @ret == :zfcp + when :zfcp WFM.call("zfcp") @ret = nil end diff --git a/src/clients/zfcp_proposal.rb b/src/clients/zfcp_proposal.rb index d73fec3c..7745462b 100644 --- a/src/clients/zfcp_proposal.rb +++ b/src/clients/zfcp_proposal.rb @@ -40,7 +40,8 @@ def main @ret = {} # Make proposal for installation/configuration... - if @func == "MakeProposal" + case @func + when "MakeProposal" @summary = ZFCPController.Summary if Builtins.isempty(@summary) # text for installation summary @@ -53,7 +54,7 @@ def main "warning_level" => nil } # Run an interactive workflow - elsif @func == "AskUser" + when "AskUser" Wizard.CreateDialog storage = Y2Storage::StorageManager.instance # Deactivate high level devices (RAID, multipath, LVM, encryption...) @@ -68,7 +69,7 @@ def main # Fill return map @ret = { "workflow_sequence" => @sequence } # Return human readable titles for the proposal - elsif @func == "Description" + when "Description" return nil if !ZFCPController.IsAvailable # Fill return map @@ -82,7 +83,7 @@ def main ), "id" => "zfcp" } - elsif @func == "Write" + when "Write" ZFCPController.Write end diff --git a/src/include/s390/dasd/dialogs.rb b/src/include/s390/dasd/dialogs.rb index 8529511e..6964cc43 100644 --- a/src/include/s390/dasd/dialogs.rb +++ b/src/include/s390/dasd/dialogs.rb @@ -101,29 +101,29 @@ def GetDASDDiskItems end def PossibleActions - if !Mode.config + if Mode.config [ - # menu button id - Item(Id(:activate), _("&Activate")), - # menu button id - Item(Id(:deactivate), _("&Deactivate")), # menu button id Item(Id(:diag_on), _("Set DIAG O&n")), # menu button id Item(Id(:diag_off), _("Set DIAG O&ff")), # menu button id - Item(Id(:format), _("&Format")) + Item(Id(:format_on), _("Set Format On")), + # menu button id + Item(Id(:format_off), _("Set Format Off")) ] else [ + # menu button id + Item(Id(:activate), _("&Activate")), + # menu button id + Item(Id(:deactivate), _("&Deactivate")), # menu button id Item(Id(:diag_on), _("Set DIAG O&n")), # menu button id Item(Id(:diag_off), _("Set DIAG O&ff")), # menu button id - Item(Id(:format_on), _("Set Format On")), - # menu button id - Item(Id(:format_off), _("Set Format Off")) + Item(Id(:format), _("&Format")) ] end end @@ -148,7 +148,7 @@ def run(action, selected) Object.const_get(action_class_for(action)).run(selected) rescue NameError => e log.error("No action for #{action}: #{e}") - return false + false end end @@ -383,7 +383,8 @@ def AddDASDDiskDialog while ret.nil? ret = Convert.to_symbol(UI.UserInput) - if ret == :abort || ret == :cancel + case ret + when :abort, :cancel # yes-no popup if !Popup.YesNo( _( @@ -392,7 +393,7 @@ def AddDASDDiskDialog ) ret = nil end - elsif ret == :next + when :next channel = Convert.to_string(UI.QueryWidget(Id(:channel), :Value)) if !DASDController.IsValidChannel(channel) diff --git a/src/include/s390/dasd/helps.rb b/src/include/s390/dasd/helps.rb index 53614601..fffd95f0 100644 --- a/src/include/s390/dasd/helps.rb +++ b/src/include/s390/dasd/helps.rb @@ -37,7 +37,7 @@ def initialize_s390_dasd_helps(_include_target) # Read dialog help 2/2 _( "
Aborting Initialization:
\nSafely abort the " \
- "configuration utility by pressing Abort now.
Aborting Saving:
\n" \
- "Abort the save procedure by pressing Abort.\n" \
- "An additional dialog will inform you whether it is safe to do so.
Configured DASD Disks
\nIn this dialog, manage DASD " \
- "disks on your system.
To filter the displayed disks, set the Minimum Channel ID and \n" \ - "the Maximum Channel ID and click Filter.
\n" + "the Maximum Channel ID and click Filter.\n" ) + # Disk selection dialog help 4/4 _("To configure a new DASD disk, click Add.
") + @@ -68,29 +68,29 @@ def initialize_s390_dasd_helps(_include_target) # Disk selection dialog help 1/4 "disk_selection" => _( "Configured DASD Disks
\nIn this dialog, manage DASD disks " \
- "on your system.
To filter the displayed disks, set the Minimum Channel ID and \n" \ - "the Maximum Channel ID and click Filter.
\n" + "the Maximum Channel ID and click Filter.\n" ) + # Disk selection dialog help 3/4 _( "To perform actions on multiple disks at once, mark these disks. To select " \ - "all displayed disk (possibly after applying a filter), click\nSelect All " \ - "or Deselect All.
\n" + "all displayed disk (possibly after applying a filter), click\nSelect All " \ + "or Deselect All.\n" ) + # Disk selection dialog help 4/4 _( "To perform an action on the selected disks, use Perform Action.\n" \ - "The action will be performed immediately!
" + "The action will be performed immediately!" ), # Disk add help 1/3 "disk_add_config" => _( "Add New DASD Disk
\n" \
- "To add a disk, enter the Channel ID of the DASD disk as\n" \
- "identifier.
dumpdevice after a disk indicates that it is a usable dump\ndevice. " \ - "Multi-volume dump devices are indicated by a list of DASD IDs.
" + "Multi-volume dump devices are indicated by a list of DASD IDs." ) + # Dump dialog help 7/8 _("ZFCP columns: Device, Size, ID, WWPN, LUN, Dump
") +
@@ -169,10 +169,10 @@ def DumpDialog
Builtins.foreach(selected_items) do |device_line|
entries = Builtins.splitstring(device_line, "\t")
# prevent leading space
- device = if device != ""
- Ops.add(Ops.add(device, " "), Ops.get(entries, 0, ""))
- else
+ device = if device == ""
Ops.get(entries, 0, "")
+ else
+ Ops.add(Ops.add(device, " "), Ops.get(entries, 0, ""))
end
end
end
@@ -185,7 +185,7 @@ def DumpDialog
Builtins.sformat(
_(
"The disk %1 will be formatted as a dump device. All data on " \
- "this device will be lost! Continue?"
+ "this device will be lost! Continue?"
),
device
)
diff --git a/src/include/s390/iucvterminal-server/helps.rb b/src/include/s390/iucvterminal-server/helps.rb
index f180c5e9..fe38a6de 100644
--- a/src/include/s390/iucvterminal-server/helps.rb
+++ b/src/include/s390/iucvterminal-server/helps.rb
@@ -36,7 +36,7 @@ def initialize_s390_iucvterminal_server_helps(_include_target)
) +
_(
"
To configure the IUCV terminal server, specify the z/VM IDs to be used.\n
" \
- "They are separated by line breaks.
TS-Shell allows to specify Authorization for every TS-Shell user and group. " \ - "The rights of a group are inherited by its members.
" + "The rights of a group are inherited by its members." ) + # TS-Shell dialog help 2/5 _( "Each allowed z/VM ID can be selected manually under Selection, defined by " \ - "a Regex or loaded from a File which contains all allowed z/VM IDs " \ - "separated by line breaks.
" + "a Regex or loaded from a File which contains all allowed z/VM IDs " \ + "separated by line breaks." ) + # TS-Shell dialog help 3/5 _( "Click on New User to create new TS-Shell users or Delete\nUser " \ - "to remove users.
" + "to remove users." ) + # TS-Shell dialog help 4/5 _( "To add or remove groups from the TS-Shell authorization table or to change\n" \ - "the membership of users, go to Manage Groups.
" + "the membership of users, go to Manage Groups." ) + # TS-Shell dialog help 5/5 _( @@ -72,8 +72,8 @@ def initialize_s390_iucvterminal_server_helps(_include_target) ) + _( "To create new TS-Shell user the Username, Home Directory and " \
- "Password has to be provided.\n\t
It is also possible to specify " \
- "Additional Groups by selecting them on the right.
You can specify the same home directory for every TS-Shell user since no\n" \ - "data will be stored there.
" + "data will be stored there." ), # TS-Shell Managing Groups dialog help 1/5 "ts-group" => _( @@ -91,13 +91,13 @@ def initialize_s390_iucvterminal_server_helps(_include_target) ) + _( "Define TS-Shell authorizations per group if you want every TS-Shell \n" \ - "member of this groups to inherit the same rights.
" + "member of this groups to inherit the same rights." ) + # TS-Shell Managing Groups dialog help 2/5 _( "Existing groups can be added to or removed from the TS-Shell\n" \ - "authorization. Select the groups in the table and click on Select or Deselect. " \ - "The current status is shown in the column TS-Auth.
" + "authorization. Select the groups in the table and click on Select or Deselect. " \ + "The current status is shown in the column TS-Auth." ) + # TS-Shell Managing Groups dialog help 3/5 _( @@ -106,8 +106,8 @@ def initialize_s390_iucvterminal_server_helps(_include_target) # TS-Shell Managing Groups dialog help 4/5 _( "New groups could be created by entering the name in the New Group input field " \
- "and confirming with Create.\n\t
To delete previously created groups the " \
- "YaST users dialog has to be used.
IUCVConn on Login needs one user for every z/VM ID. To create these users " \ - "a password and home directory has to be provided." + "a password and home directory has to be provided." ) + # IUCVConn on Login dialog help 2/2 _( "
It is possible to sync the users manually by clicking on Sync or just " \ - "confirming the changes with Ok while IUCVConn on Login is enabled.
" + "confirming the changes with Ok while IUCVConn on Login is enabled. " ) } # EOF diff --git a/src/include/s390/iucvterminal-server/ui.rb b/src/include/s390/iucvterminal-server/ui.rb index 124153cd..95795389 100644 --- a/src/include/s390/iucvterminal-server/ui.rb +++ b/src/include/s390/iucvterminal-server/ui.rb @@ -577,9 +577,10 @@ def TsGroupDialogContent def MainDialogContent # draw active tab - widgets = if @current_main_tab == :t_zvmids + widgets = case @current_main_tab + when :t_zvmids ZvmIdsDialogContent() - elsif @current_main_tab == :t_tsshell + when :t_tsshell TsShellDialogContent() else IucvConnDialogContent() @@ -605,13 +606,14 @@ def MainDialogContent def InitMainDialog(tab) # remember current tab @current_main_tab = tab - if tab == :t_zvmids + case tab + when :t_zvmids UI.ChangeWidget( Id(:zvmids), :Value, Builtins.mergestring(@zvm_id_list, "\n") ) - elsif tab == :t_tsshell + when :t_tsshell # disable frames if TS-Shell is disabled HandleEvent(:ts_enabled) @@ -734,7 +736,10 @@ def CommitTsUserDialogSettings groupmap, force_pw_change ) - if new_uid != "" + if new_uid == "" + Popup.Notify(_("Adding the user has failed.")) + ret = false + else @ts_member_conf = Builtins.add( @ts_member_conf, username, @@ -743,9 +748,6 @@ def CommitTsUserDialogSettings rb_ts_regex: "", rb_ts_file: "" ) - else - Popup.Notify(_("Adding the user has failed.")) - ret = false end end ret @@ -969,9 +971,9 @@ def CheckPassword(field1, field2) pw1 = Convert.to_string(UI.QueryWidget(Id(field1), :Value)) if pw1 != "" && pw1 == Convert.to_string(UI.QueryWidget(Id(field2), :Value)) - return pw1 + pw1 else - return "" + "" end end @@ -990,7 +992,7 @@ def IsValidZvmIdList line = Ops.add(line, 1) # since alnum allows umlauts too the id is checked against the user name specification if Builtins.regexpmatch(zvmid, "[^[:alnum:]]") || - !IUCVTerminalServer.CheckUserGroupName(zvmid) && zvmid != "" + (!IUCVTerminalServer.CheckUserGroupName(zvmid) && zvmid != "") Popup.Notify( Builtins.sformat( _( @@ -1050,24 +1052,22 @@ def SyncIucvConnUsers ret = false # check if the ic users list is different since the start - if @zvm_id_list != IUCVTerminalServer.GetIcUsersList + if @zvm_id_list == IUCVTerminalServer.GetIcUsersList + ret = true + elsif @ic_password == "" # check password - if @ic_password == "" - Popup.Notify( + Popup.Notify( _( "A correctly entered password to sync IUCVConn users is required." ) ) # check home directory - elsif !Builtins.regexpmatch(@ic_home, "^/") - Popup.Notify(_("The specified IUCVConn home directory is invalid.")) - else - IUCVTerminalServer.ic_home = @ic_home - IUCVTerminalServer.SyncIucvConnUsers(@zvm_id_list, @ic_password) - UI.ChangeWidget(Id(:ic_users), :Items, GenerateIcUsersTable()) - ret = true - end + elsif !Builtins.regexpmatch(@ic_home, "^/") + Popup.Notify(_("The specified IUCVConn home directory is invalid.")) else + IUCVTerminalServer.ic_home = @ic_home + IUCVTerminalServer.SyncIucvConnUsers(@zvm_id_list, @ic_password) + UI.ChangeWidget(Id(:ic_users), :Items, GenerateIcUsersTable()) ret = true end ret @@ -1444,19 +1444,21 @@ def HandleEvent(widget) end # tab handling - if widget == :t_zvmids + case widget + when :t_zvmids # SaveSettings( $[ "ID" : widget ] ); UI.ReplaceWidget(Id(:tab_content), ZvmIdsDialogContent()) InitMainDialog(widget) Wizard.SetHelpText(Ops.get_string(@HELP, "zvmids", "")) - elsif widget == :t_tsshell || widget == :t_iucvconn + when :t_tsshell, :t_iucvconn # deactivate other tabs without valid z/VM ids if Ops.greater_than(Builtins.size(@zvm_id_list), 0) - if widget == :t_tsshell + case widget + when :t_tsshell UI.ReplaceWidget(Id(:tab_content), TsShellDialogContent()) InitMainDialog(widget) Wizard.SetHelpText(Ops.get_string(@HELP, "ts", "")) - elsif widget == :t_iucvconn + when :t_iucvconn UI.ReplaceWidget(Id(:tab_content), IucvConnDialogContent()) InitMainDialog(widget) Wizard.SetHelpText(Ops.get_string(@HELP, "ic", "")) @@ -1506,10 +1508,11 @@ def IUCVTerminalServerDialog ret = :again success = true # check TS-Shell user dialog settings and commit them if valid - if @current_dialog == :ts_open_user_dialog + case @current_dialog + when :ts_open_user_dialog success = CommitTsUserDialogSettings() # commit TS-Shell group dialog settings - elsif @current_dialog == :ts_open_group_dialog + when :ts_open_group_dialog CommitTsGroupDialogSettings() end diff --git a/src/include/s390/iucvterminal/ui.rb b/src/include/s390/iucvterminal/ui.rb index 29665741..4afaa371 100644 --- a/src/include/s390/iucvterminal/ui.rb +++ b/src/include/s390/iucvterminal/ui.rb @@ -48,15 +48,16 @@ def IsValidTerminalSrvList ret = false restrict_hvc_to_srvs = UI.QueryWidget(Id(:restrict_hvc_to_srvs), :Value) - if restrict_hvc_to_srvs =~ /[^[[:lower:]][[:digit:]],]/ + case restrict_hvc_to_srvs + when /[^[[:lower:]][[:digit:]],]/ Popup.Notify( _( "Wrong input, only lower case letters, numbers and for separation commas are allowed." ) ) - elsif restrict_hvc_to_srvs =~ /^,|,,/ + when /^,|,,/ Popup.Notify(_("Comma is only a separator.")) - elsif restrict_hvc_to_srvs =~ /[[[:lower:]][[:digit:]]]{9,}/ + when /[[[:lower:]][[:digit:]]]{9,}/ Popup.Notify(_("z/VM IDs do not allow more than eight characters.")) else ret = true @@ -122,20 +123,20 @@ def TerminalDialog # IUCVTerminal dialog help 3/11 _( "Several IUCVtty instances can run to provide multiple terminal devices. " \
- "The instances are distinguished by a terminal ID, which is a combination of " \
- "the Terminal ID Prefix and the number of the instance.
"
+ "The instances are distinguished by a terminal ID, which is a combination of " \
+ "the Terminal ID Prefix and the number of the instance.
"
) +
# IUCVTerminal dialog help 4/11
_(
"For example, if you define ten instances with the prefix "lxterm", " \
- "the terminal IDs from lxterm0 to lxterm9 are available.
" + # IUCVTerminal dialog help 5/11 _("
HVC
") + # IUCVTerminal dialog help 6/11 _( "The z/VM IUCV HVC device driver is a kernel module and uses device nodes to " \ - "enable up to eight HVC terminal devices to communicate with getty and login programs.
" + "enable up to eight HVC terminal devices to communicate with getty and login programs." ) + # IUCVTerminal dialog help 7/11 _( @@ -148,17 +149,17 @@ def TerminalDialog # IUCVTerminal dialog help 9/11 _( "Activate route kernel messages to hvc0 to route kernel messages to\n" \
- "the hvc0 device instead of ttyS0.
"
+ "the hvc0 device instead of ttyS0.
"
) +
# IUCVTerminal dialog help 10/11
_(
"Should kernel messages still be shown on ttyS0, manually add console=ttyS0 " \
- "to the current boot selection kernel parameter in the YaST bootloader module.
The Dumpconf daemon needs to be enabled to influence the behavior " \ - "during kernel panics.
" + "during kernel panics." ) + # OnPanic dialog help 3/11 _("The following Panic Actions are possible:
") +
@@ -128,26 +128,26 @@ def OnPanicDialog
# OnPanic dialog help 7/11
_(
"dump_reipl Dump Linux and reboot system. This option is only " \
- "available\non LPAR with z9(r) machines and later and on z/VMversion 5.3 and later.
"
+ "available\non LPAR with z9(r) machines and later and on z/VMversion 5.3 and later.
"
) +
# OnPanic dialog help 8/11
_("vmcmd Execute specified CP commands and stop system.
The time defined in Delay Minutes defers activating the specified " \ - "panic action for a newly started system to prevent loops. If the system " \ - "crashes before the time has elapsed the default action (stop) is performed.
" + "panic action for a newly started system to prevent loops. If the system " \ + "crashes before the time has elapsed the default action (stop) is performed." ) + # OnPanic dialog help 10/11 _( "The device for dumping the memory can be set with Dump Device. If no " \ - "device is shown you have to create one with the YaST Dump Devices dialog.
" + "device is shown you have to create one with the YaST Dump Devices dialog." ), # OnPanic dialog help 11/11 Builtins.sformat( _( "With VMCMD specify CP commands to be executed before the Linux " \ - "system is stopped. Only %1 lines and a total of %2 chars are allowed.
" + "system is stopped. Only %1 lines and a total of %2 chars are allowed." ), OnPanic.VMCMD_MAX_ROWS, OnPanic.VMCMD_MAX_CHARS @@ -317,17 +317,15 @@ def OnPanicDialog # because it conflicts with OnPanic def check_kdump if OnPanic.start && - (Service.Enabled(KDUMP_SERVICE_NAME) || Service.Active(KDUMP_SERVICE_NAME)) - if Yast::Popup.YesNo( + (Service.Enabled(KDUMP_SERVICE_NAME) || Service.Active(KDUMP_SERVICE_NAME)) && Yast::Popup.YesNo( # TRANSLATORS: %{s1},%{s2} are the service names format(_( "The service %{s1} is active and will conflict with dumpconf.\n" \ "Would you like to disable %{s2}? \n" ), s1: KDUMP_SERVICE_NAME, s2: KDUMP_SERVICE_NAME) ) - Service.Disable(KDUMP_SERVICE_NAME) - Service.Stop(KDUMP_SERVICE_NAME) if Service.active?(KDUMP_SERVICE_NAME) - end + Service.Disable(KDUMP_SERVICE_NAME) + Service.Stop(KDUMP_SERVICE_NAME) if Service.active?(KDUMP_SERVICE_NAME) end end diff --git a/src/include/s390/xpram/ui.rb b/src/include/s390/xpram/ui.rb index 89571f9f..1a02445d 100644 --- a/src/include/s390/xpram/ui.rb +++ b/src/include/s390/xpram/ui.rb @@ -50,9 +50,9 @@ def XpRAMDialog # help text for XPRAM 2/4 _( "This tool currently only supports assigning the entire XPRAM to one partition. " \ - "To have multiple partitions, look at \"Device Drivers, Features and Commands " \ - "November 30, 2004\" for the Linux kernel 2.6 - April 2004 stream.
" \ - "In this case disable XPRAM in this module.
" + "To have multiple partitions, look at \"Device Drivers, Features and Commands " \ + "November 30, 2004\" for the Linux kernel 2.6 - April 2004 stream." \ + "In this case disable XPRAM in this module.
" ) + # help text for XPRAM 3/4 _("Choose the correct mount point for Mount Point.
") + diff --git a/src/include/s390/zfcp/dialogs.rb b/src/include/s390/zfcp/dialogs.rb index 0825c601..15ed7a13 100644 --- a/src/include/s390/zfcp/dialogs.rb +++ b/src/include/s390/zfcp/dialogs.rb @@ -199,7 +199,8 @@ def ZFCPDialog while ret.nil? ret = Convert.to_symbol(UI.UserInput) - if ret == :filter + case ret + when :filter filter_min = Convert.to_string(UI.QueryWidget(:min_chan, :Value)) filter_max = Convert.to_string(UI.QueryWidget(:max_chan, :Value)) @@ -217,10 +218,10 @@ def ZFCPDialog ReloadZFCPDialog() ret = nil next - elsif ret == :table + when :table ret = nil next - elsif ret == :abort || ret == :cancel + when :abort, :cancel # yes-no popup if !Popup.YesNo( _( @@ -326,7 +327,8 @@ def AddZFCPDiskDialog while ret.nil? ret = Convert.to_symbol(UI.UserInput) - if ret == :get_wwpn + case ret + when :get_wwpn channel = Convert.to_string(UI.QueryWidget(:channel, :Value)) if !ZFCPController.IsValidChannel(channel) @@ -342,7 +344,7 @@ def AddZFCPDiskDialog wwpns = ZFCPController.GetWWPNs(channel) UI.ChangeWidget(:wwpn, :Items, wwpns) ret = nil - elsif ret == :get_lun + when :get_lun channel = Convert.to_string(UI.QueryWidget(:channel, :Value)) wwpn = Convert.to_string(UI.QueryWidget(:wwpn, :Value)) @@ -368,7 +370,7 @@ def AddZFCPDiskDialog luns = ZFCPController.GetLUNs(channel, wwpn) UI.ChangeWidget(:lun, :Items, luns) ret = nil - elsif ret == :abort || ret == :cancel + when :abort, :cancel # yes-no popup if !Popup.YesNo( _( @@ -377,7 +379,7 @@ def AddZFCPDiskDialog ) ret = nil end - elsif ret == :next + when :next channel = Convert.to_string(UI.QueryWidget(Id(:channel), :Value)) wwpn = Convert.to_string(UI.QueryWidget(Id(:wwpn), :Value)) lun = Convert.to_string(UI.QueryWidget(Id(:lun), :Value)) diff --git a/src/include/s390/zfcp/helps.rb b/src/include/s390/zfcp/helps.rb index e53b4d8a..b37b5c44 100644 --- a/src/include/s390/zfcp/helps.rb +++ b/src/include/s390/zfcp/helps.rb @@ -37,7 +37,7 @@ def initialize_s390_zfcp_helps(_include_target) # Read dialog help 2/2 _( "Aborting Initialization:
\nSafely abort " \
- "the configuration utility by pressing Abort now.
Aborting Saving:
\n" \
- "Abort the save procedure by pressing Abort.\n" \
- "An additional dialog will inform you whether it is safe to do so.
When accessing a ZFCP device\n" \ - "READ/WRITE, make sure that this access is exclusive.\n" \ - "Otherwise there is a potential risk of data corruption.
" + "READ/WRITE, make sure that this access is exclusive.\n" \ + "Otherwise there is a potential risk of data corruption." ), # Disk add help 1/2 "disk_add" => _( "Add New ZFCP Device
\n" \
- "Enter the identifier of the device to add, the\n" \
- "Channel ID of the ZFCP controller, the worldwide port number\n" \
- "(WWPN) and the LUN number.
The Channel ID must be entered with lowercase letters in a sysfs conforming\n" \ - "format 0.0.<devno>, such as 0.0.5c51.
\n" \ - "The WWPN must be entered with lowercase letters as a 16-digit hex value, such as\n" \ - "0x5005076300c40e5a.
\n" \ - "The LUN must be entered with lowercase letters as a 16-digit hex value with\n" \ - "all trailing zeros, such as 0x52ca000000000000.
" \ - "If no WWPN and no LUN have been defined the system is " \ - "trying to use auto LUN scan. Auto LUN scan can be turned off using " \ - "the kernel parameter allow_lun_scan=0.
" + "format 0.0.<devno>, such as 0.0.5c51.\n" \ + "The WWPN must be entered with lowercase letters as a 16-digit hex value, such as\n" \ + "0x5005076300c40e5a.
\n" \ + "The LUN must be entered with lowercase letters as a 16-digit hex value with\n" \ + "all trailing zeros, such as 0x52ca000000000000.
" \ + "If no WWPN and no LUN have been defined the system is " \ + "trying to use auto LUN scan. Auto LUN scan can be turned off using " \ + "the kernel parameter allow_lun_scan=0.
" ) + # Disk selection dialog Warning _("When accessing a ZFCP device\n" \ - "READ/WRITE, make sure that this access is exclusive.\n" \ - "Otherwise there is a potential risk of data corruption.
" + "READ/WRITE, make sure that this access is exclusive.\n" \ + "Otherwise there is a potential risk of data corruption." ) } end diff --git a/src/lib/y2s390/dasd.rb b/src/lib/y2s390/dasd.rb index 04eba92f..061dcfc4 100644 --- a/src/lib/y2s390/dasd.rb +++ b/src/lib/y2s390/dasd.rb @@ -138,9 +138,9 @@ def partition_info return out if out.empty? regexp = Regexp.new("^[ \t]*([^ \t]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)" \ - "[ \t]+([^ \t]+)[ \t]+([^ \t]+([ \t]+[^ \t]+))*[ \t]*$") + "[ \t]+([^ \t]+)[ \t]+([^ \t]+([ \t]+[^ \t]+))*[ \t]*$") - lines = out.split("\n").select { |s| s.match?(regexp) } + lines = out.split("\n").grep(regexp) lines.map do |line| r = line.match(regexp) "#{r[1]} (#{r[6]})" diff --git a/src/lib/y2s390/dasd_actions/format.rb b/src/lib/y2s390/dasd_actions/format.rb index 61db742a..cf79aeed 100644 --- a/src/lib/y2s390/dasd_actions/format.rb +++ b/src/lib/y2s390/dasd_actions/format.rb @@ -92,8 +92,8 @@ def really_format? format( _( "Formatting these disks destroys all data on them.