[yast-commit] r67603 - in /trunk/s390/src: modules/ZFCPController.ycp zfcp/dialogs.ycp
Author: aschnell Date: Thu Mar 8 16:08:25 2012 New Revision: 67603 URL: http://svn.opensuse.org/viewcvs/yast?rev=67603&view=rev Log: - cleanup Modified: trunk/s390/src/modules/ZFCPController.ycp trunk/s390/src/zfcp/dialogs.ycp Modified: trunk/s390/src/modules/ZFCPController.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/modules/ZFCPController.y... ============================================================================== --- trunk/s390/src/modules/ZFCPController.ycp (original) +++ trunk/s390/src/modules/ZFCPController.ycp Thu Mar 8 16:08:25 2012 @@ -103,27 +103,27 @@ return tohexstring(tointeger(wwpn), 16); } - global boolean IsValidFCPLUN(string fcp_lun) + global boolean IsValidLUN(string lun) { string regexp = "^0x([[:xdigit:]]{1,16})$"; - return regexpmatch(fcp_lun, regexp); + return regexpmatch(lun, regexp); } - global string FormatFCPLUN(string fcp_lun) + global string FormatLUN(string lun) { - if (!IsValidFCPLUN(fcp_lun)) - return fcp_lun; + if (!IsValidLUN(lun)) + return lun; - return tohexstring(tointeger(fcp_lun), 16); + return tohexstring(tointeger(lun), 16); } - global string GetNextLUN(string fcp_lun) + global string GetNextLUN(string lun) { - if (fcp_lun == nil || fcp_lun == "") - fcp_lun = "0"; + if (lun == nil || lun == "") + lun = "0"; - integer old_lun = tointeger(fcp_lun); + integer old_lun = tointeger(lun); integer new_lun = old_lun; foreach (integer k, map<string, any> v, devices, { @@ -206,7 +206,7 @@ "detail" : $[ "controller_id" : FormatChannel(d["controller_id"]:""), "wwpn" : FormatWWPN(d["wwpn"]:""), - "fcp_lun" : FormatFCPLUN(d["fcp_lun"]:""), + "fcp_lun" : FormatLUN(d["fcp_lun"]:""), ], ]; return $[ index : m ]; Modified: trunk/s390/src/zfcp/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/zfcp/dialogs.ycp?rev=676... ============================================================================== --- trunk/s390/src/zfcp/dialogs.ycp (original) +++ trunk/s390/src/zfcp/dialogs.ycp Thu Mar 8 16:08:25 2012 @@ -74,8 +74,8 @@ items = maplist(integer k, map<string, any> d, devices, { string channel = d["detail", "controller_id"]:""; string wwpn = d["detail", "wwpn"]:""; - string fcp_lun = d["detail", "fcp_lun"]:""; - return `item(`id(k), channel, wwpn, fcp_lun); + string lun = d["detail", "fcp_lun"]:""; + return `item(`id(k), channel, wwpn, lun); }); } else @@ -83,9 +83,9 @@ items = maplist(integer k, map<string, any> d, devices, { string channel = d["detail", "controller_id"]:""; string wwpn = d["detail", "wwpn"]:""; - string fcp_lun = d["detail", "fcp_lun"]:""; + string lun = d["detail", "fcp_lun"]:""; string dev_name = d["dev_name"]:""; - return `item(`id(k), channel, wwpn, fcp_lun, dev_name); + return `item(`id(k), channel, wwpn, lun, dev_name); }); } @@ -259,7 +259,7 @@ wwpns = toset(wwpns); luns = maplist(integer index, map<string, any> d, ZFCPController::devices, { - return d["detail", "zfp_lun"]:""; + return d["detail", "fcp_lun"]:""; }); luns = toset(luns); } @@ -271,11 +271,11 @@ wwpns = [ ZFCPController::previous_settings["wwpn"]:"" ]; - string fcp_lun = ZFCPController::previous_settings["fcp_lun"]:""; - if (!isempty(fcp_lun)) - fcp_lun = ZFCPController::GetNextLUN(fcp_lun); + string lun = ZFCPController::previous_settings["fcp_lun"]:""; + if (!isempty(lun)) + lun = ZFCPController::GetNextLUN(lun); - luns = [ fcp_lun ]; + luns = [ lun ]; } term content = `HBox (`HStretch (), `VBox( @@ -292,7 +292,7 @@ `VSpacing (2), `HBox( // combobox - `ComboBox(`id(`fcp_lun), `opt(`hstretch, `editable), _("&LUN"), luns), + `ComboBox(`id(`lun), `opt(`hstretch, `editable), _("&LUN"), luns), // push button Mode::config() ? `Empty() : `PushButton(`id(`get_lun), _("Get LUNs")) ), @@ -306,7 +306,7 @@ UI::ChangeWidget(`id(`channel), `ValidChars, "0123456789abcdefABCDEF."); UI::ChangeWidget(`id(`wwpn), `ValidChars, "0123456789abcdefABCDEFx"); - UI::ChangeWidget(`id(`fcp_lun), `ValidChars, "0123456789abcdefABCDEFx"); + UI::ChangeWidget(`id(`lun), `ValidChars, "0123456789abcdefABCDEFx"); UI::SetFocus(`id(`channel)); @@ -361,7 +361,7 @@ wwpn = ZFCPController::FormatWWPN(wwpn); luns = ZFCPController::GetLUNs(channel, wwpn); - UI::ChangeWidget(`fcp_lun, `Items, luns); + UI::ChangeWidget(`lun, `Items, luns); ret = nil; } else if (ret == `abort || ret == `cancel) @@ -377,7 +377,7 @@ { string channel = (string) UI::QueryWidget(`id(`channel), `Value); string wwpn = (string) UI::QueryWidget(`id(`wwpn), `Value); - string fcp_lun = (string) UI::QueryWidget(`id(`fcp_lun), `Value); + string lun = (string) UI::QueryWidget(`id(`lun), `Value); if (!ZFCPController::IsValidChannel(channel)) { @@ -397,20 +397,20 @@ continue; } - if (!ZFCPController::IsValidFCPLUN(fcp_lun)) + if (!ZFCPController::IsValidLUN(lun)) { // error popup Report::Error(_("The entered LUN is invalid.")); - UI::SetFocus(`fcp_lun); + UI::SetFocus(`lun); ret = nil; continue; } channel = ZFCPController::FormatChannel(channel); wwpn = ZFCPController::FormatWWPN(wwpn); - fcp_lun = ZFCPController::FormatFCPLUN(fcp_lun); + lun = ZFCPController::FormatLUN(lun); - if (ZFCPController::GetDeviceIndex(channel, wwpn, fcp_lun) != nil) + if (ZFCPController::GetDeviceIndex(channel, wwpn, lun) != nil) { // error popup Popup::Error(_("Device already exists.")); @@ -424,11 +424,11 @@ { string channel = (string) UI::QueryWidget(`id(`channel), `Value); string wwpn = (string) UI::QueryWidget(`id(`wwpn), `Value); - string lun = (string) UI::QueryWidget(`id(`fcp_lun), `Value); + string lun = (string) UI::QueryWidget(`id(`lun), `Value); channel = ZFCPController::FormatChannel(channel); wwpn = ZFCPController::FormatWWPN(wwpn); - lun = ZFCPController::FormatFCPLUN(lun); + lun = ZFCPController::FormatLUN(lun); ZFCPController::previous_settings["channel"] = channel; ZFCPController::previous_settings["wwpn"] = wwpn; @@ -482,8 +482,8 @@ map d = ZFCPController::devices[index]:$[]; string channel = d["detail", "controller_id"]:""; string wwpn = d["detail", "wwpn"]:""; - string fcp_lun = d["detail", "fcp_lun"]:""; - ZFCPController::DeactivateDisk(channel, wwpn, fcp_lun); + string lun = d["detail", "fcp_lun"]:""; + ZFCPController::DeactivateDisk(channel, wwpn, lun); }); ZFCPController::ProbeDisks(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn2.opensuse.org