Author: fehr
Date: Thu Apr 12 18:46:50 2012
New Revision: 67931
URL: http://svn.opensuse.org/viewcvs/yast?rev=67931&view=rev
Log:
checkin for backup purposes
Modified:
branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/IscsiLioData.ycp
branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/widgets.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/IscsiLioData.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/IscsiLioData.ycp?rev=67931&r1=67930&r2=67931&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/IscsiLioData.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/IscsiLioData.ycp Thu Apr 12 18:46:50 2012
@@ -920,6 +920,22 @@
return( ret );
}
+global boolean DoRemoveClnt( string tgt, integer tpg, string clnt )
+ {
+ string kt = tgt + " " + tpg + " " + clnt;
+ boolean ret = LogExecCmd( "lio_node --delnodeacl " + kt );
+ y2milestone( "DoRemoveClnt tgt:%1 tpg:%2 clnt:%3 ret:%4", tgt, tpg, clnt, ret );
+ return( ret );
+ }
+
+global boolean DoCreateClnt( string tgt, integer tpg, string clnt )
+ {
+ string kt = tgt + " " + tpg + " " + clnt;
+ boolean ret = LogExecCmd( "lio_node --addnodeacl " + kt );
+ y2milestone( "DoCreateClnt tgt:%1 tpg:%2 clnt:%3 ret:%4", tgt, tpg, clnt, ret );
+ return( ret );
+ }
+
global void UpdateConfig()
{
data = ParseConfigLio();
Modified: branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/widgets.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/widgets.ycp?rev=67931&r1=67930&r2=67931&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/widgets.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/iscsi-lio-server/src/widgets.ycp Thu Apr 12 18:46:50 2012
@@ -521,6 +521,93 @@
return lmap;
}
+map AddClntDialog()
+ {
+ y2milestone( "AddClntDialog" );
+ map ret = $[];
+ term dlg = `VBox( `MarginBox( 4, 1,
+ `VBox(
+ `Left(`Label(_("New client name:"))),
+ `MinWidth( 50, `InputField(`id(`clnt), `opt(`hstretch), "", "")),
+ `VSpacing(0.5),
+ `Left(`CheckBox( `id(`import), _("Import LUNs from TPG"), true )))),
+ `ButtonBox(
+ `PushButton(`id(`ok), `opt(`default), Label::OKButton() ),
+ `PushButton(`id(`cancel), Label::CancelButton() )));
+ UI::OpenDialog(dlg);
+ symbol sym = `nil;
+ while(sym != `ok && sym !=`cancel)
+ {
+ sym = (symbol)UI::UserInput();
+ y2milestone( "AddClntDialog sym:%1", sym );
+ if(sym == `ok)
+ {
+ string txt = "";
+ string s = (string)UI::QueryWidget(`id(`clnt), `Value);
+ if( isempty(s) )
+ txt = _("Client name must not be empty!");
+ if( haskey( changed_lun, s ) ||
+ contains( IscsiLioData::GetClntList(curr_target, curr_tpg), s ))
+ txt = _("Client name already exists!");
+ if( !isempty(txt))
+ {
+ sym = `again;
+ UI::SetFocus(`id(`clnt));
+ Popup::Error( txt );
+ }
+ else
+ {
+ ret["clnt"] = s;
+ ret["import"] = (boolean)UI::QueryWidget(`id(`import), `Value);
+ }
+ }
+ }
+ UI::CloseDialog();
+ y2milestone( "AddClntDialog ret:%1", ret );
+ return ret;
+ }
+
+string CopyClntDialog()
+ {
+ y2milestone( "CopylntDialog" );
+ string ret = "";
+ term dlg = `VBox( `MarginBox( 4, 1,
+ `VBox(
+ `Left(`Label(_("New client name:"))),
+ `MinWidth( 50, `InputField(`id(`clnt), `opt(`hstretch), "", "")))),
+ `ButtonBox(
+ `PushButton(`id(`ok), `opt(`default), Label::OKButton() ),
+ `PushButton(`id(`cancel), Label::CancelButton() )));
+ UI::OpenDialog(dlg);
+ symbol sym = `nil;
+ while(sym != `ok && sym !=`cancel)
+ {
+ sym = (symbol)UI::UserInput();
+ y2milestone( "CopyClntDialog sym:%1", sym );
+ if(sym == `ok)
+ {
+ string txt = "";
+ string s = (string)UI::QueryWidget(`id(`clnt), `Value);
+ if( isempty(s) )
+ txt = _("Client name must not be empty!");
+ if( haskey( changed_lun, s ) ||
+ contains( IscsiLioData::GetClntList(curr_target, curr_tpg), s ))
+ txt = _("Client name already exists!");
+ if( !isempty(txt))
+ {
+ sym = `again;
+ UI::SetFocus(`id(`clnt));
+ Popup::Error( txt );
+ }
+ else
+ ret = s;
+ }
+ }
+ UI::CloseDialog();
+ y2milestone( "CopyClntDialog ret:%1", ret );
+ return ret;
+ }
+
// dialog to add/modify user and password
list <string> getDialogValues(string user, string pass){
UI::OpenDialog( `VBox(
@@ -982,8 +1069,6 @@
map m = IscsiLioData::GetAuth( curr_target, curr_tpg, s );
auth = GetAuthString(m);
}
- string lun = "";
- map