Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] r57881 - in /branches/SuSE-Code-11-Branch/isns: ./ agents/ doc/ doc/autodocs/ package/ src/ testsuite/ testsuite/tests/
  • From: mzugec@xxxxxxxxxxxxxxxx
  • Date: Tue, 07 Jul 2009 08:20:30 -0000
  • Message-id: <E1MO5ug-0004kL-Vj@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Tue Jul 7 10:20:30 2009
New Revision: 57881

URL: http://svn.opensuse.org/viewcvs/yast?rev=57881&view=rev
Log:
yast2-isns module added into svn (for code11)

Added:
branches/SuSE-Code-11-Branch/isns/
branches/SuSE-Code-11-Branch/isns/MAINTAINER
branches/SuSE-Code-11-Branch/isns/Makefile.cvs
branches/SuSE-Code-11-Branch/isns/RPMNAME
branches/SuSE-Code-11-Branch/isns/VERSION
branches/SuSE-Code-11-Branch/isns/agents/
branches/SuSE-Code-11-Branch/isns/agents/Makefile.am
branches/SuSE-Code-11-Branch/isns/agents/_cvsignore
branches/SuSE-Code-11-Branch/isns/agents/isnsd.scr
branches/SuSE-Code-11-Branch/isns/configure.in.in
branches/SuSE-Code-11-Branch/isns/doc/
branches/SuSE-Code-11-Branch/isns/doc/Makefile.am
branches/SuSE-Code-11-Branch/isns/doc/_cvsignore
branches/SuSE-Code-11-Branch/isns/doc/autodocs/
branches/SuSE-Code-11-Branch/isns/doc/autodocs/Makefile.am
branches/SuSE-Code-11-Branch/isns/doc/autodocs/_cvsignore
branches/SuSE-Code-11-Branch/isns/package/
branches/SuSE-Code-11-Branch/isns/package/_cvsignore
branches/SuSE-Code-11-Branch/isns/package/yast2-isns.changes
branches/SuSE-Code-11-Branch/isns/src/
branches/SuSE-Code-11-Branch/isns/src/IsnsServer.ycp
branches/SuSE-Code-11-Branch/isns/src/Makefile.am
branches/SuSE-Code-11-Branch/isns/src/_cvsignore
branches/SuSE-Code-11-Branch/isns/src/complex.ycp
branches/SuSE-Code-11-Branch/isns/src/dialogs.ycp
branches/SuSE-Code-11-Branch/isns/src/helps.ycp
branches/SuSE-Code-11-Branch/isns/src/inst_isns.ycp
branches/SuSE-Code-11-Branch/isns/src/isns.desktop
branches/SuSE-Code-11-Branch/isns/src/isns.ycp
branches/SuSE-Code-11-Branch/isns/src/isns_auto.ycp
branches/SuSE-Code-11-Branch/isns/src/isns_finish.ycp
branches/SuSE-Code-11-Branch/isns/src/isns_proposal.ycp
branches/SuSE-Code-11-Branch/isns/src/widgets.ycp
branches/SuSE-Code-11-Branch/isns/src/wizards.ycp
branches/SuSE-Code-11-Branch/isns/testsuite/
branches/SuSE-Code-11-Branch/isns/testsuite/Makefile.am
branches/SuSE-Code-11-Branch/isns/testsuite/_cvsignore
branches/SuSE-Code-11-Branch/isns/testsuite/tests/
branches/SuSE-Code-11-Branch/isns/testsuite/tests/_cvsignore
branches/SuSE-Code-11-Branch/isns/yast2-isns.spec.in

Added: branches/SuSE-Code-11-Branch/isns/MAINTAINER
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/MAINTAINER?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/MAINTAINER (added)
+++ branches/SuSE-Code-11-Branch/isns/MAINTAINER Tue Jul 7 10:20:30 2009
@@ -0,0 +1 @@
+Michal Zugec <mzugec@xxxxxxxxxx>

Added: branches/SuSE-Code-11-Branch/isns/Makefile.cvs
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/Makefile.cvs?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/Makefile.cvs (added)
+++ branches/SuSE-Code-11-Branch/isns/Makefile.cvs Tue Jul 7 10:20:30 2009
@@ -0,0 +1,22 @@
+#
+# Makefile.cvs
+#
+PREFIX = /usr
+
+LIB = $(shell y2tool get-lib)
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status

Added: branches/SuSE-Code-11-Branch/isns/RPMNAME
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/RPMNAME?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/RPMNAME (added)
+++ branches/SuSE-Code-11-Branch/isns/RPMNAME Tue Jul 7 10:20:30 2009
@@ -0,0 +1 @@
+yast2-isns

Added: branches/SuSE-Code-11-Branch/isns/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/VERSION?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/VERSION (added)
+++ branches/SuSE-Code-11-Branch/isns/VERSION Tue Jul 7 10:20:30 2009
@@ -0,0 +1 @@
+2.17.0

Added: branches/SuSE-Code-11-Branch/isns/agents/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/agents/Makefile.am?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/agents/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/isns/agents/Makefile.am Tue Jul 7 10:20:30
2009
@@ -0,0 +1,7 @@
+# Makefile.am for isns/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA = isnsd.scr
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)

Added: branches/SuSE-Code-11-Branch/isns/agents/_cvsignore
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/agents/_cvsignore?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/agents/_cvsignore (added)
+++ branches/SuSE-Code-11-Branch/isns/agents/_cvsignore Tue Jul 7 10:20:30 2009
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

Added: branches/SuSE-Code-11-Branch/isns/agents/isnsd.scr
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/agents/isnsd.scr?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/agents/isnsd.scr (added)
+++ branches/SuSE-Code-11-Branch/isns/agents/isnsd.scr Tue Jul 7 10:20:30 2009
@@ -0,0 +1,48 @@
+/*
+ * Read(.ietd.Compression)
+ * (["yes"])
+ *
+ * Write(.ietd.Compression, "no")
+ * (true)
+ *
+ * Fore more information about possible keys and values
+ * consult with the slp_config man pages `man slp_config`.
+ */
+
+.etc.iscsid
+
+`ag_ini(
+ `IniAgent( "/etc/isns/isns.conf",
+ $[
+ "options" : [ "global_values", "comments_last", "line_can_continue",
"join_multiline", "repeat_names" ],
+ "comments": [
+ "^[ \t]*$", // empty line
+ "^[ \t]+[;#].*$", // comment char is not first char
+ "^[#][ \t]*$", // only comment chars
+ "^[#][ \t]*\\[[^]]*$", // comment chars followed by '[' without
matching ']'
+ "^[#][^ \t[]", // comment char followed by non-blank nor '['
+ "^[#][ \t]+[^[a-z \t].*$", // comment chars followed by non a-z
char nor '[' nor blank
+ "^[#][ \t]+[a-z ]*[a-z][ \t]*$", // comment chars followed by a-z
or blank chars
+ "^[#][ \t]+[a-z ]*[a-z][ \t]*[^a-z \t=].*$", // like above, but
followed by non a-z nor blank nor '=' chars
+ ],
+ "sections" : [
+ $[
+ "begin" : [ "^[ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*",
"[%s]" ],
+ ], $[
+ // this is a special type for commenting out the values
+ "begin" : [ "^[#;][ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*",
"# [%s]" ],
+ ]
+ ],
+
+ // we need to exclude ; because of the second matching rule
+ "params" : [
+ // Options with one value ('yes' / 'no')
+// $[ "match" : [ "^[#;][ \t]*([^ \t]+)[ \t]+([^ \t]+)[ \t]+$",
"%s %s" ]],
+ $[ "match" : [ "^[#;][ \t]*([^ \t\=]+)[ \t\=]?(.+)[ \t]*$", ";
%s %s" ]],
+ // Options with more possible values
+ $[ "match" : [ "^[ \t]*([^ \t\=]+)[ \t\=]+[ ]*(.+)[ \t]*$",
"%s = %s" ]],
+ ],
+ ]
+ )
+)
+

Added: branches/SuSE-Code-11-Branch/isns/configure.in.in
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/configure.in.in?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/configure.in.in (added)
+++ branches/SuSE-Code-11-Branch/isns/configure.in.in Tue Jul 7 10:20:30 2009
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@

Added: branches/SuSE-Code-11-Branch/isns/doc/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/doc/Makefile.am?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/doc/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/isns/doc/Makefile.am Tue Jul 7 10:20:30 2009
@@ -0,0 +1,10 @@
+# Makefile.am for isns/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)

Added: branches/SuSE-Code-11-Branch/isns/doc/_cvsignore
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/doc/_cvsignore?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/doc/_cvsignore (added)
+++ branches/SuSE-Code-11-Branch/isns/doc/_cvsignore Tue Jul 7 10:20:30 2009
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

Added: branches/SuSE-Code-11-Branch/isns/doc/autodocs/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/doc/autodocs/Makefile.am?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/doc/autodocs/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/isns/doc/autodocs/Makefile.am Tue Jul 7
10:20:30 2009
@@ -0,0 +1,3 @@
+# Makefile.am for isns/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami

Added: branches/SuSE-Code-11-Branch/isns/doc/autodocs/_cvsignore
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/doc/autodocs/_cvsignore?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/doc/autodocs/_cvsignore (added)
+++ branches/SuSE-Code-11-Branch/isns/doc/autodocs/_cvsignore Tue Jul 7
10:20:30 2009
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html

Added: branches/SuSE-Code-11-Branch/isns/package/_cvsignore
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/package/_cvsignore?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/package/_cvsignore (added)
+++ branches/SuSE-Code-11-Branch/isns/package/_cvsignore Tue Jul 7 10:20:30
2009
@@ -0,0 +1,2 @@
+*.spec
+*.bz2

Added: branches/SuSE-Code-11-Branch/isns/package/yast2-isns.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/package/yast2-isns.changes?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/package/yast2-isns.changes (added)
+++ branches/SuSE-Code-11-Branch/isns/package/yast2-isns.changes Tue Jul 7
10:20:30 2009
@@ -0,0 +1,40 @@
+-------------------------------------------------------------------
+Fri Jul 3 15:14:10 CEST 2009 - mzugec@xxxxxxx
+
+- button ordering (bnc#440543)
+- 2.17.0
+
+-------------------------------------------------------------------
+Fri Jul 3 13:38:15 CEST 2009 - mzugec@xxxxxxx
+
+- fixed typo in help text (bnc#439179)
+
+-------------------------------------------------------------------
+Thu Jul 2 15:42:01 CEST 2009 - mzugec@xxxxxxx
+
+- submitted into yast svn, fixed some build issues
+
+-------------------------------------------------------------------
+Tue Sep 18 12:00:00 CEST 2007 - wrwhitehead@xxxxxxxxxx
+- Fixed Bug #325129 - iSNS server not running feedback and
+ updated dialogs to display only the non-selected nodes
+
+-------------------------------------------------------------------
+Tue Sep 04 12:00:00 CEST 2007 - wrwhitehead@xxxxxxxxxx
+- Updated display pages to be more user friendly. Added help text.
+
+-------------------------------------------------------------------
+Wed Aug 29 12:00:00 CEST 2007 - wrwhitehead@xxxxxxxxxx
+- Resized display pages and fixed some typeos in the text labels
+
+-------------------------------------------------------------------
+Fri Apr 13 12:00:00 CEST 2007 - wrwhitehead@xxxxxxxxxx
+- Fixed Bug 257976 Note displaying target/initiator types
+
+-------------------------------------------------------------------
+Thu Feb 15 12:00:00 CEST 2007 - WRWhitehead@xxxxxxxxxx
+- initial version (FATE #233)
+
+
+
+

Added: branches/SuSE-Code-11-Branch/isns/src/IsnsServer.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/IsnsServer.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/IsnsServer.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/IsnsServer.ycp Tue Jul 7 10:20:30
2009
@@ -0,0 +1,615 @@
+/**
+ * File: modules/IsnsServer.ycp
+ * Package: Configuration of isns-server
+ * Summary: IsnsServer settings, input and output functions
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: IsnsServer.ycp 35355 2007-01-15 15:06:49Z mzugec $
+ *
+ * Representation of the configuration of iscsi-server.
+ * Input and output routines.
+ */
+
+{
+
+module "isnsServer";
+textdomain "isns";
+
+import "Progress";
+import "Report";
+import "Summary";
+import "Message";
+import "Service";
+import "Package";
+import "Popup";
+import "SuSEFirewall";
+import "Confirm";
+import "Mode";
+import "String";
+import "Map";
+
+boolean serviceStatus = false;
+boolean statusOnStart = false;
+
+/**
+ * Prototypes
+ */
+global boolean Modified();
+
+/**
+ * Data was modified?
+ */
+global boolean modified = false;
+global boolean configured = false;
+
+/**
+ */
+global boolean proposal_valid = false;
+
+/**
+ * Write only, used during autoinstallation.
+ * Don't run services and SuSEconfig, it's all done at one place.
+ */
+global boolean write_only = false;
+
+/**
+ * Abort function
+ * return boolean return true if abort
+ */
+global boolean() AbortFunction = Modified;
+
+/**
+ * Abort function
+ * @return boolean return true if abort
+ */
+global define boolean Abort() ``{
+ if(AbortFunction != nil)
+ {
+ return AbortFunction () == true;
+ }
+ return false;
+}
+
+/**
+ * Data was modified?
+ * @return true if modified
+ */
+global boolean Modified() {
+ y2debug("modified=%1",modified);
+ return modified;
+}
+
+// read configuration file /etc/ietd.conf
+global boolean readConfig(){
+ map<string, any> read_values = (map<string, any>)SCR::Read(.etc.isns.all);
+// IsnsServerFunctions::parseConfig( read_values );
+ y2milestone("isns readConfig");
+ return true;
+}
+
+// write configuration file /etc/ietd.conf
+boolean writeConfig(){
+// prepare map, because perl->ycp lost information about data types (integers
in this case)
+// map <string, any> config_file = IsnsServerFunctions::writeConfig();
+// config_file["type"]=tointeger(config_file["type"]:"1");
+// config_file["file"]=tointeger(config_file["file"]:"1");
+// list <map<string, any> > value = [];
+// foreach(map<string, any> row, config_file["value"]:[], {
+// row["type"]=tointeger(row["type"]:"1");
+// row["file"]=tointeger(row["file"]:"1");
+// value = add(value, row);
+// });
+//
+// config_file["value"] = value;
+// y2milestone("config_file to write %1", config_file);
+// // write it
+// SCR::Write(.etc.ietd.all, config_file);
+// SCR::Write(.etc.ietd, nil);
+ return true;
+}
+
+
+
+// test if required package ("isns") is installed
+boolean installed_packages(){
+ boolean ret = false;
+ y2milestone("Check if isns is installed");
+ if( !Package::InstallMsg( "isns",
+ _("<p>To configure the isns service, the <b>%1</b> package must be
installed.</p>") +
+ _("<p>Install it now?</p>")) )
+ {
+ Popup::Error( Message::CannotContinueWithoutPackagesInstalled() );
+ } else ret = true;
+
+ return ret;
+}
+
+// check status of isns service
+// if not enabled, start it manually
+boolean getServiceStatus(){
+ boolean ret = true;
+ if (Service::Status("isns") == 0) {
+ statusOnStart=true;
+ serviceStatus=true;
+ }
+y2milestone("Service status = %1", statusOnStart);
+ if (!statusOnStart) Service::Start("isns");
+ return ret;
+}
+
+// set service status
+boolean setServiceStatus(){
+ boolean start=true;
+ if (!serviceStatus) start = statusOnStart;
+
+ if (!start) {
+ y2milestone("Stop isns service");
+ Service::Stop("isns");
+ } else {
+ y2milestone("Start isns service");
+ serviceStatus=true;
+ Service::Start("isns");
+ }
+ return true;
+}
+
+global string testISNSAccess(string address) {
+ string value = "OK";
+ map <string,any> temp = $[];
+
+ string command = sformat("isnsadm -a %1 -t -q iscsi",address);
+ map<string, any> result= (map<string, any>)
SCR::Execute(.target.bash_output, command, $[]);
+ foreach(string row, splitstring(result["stdout"]:"","\n"), {
+
+ if (row == "TCP error on connection")
+ {
+ y2milestone("TCP error: %1 ",row);
+ value = "ERROR";
+ }
+
+ if (row == "Error Sending TCP request.")
+ {
+ y2milestone("Failed to resolve host error: %1 ",row);
+ value = "ERROR";
+ }
+
+ });
+
+return value;
+}
+global list <map <string,any> > readISCSI(string address) {
+ list <map <string,any> > values = [];
+ map <string,any> temp = $[];
+
+ string command = sformat("isnsadm -a %1 -t -q iscsi",address);
+ map<string, any> result= (map<string, any>)
SCR::Execute(.target.bash_output, command, $[]);
+ foreach(string row, splitstring(result["stdout"]:"","\n"), {
+
+ integer pos = findfirstof(row,":");
+ string key = "";
+ string val = "";
+
+ if (pos != nil && pos > 0)
+ {
+ key = substring(row, 0, pos );
+ }
+
+ if (key == "iSCSI ID ") {
+ val = substring(row, pos + 2);
+ temp["NODE"] = val;
+ }
+
+ if (key == "Type") {
+ val = substring(row, pos + 6);
+ temp["TYPE"] = val;
+ values = add(values, temp );
+ }
+ });
+
+return values;
+}
+
+global string readISCSI_type(string address,string index) {
+ string temp = "";
+
+ y2milestone("iSCSIRead_type index:%1", index);
+
+ string command = sformat("isnsadm -a %1 -t -q iscsi -n %2",address,index);
+ map<string, any> result= (map<string, any>)
SCR::Execute(.target.bash_output, command, $[]);
+ foreach(string row, splitstring(result["stdout"]:"","\n"), {
+
+ integer pos = findfirstof(row,":");
+ string key = "";
+ string val = "";
+
+ if (pos != nil && pos > 0)
+ {
+ key = substring(row, 0, pos );
+ val = substring(row, pos + 6);
+ }
+
+ y2milestone("iSCSIRead_type %1",key);
+
+ if (key == "Type") {
+ y2milestone("iSCSIRead_type return value is %1",val);
+ temp = val;
+ }
+ });
+
+return temp;
+}
+
+
+global list <string> readDDS(string address) {
+ list <string> values = [];
+ string ddid = "";
+
+ y2milestone("readDDS %1",address);
+ string command = sformat("isnsadm -a %1 -t -q dds",address);
+ map<string, any> result= (map<string, any>)
SCR::Execute(.target.bash_output, command, $[]);
+ foreach(string row, splitstring(result["stdout"]:"","\n"), {
+
+ integer pos = findfirstof(row,":");
+ string key = "";
+ string val = "";
+
+ if (pos != nil && pos > 0)
+ {
+ key = substring(row, 0, pos );
+ val = substring(row, pos + 2);
+ }
+
+ if (key == "DDS ID ") {
+ values = add(values, val );
+ }
+ else if (key == "DDS Sym Name ") {
+ values = add(values, val );
+ }
+ });
+
+return values;
+}
+
+global list <map <string,any> > readDDMembers(string address, string id) {
+ list <map <string,any> > values = [];
+ map <string,any> temp = $[];
+ string ddid = "";
+
+ y2milestone("readDDSMembers %1 %2",address, id);
+ string command = sformat("isnsadm -a %1 -t -q dd -n %2",address,id);
+ map<string, any> result= (map<string, any>)
SCR::Execute(.target.bash_output, command, $[]);
+ foreach(string row, splitstring(result["stdout"]:"","\n"), {
+
+ integer pos = findfirstof(row,":");
+ string key = "";
+ string val = "";
+
+ y2milestone("results: %1",row);
+
+ if (pos != nil && pos > 0)
+ {
+ key = substring(row, 0, pos );
+ val = substring(row, pos + 2);
+ }
+
+ if (key == " DD iSCSI Member ") {
+ temp["NODE"] = val;
+ }
+
+ if (key == " DD iSCSI Member Index ") {
+ temp["TYPE"] = readISCSI_type(address,val);
+ values = add(values, temp );
+ }
+
+ });
+
+return values;
+}
+
+global list <string> readDDSMembers(string address, string id) {
+ list <string> values = [];
+ string ddid = "";
+
+ y2milestone("readDDSMembers %1 %2",address, id);
+ string command = sformat("isnsadm -a %1 -t -q dds -n %2",address,id);
+ map<string, any> result= (map<string, any>)
SCR::Execute(.target.bash_output, command, $[]);
+ foreach(string row, splitstring(result["stdout"]:"","\n"), {
+
+ integer pos = findfirstof(row,":");
+ string key = "";
+ string val = "";
+
+ y2milestone("results: %1",row);
+
+ if (pos != nil && pos > 0)
+ {
+ key = substring(row, 0, pos );
+ val = substring(row, pos + 2);
+ }
+
+ if (key == " DD ID ") {
+ values = add(values, val );
+ }
+ else if (key == " DD Sym Name ") {
+ values = add(values, val );
+ }
+ });
+
+return values;
+}
+
+global list <string> readDD(string address) {
+ list <string> values = [];
+ string ddid = "";
+
+ y2milestone("readDD");
+ string command = sformat("isnsadm -a %1 -t -q dd",address);
+ map<string, any> result= (map<string, any>)
SCR::Execute(.target.bash_output, command, $[]);
+ foreach(string row, splitstring(result["stdout"]:"","\n"), {
+
+ integer pos = findfirstof(row,":");
+ string key = "";
+ string val = "";
+
+ if (pos != nil && pos > 0)
+ {
+ key = substring(row, 0, pos );
+ val = substring(row, pos + 2);
+ }
+
+ if (key == "DD ID ") {
+ values = add(values, val );
+ }
+ else if (key == "DD Sym Name ") {
+ values = add(values, val );
+ }
+
+
+ });
+
+return values;
+}
+
+global boolean addISCSI(string address, string name, string entityid) {
+ y2milestone("addDDS");
+ string command = sformat("isnsadm -a %1 -t -r iscsi -n '%2' -m
'%3'",address, name, entityid);
+ SCR::Execute(.target.bash_output, command, $[]);
+ return true;
+}
+
+global boolean addDDS(string address, string name) {
+ y2milestone("addDDS");
+ string command = sformat("isnsadm -a %1 -t -r dds -n '%2'", address, name);
+ SCR::Execute(.target.bash_output, command, $[]);
+ return true;
+}
+
+global boolean addDDMember(string address, string dd_id, string iqn) {
+ y2milestone("addDDMember");
+ string command = sformat("isnsadm -a %1 -t -r ddmember -n %2 -m %3",
address, dd_id, iqn);
+ SCR::Execute(.target.bash_output, command, $[]);
+ return true;
+}
+
+global boolean addDDSMember(string address, string dds_id, string dd_id) {
+ y2milestone("addDDSMember");
+ string command = sformat("isnsadm -a %1 -t -r ddsmember -n %2 -m %3",
address, dds_id, dd_id);
+ SCR::Execute(.target.bash_output, command, $[]);
+ return true;
+}
+
+global boolean addDD(string address, string name) {
+ y2milestone("addDD");
+ string command = sformat("isnsadm -a %1 -t -r dd -n '%2'", address, name);
+ SCR::Execute(.target.bash_output, command, $[]);
+ return true;
+}
+
+global boolean deleteISCSI(string address, string id) {
+ y2milestone("deleteISCSI");
+ string command = sformat("isnsadm -a %1 -t -d iscsi -n '%2'",address, id);
+ SCR::Execute(.target.bash_output, command, $[]);
+
+ return true;
+}
+
+global boolean deleteDDS(string address, string id) {
+ y2milestone("deleteDDS");
+ string command = sformat("isnsadm -a %1 -t -d dds -n '%2'",address, id);
+ SCR::Execute(.target.bash_output, command, $[]);
+
+ return true;
+}
+
+global boolean deleteDDMember (string address, string dd_id, string iqn) {
+ y2milestone("deleteDDSMember:%1",iqn);
+ string command = sformat("isnsadm -a %1 -t -d ddmember -n %2 -m
%3",address, dd_id, iqn);
+ SCR::Execute(.target.bash_output, command, $[]);
+
+ return true;
+}
+
+global boolean deleteDDSMember (string address, string dds_id, string dd_id) {
+ y2milestone("deleteDDSMember");
+ string command = sformat("isnsadm -a %1 -t -d ddsmember -n %2 -m
%3",address, dds_id, dd_id);
+ SCR::Execute(.target.bash_output, command, $[]);
+
+ return true;
+}
+
+global boolean deleteDD(string address, string id) {
+ y2milestone("deleteDDS");
+ string command = sformat("isnsadm -a %1 -t -d dd -n '%2'",address, id);
+ SCR::Execute(.target.bash_output, command, $[]);
+
+ return true;
+}
+
+
+/**
+ * Read all iscsi-server settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* IsnsServer read dialog caption */
+ string caption = _("Initializing isns daemon configuration");
+
+ // TODO FIXME Set the right number of stages
+ integer steps = 4;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Read the database"),
+ /* Progress stage 2/3 */
+ _("Read the previous settings"),
+ /* Progress stage 3/3 */
+ _("Detect the devices")
+ ], [
+ /* Progress step 1/3 */
+ _("Reading the database..."),
+ /* Progress step 2/3 */
+ _("Reading the previous settings..."),
+ /* Progress step 3/3 */
+ _("Detecting the devices..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ // check if user is root
+ if(!Confirm::MustBeRoot()) return false;
+ Progress::NextStage();
+ // check if required packages ("isns") is installed
+ if(!installed_packages()) return false;
+ sleep(sl);
+
+ if(Abort()) return false;
+ Progress::NextStep();
+ // get status of isns init script
+ if(!getServiceStatus()) return false;
+ sleep(sl);
+
+ if(Abort()) return false;
+ Progress::NextStage();
+ // read configuration (/etc/ietd.conf)
+ if(!readConfig()) {
+ Report::Error(Message::CannotReadCurrentSettings());
+ return false;
+ }
+ sleep(sl);
+
+ // detect devices
+ Progress::set(false);
+ SuSEFirewall::Read();
+ Progress::set(true);
+
+ Progress::NextStage();
+ /* Error message */
+ if(false) return false;
+ sleep(sl);
+
+ if(Abort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(Abort()) return false;
+ modified = false;
+ configured = true;
+ return true;
+}
+
+/**
+ * Write all iscsi-server settings
+ * @return true on success
+ */
+global boolean Write() {
+
+ /* IsnsServer write dialog caption */
+ string caption = _("Saving isns Configuration");
+
+ // TODO FIXME And set the right number of stages
+ integer steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Write the settings"),
+ /* Progress stage 2/2 */
+ _("Run SuSEconfig")
+ ], [
+ /* Progress step 1/2 */
+ _("Writing the settings..."),
+ /* Progress step 2/2 */
+ _("Running SuSEconfig..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+
+ Progress::set(false);
+ SuSEFirewall::Write();
+ Progress::set(true);
+
+ Progress::NextStage();
+ // write configuration (/etc/isns.conf)
+ if(!writeConfig()) Report::Error (_("Cannot write settings."));
+ sleep(sl);
+
+
+ if(Abort()) return false;
+ Progress::NextStage ();
+// ask user whether reload or restart server and do it
+// if ( (serviceStatus) || (statusOnStart) )
+// if (!reloadServer()) return false;
+// sleep(sl);
+
+ if(Abort()) return false;
+ Progress::NextStage();
+ sleep(sl);
+
+ // set isns initscript status
+ if(!setServiceStatus()) return false;
+ return true;
+}
+
+/**
+ * Return packages needed to be installed and removed during
+ * Autoinstallation to insure module has all needed software
+ * installed.
+ * @return map with 2 lists.
+ */
+global map AutoPackages() {
+ // TODO FIXME: your code here...
+ return $[ "install":[], "remove":[] ];
+}
+
+
+// get/set service accessors for CWMService component
+global boolean GetStartService() {
+ boolean status = Service::Enabled("isns");
+ y2milestone("isns service status %1", status);
+ return status;
+}
+
+global void SetStartService(boolean status) {
+ y2milestone("Set service status %1", status);
+ serviceStatus = status;
+ if (status == true) Service::Enable("isns");
+ else Service::Disable("isns");
+}
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/Makefile.am?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/isns/src/Makefile.am Tue Jul 7 10:20:30 2009
@@ -0,0 +1,31 @@
+# Makefile.am for isns/src
+
+yncludedir = @yncludedir@/isns
+
+client_DATA = \
+ isns.ycp \
+ isns_auto.ycp \
+ isns_proposal.ycp \
+ isns_finish.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ widgets.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ isns.desktop
+
+module_DATA = \
+ IsnsServer.ycp
+
+# create a symlink for local build, #145327
+isns:
+ ln -sf . $@
+ycpchook = isns
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common

Added: branches/SuSE-Code-11-Branch/isns/src/_cvsignore
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/_cvsignore?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/_cvsignore (added)
+++ branches/SuSE-Code-11-Branch/isns/src/_cvsignore Tue Jul 7 10:20:30 2009
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep

Added: branches/SuSE-Code-11-Branch/isns/src/complex.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/complex.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/complex.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/complex.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,63 @@
+/**
+ * File: include/isns-server/complex.ycp
+ * Package: Configuration of isns-server
+ * Summary: Dialogs definitions
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: complex.ycp 27936 2006-02-13 20:01:14Z olh $
+ */
+
+{
+
+textdomain "isns";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "IsnsServer";
+
+include "isns/helps.ycp";
+
+/**
+ * Return a modification status
+ * @return true if data was modified
+ */
+boolean Modified() {
+ return IsnsServer::Modified();
+}
+
+boolean ReallyAbort() {
+ return !IsnsServer::Modified() || Popup::ReallyAbort(true);
+}
+
+boolean PollAbort() {
+ return UI::PollInput() == `abort;
+}
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ // IsnsServer::AbortFunction = PollAbort;
+ boolean ret = IsnsServer::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ // IsnsServer::AbortFunction = PollAbort;
+ boolean ret = IsnsServer::Write();
+ return ret ? `next : `abort;
+}
+
+
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/dialogs.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/dialogs.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/dialogs.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,307 @@
+/**
+ * File: include/isns-server/dialogs.ycp
+ * Package: Configuration of isns-server
+ * Summary: Dialogs definitions
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: dialogs.ycp 35355 2007-01-15 15:06:49Z mzugec $
+ */
+
+{
+
+textdomain "isns";
+
+import "Label";
+import "Wizard";
+import "IsnsServer";
+import "CWMTab";
+import "CWM";
+import "CWMServiceStart";
+import "CWMFirewallInterfaces";
+import "TablePopup";
+
+include "isns/helps.ycp";
+include "isns/widgets.ycp";
+
+// store current here
+string current_tab = "service";
+
+map tabs_descr = $[
+// first tab - service status and firewall
+ "service":$[
+ "header" : _("Service"),
+ "contents" :
+ `VBox(
+ `VStretch(),
+ `HBox(
+ `HStretch(),
+ `HSpacing (1),
+ `VBox(
+ "ipaddress",
+ `VSpacing (2),
+ "auto_start_up",
+ `VSpacing (2),
+ "firewall",
+ `VSpacing (2)
+ ),
+ `HSpacing (1),
+ `HStretch()
+ ),
+ `VStretch()
+ ),
+ "widget_names" : ["ipaddress", "auto_start_up", "firewall" ]
+ ],
+
+// second tab - iSCSI Nodes
+ "members":$[
+ "header" : _("iSCSI Nodes"),
+ "contents" :
+ `VBox(
+ `VSpacing(1),
+ `HBox(
+ `HSpacing (5),
+ `VBox(
+ "iscsi_nodes_display"
+ ),
+ `HSpacing (5)
+ ),
+ `VSpacing(1)
+ ),
+ "widget_names" : [ "iscsi_nodes_display" ]
+ ],
+
+// third tab - Discovery Domains
+ "discoverydomains":$[
+ "header" : _("Discovery Domains"),
+ "contents" :
+ `VBox(
+ `HBox(
+ `HStretch(),
+ `VBox(
+ "dd_display"
+ ),
+ `HStretch()
+ ),
+ `VStretch(),
+ `HBox(
+ `HStretch(),
+ `VBox(
+ "dd_display_members"
+ ),
+ `HStretch()
+ )
+ ),
+ "widget_names" : [ "dd_display", "dd_display_members" ]
+ ],
+
+// fourth tab - discovery domain sets
+ "discoverydomainsets":$[
+ "header" : _("Discovery Domains Sets"),
+ "contents" :
+ `VBox(
+ `HBox(
+ `HStretch(),
+ `VBox(
+ "dds_display"
+ ),
+ `HStretch()
+ ),
+ `VStretch(),
+ `HBox(
+ `HStretch(),
+ `VBox(
+ "dds_display_members"
+ ),
+ `HStretch()
+ )
+ ),
+ "widget_names" : [ "dds_display", "dds_display_members" ]
+ ]
+
+ ];
+
+
+map<string, map <string, any> > widgets = $[
+ "auto_start_up" : CWMServiceStart::CreateAutoStartWidget ($[
+ "get_service_auto_start" : IsnsServer::GetStartService,
+ "set_service_auto_start" : IsnsServer::SetStartService,
+ "start_auto_button" : _("When &Booting"),
+ "start_manual_button" : _("&Manually"),
+ "help" : sformat (CWMServiceStart::AutoStartHelpTemplate (),
+ _("When Booting"),
+ _("Manually")
+ ),
+ ]),
+
+ "ipaddress" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `VBox(
+ `HBox(
+ `InputField(`id(`isnsaddress), `opt(`hstretch), _("Address of
iSNS Server"))
+ )
+ ),
+ "init" : initAddress,
+ "handle" : handleAddress,
+ "help" : HELPS["ipaddress"]:""
+ ],
+
+
+ "firewall" : CWMFirewallInterfaces::CreateOpenFirewallWidget ($[
+ "services" : [ "isns-server" ],
+ "display_details" : true,
+ ]),
+
+ "iscsi_nodes_display" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `VBox(
+ `Heading (_("iSCSI Nodes")),
+ `Table(`id(`members_table),
+ `header(_("iSCSI Node Name"),_("Node Type")),
+
+ []),
+ `Left(
+ `HBox(
+ `PushButton(`id(`delete), _("Delete"))
+ )
+ )
+ ),
+ "init" : initISCSI,
+ "handle" : handleISCSI,
+ "help" : HELPS["iscsi_display"]:""
+ ],
+
+ "dd_display" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `VBox(
+ `Heading (_("Discovery Domains")),
+ `HBox(
+ `VSpacing(5),
+ `Table(`id(`dd_table),`opt(`notify,`immediate),
+ `header(_("Discovery Domain Name")),
+ [])
+ ),
+ `Left(
+ `HBox(
+ `PushButton(`id(`add), _("Create Discovery Domain")),
+ `PushButton(`id(`delete), _("Delete")),
+ `HSpacing(25)
+ )
+ )
+ ),
+ "init" : initDiscoveryDomain,
+ "handle" : handleDiscoveryDomain,
+ "help" : HELPS["dd_display"]:""
+ ],
+
+ "dd_display_members" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `VBox(
+ `Heading (_("Discovery Domain Members")),
+ `HBox(
+ `VSpacing(10),
+ `Table(`id(`dd_members_table),
+ `header(_("iSCSI Node Name"),_("Node Type")),
+ [])
+ ),
+ `Left(
+ `HBox(
+ `PushButton(`id(`addiscsinode), _("Add Existing
iSCSI Node")),
+ `PushButton(`id(`createmember), _("Create iSCSI Node
Member")),
+ `PushButton(`id(`remove), _("Remove"))
+ )
+ )
+ ),
+ "init" : initDDISCSIMembers,
+ "handle" : handleDiscoveryDomainMembers,
+ "help" : HELPS["dd_display_members"]:""
+ ],
+
+ "dds_display" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `VBox(
+ `Heading (_("Discovery Domains Sets")),
+ `HBox(
+ `VSpacing(5),
+ `Table(`id(`dds_table),`opt(`notify,`immediate),
+ `header(_("Discovery Domain Set Name")),
+ [])
+ ),
+ `Left(
+ `HBox(
+ `PushButton(`id(`add), _("Create Discovery Domain
Set")),
+ `PushButton(`id(`delete), _("Delete")),
+ `HSpacing(25)
+ )
+ )
+ ),
+ "init" : initDiscoveryDomainSet,
+ "handle" : handleDiscoveryDomainSet,
+ "help" : HELPS["dds_display"]:""
+ ],
+
+ "dds_display_members" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `VBox(
+ `Heading (_("Discovery Domain Set Members")),
+ `HBox(
+ `VSpacing(10),
+ `Table(`id(`dds_members_table),
+ `header(_("Discovery Domain Name")),
+ [])
+ ),
+ `Left(
+ `HBox(
+ `PushButton(`id(`adddd), _("Add Discovery Domain")),
+ `PushButton(`id(`remove), _("Remove"))
+ )
+ )
+ ),
+ "init" : initDiscoveryDomainSetMembers,
+ "handle" : handleDiscoveryDomainSetMembers,
+ "help" : HELPS["dds_display_members"]:""
+ ]
+
+ ];
+
+
+/**
+ * Summary dialog
+ * @return dialog result
+ */
+// Main dialog - tabbed
+any SummaryDialog() {
+ string caption = _("iSNS Service");
+ //curr_target = "";
+ map widget_descr = $[
+ "tab": CWMTab::CreateWidget($[
+ "tab_order": [ "service","members", "discoverydomains",
"discoverydomainsets" ],
+ "tabs": tabs_descr,
+ "widget_descr": widgets,
+ "initial_tab" : current_tab,
+ "tab_help" : _("<h1>iSNS Service</h1>"),
+ ]),
+ ];
+ term contents = `VBox( "tab" );
+ list<map <string, any> > w = CWM::CreateWidgets (["tab"], (map <string,
map <string, any> >)widget_descr);
+ string help = CWM::MergeHelps(w);
+ contents = CWM::PrepareDialog(contents, w);
+
+ Wizard::SetContentsButtons(caption, contents, help, Label::BackButton (),
Label::OKButton ());
+ Wizard::SetNextButton(`next, Label::OKButton());
+ Wizard::SetAbortButton(`abort, Label::CancelButton());
+ Wizard::HideBackButton();
+// Wizard::SetContentsButtons(caption, contents, help, Label::NextButton
(), Label::FinishButton ());
+// Wizard::HideBackButton();
+
+ symbol ret = CWM::Run(w, $[`abort:ReallyAbort ]);
+ return ret;
+}
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/helps.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/helps.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/helps.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/helps.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,69 @@
+/**
+ * File: include/isns-server/helps.ycp
+ * Package: Configuration of isns-server
+ * Summary: Help texts of all the dialogs
+ * Authors:
+ *
+ * $Id: helps.ycp 35355 2007-01-15 15:06:49Z mzugec $
+ */
+
+{
+
+textdomain "isns";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing iSNS daemon configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Read dialog help 2/2 */
+ _("<p><b><big>Aborting Initialization</big></b><br>
+Safely abort the configuration utility by pressing <b>Abort</b> now.</p>
+"),
+
+ /* Write dialog help 1/2 */
+ "write" : _("<p><b><big>Saving iSNS Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Write dialog help 2/2 */
+_("<p><b><big>Aborting Saving:</big></b><br>
+Abort the save procedure by pressing <b>Abort</b>.
+An additional dialog informs whether it is safe to do so.
+</p>
+"),
+
+ /* Summary dialog help 1/3 */
+ "summary" : _("<p><b><big>iSNS Configuration</big></b><br>
+Configure an iSNS server here.<br></p>
+"),
+
+ "ipaddress" : _("<b><big>iSNS Server location</big></b><br>The DNS name or
the ip address of the iSNS service can be entered for the iSNS address.
+"),
+
+ "iscsi_display" : _(
+"<p>The list of all available iSCSI nodes registered with the iSNS service are
displayed.</p> <p>Nodes are registered by iSCSI initiators and iSCSI
targets.</p> <p> It is only possible to <b>delete</b> them. Deleting a node
removes it from the iSNS database.</p>"),
+
+ // discovery domains
+ "dd_display" : _(
+"A list of all discovery domains are displayed. For discovery domains, it is
possible to <b>Create</b> a discovery domain and <b>Delete</b> them.
<p>Deleting a domain removes the members from the domain but does not delete
the iSCSI node members </p>"),
+
+ "dd_display_members" :_(
+"A list of all iSCSI nodes are displayed by discovery domain. Selecting
another discovery domain refreshes the list with members from that discovery
domain. It is possible to <b>Add</b> an iSCSI node to a discovery domain or
<b>Delete</b> thenode. <p>Deleting a node removes it from the domain but does
not delete the iSCSI node</p> <p>Creating an iSCSI node allows a not yet
registered node to be added as a member of the discovery domain. When the
initiator or target registers this node then it becomes part of this domain</p>
<p>When an iSCSI initiator does a discovery request, the iSNS service returns
all iSCSI node targets that are members of the same Discovery Domains.</p> "),
+
+ // dds table dialog
+ "dds_display" :_(
+"At the top a list of all Discovery Domain Sets are displayed. Discovery
Domains belong to Discovery Domain Sets. <p>A Discovery Domain must be a member
of a Discovery Domain Set in order to be active. </p>In an iSNS database, a
Discovery Domain Set contains Discovery Domains and Discovery Domains contain
iSCSI Node members.</p>" ),
+
+ "dds_display_members" :_(
+"<p>The Discovery Domain Set Members list is refreshed whenever a different
Discovery Domain Set is selected.</p>" ),
+
+];
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/inst_isns.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/inst_isns.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/inst_isns.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/inst_isns.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,56 @@
+/**
+ * File: clients/isns.ycp
+ * Package: Configuration of isns
+ * Summary: Main file
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: inst_iscsi-client.ycp 35883 2007-02-06 09:51:05Z mzugec $
+ *
+ * Main file for iscsi-client configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of isns</h3>
+ */
+
+textdomain "isns";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("IsnsServer module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+import "ModuleLoading";
+import "Packages";
+import "Installation";
+include "isns/wizards.ycp";
+
+/* main ui function */
+any ret = nil;
+
+y2milestone("start isns");
+// check initiator name, create if not exists
+WFM::Execute (.local.bash,"test -d /etc/isns/ && /bin/cp -a /etc/isns/* " +
Installation::destdir + "/etc/isns/");
+//IsnsServer::checkInitiatorName();
+
+/ModuleLoading::Load("iscsi_tcp", "", "", "", false, true);
+// start daemon before
+SCR::Execute(.background.run_output_err, "isnsd");
+// run dialog
+ret = MainSequence();
+y2debug("MainSequence ret=%1", ret);
+// add package isns to installed system
+Packages::addAdditionalPackage("isns");
+
+/* Finish */
+y2milestone("IsnsServer module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/isns.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/isns.desktop?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/isns.desktop (added)
+++ branches/SuSE-Code-11-Branch/isns/src/isns.desktop Tue Jul 7 10:20:30 2009
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=Application
+Categories=Qt;X-SuSE-YaST;X-SuSE-YaST-Net_advanced;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=isns
+
+X-SuSE-YaST-Group=Net_advanced
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=all
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=isns
+
+Icon=yast-iscsi-server
+Exec=/sbin/yast2 isns
+
+Name=iSNS Server
+GenericName=Configure an iSNS server
+X-KDE-SubstituteUID=true

Added: branches/SuSE-Code-11-Branch/isns/src/isns.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/isns.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/isns.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/isns.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,73 @@
+/**
+ * File: clients/isns.ycp
+ * Package: Configuration of isns
+ * Summary: Main file
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: isns.ycp 28597 2006-03-06 11:29:38Z mzugec $
+ *
+ * Main file for isns configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of isns</h3>
+ */
+
+textdomain "isns";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("IsnsServer module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+include "isns/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "isns",
+ /* Command line help text for the Xisns module */
+ "help" : _("Configuration of an isns service"),
+ "guihandler" : IsnsServerSequence,
+ "initialize" : IsnsServer::Read,
+ "finish" : IsnsServer::Write,
+ "actions" : $[
+ // FIXME TODO: fill the functionality description here
+ ],
+ "options" : $[
+ // FIXME TODO: fill the option descriptions here
+ ],
+ "mappings" : $[
+ // FIXME TODO: fill the mappings of actions and options here
+ ]
+];
+
+/* is this proposal or not? */
+boolean propose = false;
+list args = WFM::Args();
+if(size(args) > 0) {
+ if(is(WFM::Args(0), path) && WFM::Args(0) == .propose) {
+ y2milestone("Using PROPOSE mode");
+ propose = true;
+ }
+}
+
+/* main ui function */
+any ret = nil;
+
+if(propose) ret = IsnsServerAutoSequence();
+else ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("IsnsServer module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/isns_auto.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/isns_auto.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/isns_auto.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/isns_auto.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,111 @@
+/**
+ * File: clients/isns_auto.ycp
+ * Package: Configuration of isns
+ * Summary: Client for autoinstallation
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: isns_auto.ycp 35560 2007-01-22 08:02:23Z mzugec $
+ *
+ * This is a client for autoinstallation. It takes its arguments,
+ * goes through the configuration and return the setting.
+ * Does not do any changes to the configuration.
+ */
+
+/**
+ * @param function to execute
+ * @param map/list of isns settings
+ * @return map edited settings, Summary or boolean on success depending on
called function
+ * @example map mm = $[ "FAIL_DELAY" : "77" ];
+ * @example map ret = WFM::CallFunction ("isns_auto", [ "Summary", mm ]);
+ */
+
+{
+
+textdomain "isns";
+
+y2milestone("----------------------------------------");
+y2milestone("IsnsServer auto started");
+
+import "IsnsServer";
+include "isns/wizards.ycp";
+
+any ret = nil;
+string func = "";
+map param = $[];
+
+/* Check arguments */
+if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
+ func = (string)WFM::Args(0);
+ if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
+ param = (map) WFM::Args(1);
+}
+y2debug("func=%1", func);
+y2debug("param=%1", param);
+
+/* Create a summary*/
+/*
+if(func == "Summary") {
+ ret = select(IsnsServer::Summary(), 0, "");
+}
+*/
+/* Reset configuration */
+//else
+/*
+if (func == "Reset") {
+ IsnsServer::Import($[]);
+ ret = $[];
+}
+*/
+/* Change configuration (run AutoSequence) */
+//else
+if (func == "Change") {
+ ret = IsnsServerAutoSequence();
+}
+/* Import configuration */
+/*
+else if (func == "Import") {
+ ret = IsnsServer::Import(param);
+}
+*/
+/* Return actual state */
+/*
+else if (func == "Export") {
+ ret = IsnsServer::Export();
+}
+*/
+/* Return needed packages */
+else if (func == "Packages") {
+ ret = IsnsServer::AutoPackages();
+}
+else if (func == "GetModified") {
+ ret = IsnsServer::modified;
+}
+/* Read current state */
+else if (func == "Read") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ ret = IsnsServer::Read();
+ Progress::set (progress_orig);
+}
+/* Write givven settings */
+else if (func == "Write") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ IsnsServer::write_only = true;
+ ret = IsnsServer::Write();
+ Progress::set (progress_orig);
+}
+/* Unknown function */
+else {
+ y2error("Unknown function: %1", func);
+ ret = false;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("IsnsServer auto finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/isns_finish.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/isns_finish.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/isns_finish.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/isns_finish.ycp Tue Jul 7 10:20:30
2009
@@ -0,0 +1,61 @@
+/**
+ * File:
+ * isns_finish.ycp
+ *
+ * Module:
+ * Step of base installation finish
+ *
+ * Authors:
+ * Michal Zugec <mzugec@xxxxxxx>
+ *
+ */
+
+{
+
+textdomain "isns";
+
+import "Directory";
+include "installation/misc.ycp";
+
+any ret = nil;
+string func = "";
+map param = $[];
+
+/* Check arguments */
+if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
+ func = (string)WFM::Args(0);
+ if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
+ param = (map)WFM::Args(1);
+}
+
+y2milestone ("starting scsi-client_finish");
+y2debug("func=%1", func);
+y2debug("param=%1", param);
+
+if (func == "Info")
+{
+ return (any)$[
+ "steps" : 1,
+ // progress step title
+ "title" : _("Saving iSCSI configuration..."),
+ "when" : [ `installation, `update, `autoinst ],
+ ];
+}
+else if (func == "Write")
+{
+ // write isns database of automatic connected targets
+ WFM::Execute (.local.bash,"test -d /var/lib/isns/ && /bin/cp -a
/var/lib/isns/* " + Installation::destdir + "/var/lib/isns/");
+ WFM::Execute (.local.bash,"test -d /etc/isns/ && /bin/cp -a /etc/isns/* " +
Installation::destdir + "/etc/isns/");
+}
+else
+{
+ y2error ("unknown function: %1", func);
+ ret = nil;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("isns_finish finished");
+return ret;
+
+
+} /* EOF */

Added: branches/SuSE-Code-11-Branch/isns/src/isns_proposal.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/isns_proposal.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/isns_proposal.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/isns_proposal.ycp Tue Jul 7 10:20:30
2009
@@ -0,0 +1,91 @@
+/**
+ * File: clients/isns_proposal.ycp
+ * Package: Configuration of isns-client
+ * Summary: Proposal function dispatcher.
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: isns_proposal.ycp 28596 2006-03-06 11:28:57Z mzugec $
+ *
+ * Proposal function dispatcher for isns configuration.
+ * See source/installation/proposal/proposal-API.txt
+ */
+
+{
+
+textdomain "isns";
+
+import "IsnsServer";
+import "Progress";
+
+/* The main () */
+y2milestone("----------------------------------------");
+y2milestone("IsnsServer proposal started");
+
+string func = (string) WFM::Args(0);
+map param = (map) WFM::Args(1);
+map ret = $[];
+
+/* create a textual proposal */
+if(func == "MakeProposal") {
+ string proposal = "";
+ string warning = nil;
+ symbol warning_level = nil;
+ boolean force_reset = param["force_reset"]:false;
+
+ if(force_reset || !IsnsServer::proposal_valid) {
+ IsnsServer::proposal_valid = true;
+ boolean progress_orig = Progress::set (false);
+ IsnsServer::Read();
+ Progress::set (progress_orig);
+ }
+/*
+ list sum = IsnsServer::Summary();
+ proposal = sum[0]:"";
+
+ ret = $[
+ "preformatted_proposal" : proposal,
+ "warning_level" : warning_level,
+ "warning" : warning,
+ ];
+*/
+}
+/* run the module */
+/*
+else if(func == "AskUser") {
+ map stored = IsnsServer::Export();
+ symbol seq = (symbol) WFM::CallFunction("isns", [.propose]);
+ if(seq != `next) IsnsServer::Import(stored);
+ y2debug("stored=%1",stored);
+ y2debug("seq=%1",seq);
+ ret = $[
+ "workflow_sequence" : seq
+ ];
+}
+*/
+/* create titles */
+else if(func == "Description") {
+ ret = $[
+ /* Rich text title for IsnsServer in proposals */
+ "rich_text_title" : _("iSCSI Initiator"),
+ /* Menu title for IsnsServer in proposals */
+ "menu_title" : _("&iSCSI Initiator"),
+ "id" : "isns",
+ ];
+}
+/* write the proposal */
+else if(func == "Write") {
+ IsnsServer::Write();
+}
+/* unknown function */
+else {
+ y2error("unknown function: %1", func);
+}
+
+/* Finish */
+y2debug("ret=%1",ret);
+y2milestone("IsnsServer proposal finished");
+y2milestone("----------------------------------------");
+return ret;
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/src/widgets.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/widgets.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/widgets.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/widgets.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,625 @@
+{
+
+textdomain "isns";
+import "Label";
+import "IsnsServer";
+import "String";
+import "Report";
+
+string address = ""; //global
+
+void initDiscoveryDomainSetMembers (string key);
+void initDiscoveryDomain (string key);
+void initDDISCSIMembers (string key);
+void initISCSI (string key);
+void initDiscoveryDomainPotentialISCSI (string dd_id);
+void initDiscoveryDomainPotential (string key);
+void getInputX1 (string dd_name, string dd_id);
+integer checkISNS();
+
+// **************** global funcions and variables *****
+map <string, any> DiscoveryDomainDetailDialog(map<string, any> values_before){
+ map <string, any> ret_map = $[];
+ term dd_dialog =
+ `VBox(
+ `Heading("Create New Discovery Domain"),
+ `HSpacing(50),
+ `HWeight(3,`InputField( `id( `ddentry ), `opt(`hstretch), _("Discovery
Domain Name" ))) ,
+ `VSpacing(1),
+ `HBox(
+ `HSpacing(3),
+ `VBox(
+ `Label(_("Select Discovery Domain Set to which Discovery Domain
will be added.")),
+ `SelectionBox( `id( `ddsentries), _("Discovery Domain Name Set") )
+ ),
+ `HSpacing(3)
+ ),
+ `VSpacing(1),
+ `HBox( `PushButton(`id(`ok), Label::OKButton() ),
`PushButton(`id(`cancel), Label::CancelButton() )),
+ `VSpacing(1)
+ );
+ UI::OpenDialog(dd_dialog);
+
+ list <term> inc_items = [];
+ integer count = 0;
+ string index = "";
+ string first = "";
+ foreach(string ddsentry, IsnsServer::readDDS(address), {
+ if (count == 0)
+ {
+ index = ddsentry;
+ count = 1;
+ }
+ else
+ {
+ inc_items = add(inc_items, `item(`id(index), ddsentry) );
+ count = 0;
+ if (first == "")
+ first = ddsentry;
+ }
+ });
+
+ UI::ChangeWidget(`id(`ddsentries), `Items, inc_items);
+ UI::ChangeWidget(`id(`ddsentries), `CurrentItem, first);
+
+ symbol ret = `nil;
+ while(ret != `ok && ret !=`cancel){
+ boolean enable=false;
+ ret = (symbol)UI::UserInput();
+ }
+
+ if (ret == `cancel) ret_map = $[];
+ else {
+ string dd_name = (string)UI::QueryWidget(`ddentry,`Value);
+
+ string dds_id = (string)UI::QueryWidget(`id
(`ddsentries),`CurrentItem);
+ y2milestone ("creating dd add to dds: %1",dds_id);
+ IsnsServer::addDD(address, dd_name );
+
+ integer count = 0;
+ string dd_index = "";
+ foreach(string dd, IsnsServer::readDD(address), {
+ if (count == 0)
+ {
+ dd_index = dd;
+ count = 1;
+ }
+ else
+ {
+ if ( dd == dd_name)
+ {
+ IsnsServer::addDDSMember(address, dds_id, dd_index);
+ }
+ count = 0;
+ }
+ });
+
+ ret_map = $["VALUE":dd_name];
+ }
+ UI::CloseDialog();
+ return ret_map;
+}
+
+map <string, any> DiscoveryDomainSetDetailDialog(map<string, any>
values_before){
+ map <string, any> ret_map = $[];
+ term dds_dialog =
+ `HBox(
+ `HSpacing(5),
+ `VBox(
+ `VSpacing(1),
+ `Left( `HWeight(3,`InputField( `id( `ddsentry ), `opt(`hstretch),
_("Discovery Domain Set Name") )) ),
+ `Left( `HBox( `PushButton(`id(`ok), Label::OKButton() ),
`PushButton(`id(`cancel), Label::CancelButton() ))),
+ `VSpacing(1)
+ ),
+ `HSpacing(5)
+ );
+ UI::OpenDialog(dds_dialog);
+
+ symbol ret = `nil;
+ while(ret != `ok && ret !=`cancel){
+ boolean enable=false;
+ ret = (symbol)UI::UserInput();
+ }
+
+ if (ret == `cancel) ret_map = $[];
+ else {
+ string value=(string)UI::QueryWidget(`ddsentry,`Value);
+ ret_map = $["VALUE":value];
+ }
+ UI::CloseDialog();
+ return ret_map;
+}
+
+map <string, any> CreateNode(map<string, any> values_before){
+ map <string, any> ret_map = $[];
+ term node_dialog =
+ `HBox(
+ `HSpacing(5),
+ `VBox(
+ `VSpacing(1),
+ `Left( `HWeight(3,`InputField( `id( `nodeentry ), `opt(`hstretch),
_("iSCSI Node Name"))) ),
+ `Left( `HBox( `PushButton(`id(`ok), Label::OKButton() ),
`PushButton(`id(`cancel), Label::CancelButton() ))),
+ `VSpacing(1)
+ ),
+ `HSpacing(5)
+ );
+
+ UI::OpenDialog(node_dialog);
+
+ symbol ret = `nil;
+ while(ret != `ok && ret !=`cancel){
+ boolean enable=false;
+ ret = (symbol)UI::UserInput();
+ }
+
+ if (ret == `cancel) ret_map = $[];
+ else {
+ string value=(string)UI::QueryWidget(`nodeentry,`Value);
+ ret_map = $["VALUE":value];
+ }
+ UI::CloseDialog();
+ return ret_map;
+}
+
+
+map <string, any> DisplayAllMembersDialog(string dd_name, string dd_id){
+ map <string, any> ret_map = $[];
+ term iscsi_member_dialog =
+ `VBox(
+ `Heading(_("Add iSCSI node to Discovery Domain")),
+ `Label(dd_name),
+ `HSpacing(100),
+ `Heading (_("Available Nodes to Add")),
+ `HBox(
+ `VSpacing(10),
+ `Table(`id(`members_table),
+ `header(_("Name"),_("Node Type")),
+ [])
+ ),
+ `Left(
+ `HBox(
+ `PushButton(`id(`add), _("Add Node")),
+ `PushButton(`id(`exit), _("Done"))
+ )
+ )
+ );
+ UI::OpenDialog(iscsi_member_dialog);
+
+ initDiscoveryDomainPotentialISCSI (dd_id);
+
+ symbol ret = `nil;
+ while(ret != `exit ) {
+ boolean enable=false;
+ ret = (symbol)UI::UserInput();
+ if (ret == `add)
+ {
+ y2milestone("Add a node");
+ any index = UI::QueryWidget(`id (`members_table),`CurrentItem);
+ string iqn =
((term)UI::QueryWidget(`id(`members_table),`Item(index)))[1]:"";
+ IsnsServer::addDDMember(address,dd_id,iqn);
+ initDiscoveryDomainPotentialISCSI (dd_id);
+ }
+ }
+
+ UI::CloseDialog();
+ return ret_map;
+}
+
+map <string, any> DisplayAllDiscoveryDomainsDialog(string dds_name, string
dds_id){
+ map <string, any> ret_map = $[];
+ term dds_dialog =
+ `VBox(
+ `Heading(_("Add Discovery Domain to Set")),
+ `Label(dds_name),
+ `HSpacing(50),
+ `Heading (_("Avaliable Discovery Domains")),
+ `HBox(
+ `VSpacing(10),
+ `Table(`id(`dd_table),
+ `header(_("Name")),
+ [])
+ ),
+ `Left(
+ `HBox(
+ `PushButton(`id(`add), _("Add Discovery Domain")),
+ `PushButton(`id(`exit), _("Done"))
+ )
+ )
+ );
+ UI::OpenDialog(dds_dialog);
+
+ initDiscoveryDomainPotential (dds_id);
+
+ symbol ret = `nil;
+ while(ret != `exit) {
+ boolean enable=false;
+ ret = (symbol)UI::UserInput();
+ if (ret == `add)
+ {
+ y2milestone("Add a dds member");
+ string dd_id = (string)UI::QueryWidget(`id
(`dd_table),`CurrentItem);
+ IsnsServer::addDDSMember(address,dds_id,dd_id);
+ initDiscoveryDomainPotential (dds_id);
+ }
+ }
+
+ UI::CloseDialog();
+ return ret_map;
+}
+
+
+void initAddress (string key){
+ address = ((map<string, any>)SCR::Execute(.target.bash_output,"cat
/etc/isns.conf|cut -d'=' -f2|tr -d '\n'"))["stdout"]:"";
+ UI::ChangeWidget(`isnsaddress, `Value, address);
+}
+
+void initISCSI (string key){
+ integer count = 0;
+ string type = _("Target or Initiator");
+ list <term> inc_items = [];
+
+ checkISNS();
+
+ foreach(map <string,any> key, IsnsServer::readISCSI(address), {
+ inc_items = add(inc_items, `item(`id(count),
key["NODE"]:"",key["TYPE"]:""));
+ count = count + 1;
+ });
+
+ UI::ChangeWidget(`id(`members_table), `Items, inc_items);
+}
+
+void initDiscoveryDomainPotentialISCSI (string key){
+ integer count = 0;
+ string type = _("Target or Initiator");
+ list <term> inc_items = [];
+ string iscsinode="";
+ list <map <string,any> > ddmembers= [];
+ string found="FALSE";
+
+ ddmembers = IsnsServer::readDDMembers(address, key);
+
+ foreach(map <string,any> iscsinode, IsnsServer::readISCSI(address), {
+ found = "FALSE";
+ foreach(map <string,any> ddmember, ddmembers, {
+ if ( ddmember["NODE"]:"" == iscsinode["NODE"]:"" )
+ found = "TRUE";
+ });
+
+ if ( found == "FALSE" )
+ {
+ inc_items = add(inc_items, `item(`id(count),
iscsinode["NODE"]:"",iscsinode["TYPE"]:""));
+ count = count + 1;
+ }
+ });
+
+ UI::ChangeWidget(`id(`members_table), `Items, inc_items);
+}
+
+void initDDISCSIMembers (string key) ``{
+ integer count = 0;
+ string index="";
+ string ddid="";
+ list <term> inc_items = [];
+
+ y2milestone("initDDISCSIMembers key is:%1",key);
+ if ( key == "dd_display_members" )
+ key = (string)UI::QueryWidget(`id(`dd_table),`CurrentItem);
+
+ ddid=key;
+ foreach(map <string,any> result, IsnsServer::readDDMembers(address,ddid), {
+ y2milestone("iscsiMembers: %1",key);
+ inc_items = add(inc_items, `item(`id(count),
result["NODE"]:"",result["TYPE"]:""));
+ count = count +1;
+ });
+
+ UI::ChangeWidget(`id(`dd_members_table), `Items, inc_items);
+}
+
+void initDiscoveryDomain (string key) ``{
+ integer count = 0;
+ string index="";
+ list <term> inc_items = [];
+
+ checkISNS();
+
+ foreach(string dd, IsnsServer::readDD(address), {
+ if (count == 0)
+ {
+ index = dd;
+ count = 1;
+ }
+ else
+ {
+ inc_items = add(inc_items, `item(`id(index), dd));
+ count = 0;
+ }
+ });
+
+ UI::ChangeWidget(`id(`dd_table), `Items, inc_items);
+}
+
+void initDiscoveryDomainPotential (string key) ``{
+ integer count = 0;
+ string index="";
+ list <term> inc_items = [];
+ list <string> ddsmembers= [];
+ string found = "FALSE";
+
+ ddsmembers = IsnsServer::readDDSMembers(address, key);
+
+ foreach(string dd, IsnsServer::readDD(address), {
+ if (count == 0)
+ {
+ index = dd;
+ count = 1;
+ }
+ else
+ {
+ found = "FALSE";
+ foreach(string ddsmember, ddsmembers, {
+ if ( ddsmember == dd )
+ found = "TRUE";
+ });
+
+ if ( found == "FALSE" )
+ {
+ inc_items = add(inc_items, `item(`id(index), dd));
+ }
+ count = 0;
+ }
+ });
+
+ UI::ChangeWidget(`id(`dd_table), `Items, inc_items);
+}
+
+void initDiscoveryDomainSet (string key) ``{
+ integer count = 0;
+ string index="";
+
+ list <term> inc_items = [];
+
+ y2milestone("isnsaddress is %1",address);
+
+ checkISNS();
+
+ foreach(string key, IsnsServer::readDDS(address), {
+ if (count == 0)
+ {
+ index = key;
+ count = 1;
+ }
+ else
+ {
+ inc_items = add(inc_items, `item(`id(index), key));
+ count = 0;
+ }
+ });
+
+ UI::ChangeWidget(`id(`dds_table), `Items, inc_items);
+
+}
+
+void initDiscoveryDomainSetMembers (string key) {
+ integer count = 0;
+ string index="";
+ list <term> inc_items = [];
+ string dds_id = "";
+
+ if ( key == "dds_display_members" )
+ key = (string)UI::QueryWidget(`id(`dds_table),`CurrentItem);
+
+ dds_id = key;
+
+ foreach(string key, IsnsServer::readDDSMembers(address,dds_id), {
+ y2milestone("results received: %1",key);
+ if (count == 0)
+ {
+ index = key;
+ count = 1;
+ }
+ else
+ {
+ inc_items = add(inc_items, `item(`id(index), key));
+ count = 0;
+ }
+ });
+
+ UI::ChangeWidget(`id(`dds_members_table), `Items, inc_items);
+}
+
+
+symbol handleAddress(string key, map event){
+ address=(string)UI::QueryWidget(`isnsaddress,`Value);
+ SCR::Execute(.target.bash_output, sformat("echo
\"isns_address=%1\">/etc/isns.conf",address));
+ y2milestone("isnsaddress is %1",address);
+ return nil;
+}
+
+
+symbol handleISCSI(string key, map event){
+ if ( event["EventReason"]:"" == "Activated" ){
+ switch((symbol)event["WidgetID"]:nil){
+ case `delete:
+ any del = UI::QueryWidget(`id (`members_table),`CurrentItem);
+ if (del != nil)
+ {
+ if (Popup::ContinueCancel(_("Really delete the selected item?")))
+ {
+ string discoverydomainsetname =
((term)UI::QueryWidget(`id(`members_table), `Item(del)))[1]:"";
+ IsnsServer::deleteISCSI(address,discoverydomainsetname);
+ initISCSI ("");
+ }
+ else
+ y2milestone("Delete canceled");
+ }
+ break;
+ }
+ }
+}
+
+symbol handleDiscoveryDomain(string key, map event){
+
+ if ( event["EventReason"]:"" == "SelectionChanged" ){
+ y2milestone("selectionChangedEvent");
+ string dd_id = (string)UI::QueryWidget(`id(`dd_table),`CurrentItem);
+ y2milestone("selectionChangedEvent - dd-id:%1",dd_id);
+ initDDISCSIMembers(dd_id);
+ }
+
+ else if ( event["EventReason"]:"" == "Activated" ){
+ y2milestone("handleDiscoveryDomainCalled:Activated");
+ switch((symbol)event["WidgetID"]:nil){
+ case `delete:
+ string del = (string)UI::QueryWidget(`id (`dd_table),`CurrentItem);
+ if (del != nil)
+ {
+ if (Popup::ContinueCancel(_("Really delete this domain?")))
+ {
+ IsnsServer::deleteDD(address,del);
+ initDiscoveryDomain ("");
+ }
+ else
+ y2milestone("Delete canceled");
+ }
+ break;
+ case `add:
+ map<string, any> add_map = DiscoveryDomainDetailDialog($["VALUE":""]);
+ if (add_map!=$[])
+ {
+ // IsnsServer::addDD(address, add_map["VALUE"]:"");
+ initDiscoveryDomain ("");
+ }
+ break;
+ }
+ }
+}
+
+symbol handleDiscoveryDomainSet(string key, map event){
+ string mycurrent = (string)UI::QueryWidget(`id (`dds_table),`CurrentItem);
+ y2milestone("handleDiscoveryDomainSet action called: %1 -- %2 -- %3", key,
event, mycurrent);
+
+ if ( event["EventReason"]:"" == "SelectionChanged" ){
+ y2milestone("selectionChangedEvent");
+ string dds_id = (string)UI::QueryWidget(`id(`dds_table),`CurrentItem);
+ y2milestone("selectionChangedEvent - dds-id:%1",dds_id);
+ initDiscoveryDomainSetMembers(dds_id);
+ }
+
+ if ( event["EventReason"]:"" == "Activated" ){
+ switch((symbol)event["WidgetID"]:nil){
+ case `delete:
+ string del = (string)UI::QueryWidget(`id (`dds_table),`CurrentItem);
+ if (del != nil){
+ if (Popup::ContinueCancel(_("Really delete the selected item?"))) {
+ IsnsServer::deleteDDS(address,del);
+ initDiscoveryDomainSet ("");
+ }
+ else
+ y2milestone("Delete canceled");
+ }
+ break;
+ case `add:
+ map<string, any> add_map = DiscoveryDomainSetDetailDialog($["VALUE":""]);
+ if (add_map!=$[]){
+ IsnsServer::addDDS(address, add_map["VALUE"]:"");
+ initDiscoveryDomainSet ("");
+ }
+ break;
+ }
+ }
+}
+
+}
+
+symbol handleDiscoveryDomainMembers(string key, map event)
+{
+ if ( event["EventReason"]:"" == "Activated" ){
+ switch((symbol)event["WidgetID"]:nil){
+ case `delete:
+ {
+ // domain deleted, but we get this event so update the members
table
+ string dd_id =
(string)UI::QueryWidget(`id(`dd_table),`CurrentItem);
+ initDDISCSIMembers (dd_id);
+ break;
+ }
+ case `remove:
+ {
+ any iqn = UI::QueryWidget(`id (`dd_members_table),`CurrentItem);
+ string dd_name =
((term)UI::QueryWidget(`id(`dd_members_table),`Item(iqn)))[1]:"";
+ string dd_id =
(string)UI::QueryWidget(`id(`dd_table),`CurrentItem);
+ IsnsServer::deleteDDMember(address,dd_id,dd_name);
+ initDDISCSIMembers (dd_id);
+ break;
+ }
+ case `addiscsinode:
+ {
+ string dd_id =
(string)UI::QueryWidget(`id(`dd_table),`CurrentItem);
+ string dd_name =
((term)UI::QueryWidget(`id(`dd_table),`Item(dd_id)))[1]:"";
+ map<string, any> add_map1 =
DisplayAllMembersDialog(dd_name,dd_id);
+ initDDISCSIMembers (dd_id);
+ break;
+ }
+ case `createmember:
+ {
+ string dd_id =
(string)UI::QueryWidget(`id(`dd_table),`CurrentItem);
+ string dd_name =
((term)UI::QueryWidget(`id(`dd_table),`Item(dd_id)))[1]:"";
+
+ map<string, any> add_map = CreateNode($["VALUE":""]);
+ if (add_map!=$[]){
+ IsnsServer::addDDMember (address, dd_id,
add_map["VALUE"]:"");
+ }
+
+ initDDISCSIMembers (dd_id);
+
+ break;
+ }
+ }
+ }
+}
+
+symbol handleDiscoveryDomainSetMembers(string key, map event)
+{
+ if ( event["EventReason"]:"" == "Activated" ){
+ switch((symbol)event["WidgetID"]:nil){
+ case `delete:
+ {
+ // domain Set deleted, but we get this event so update the
members table
+ string dds_id =
(string)UI::QueryWidget(`id(`dds_table),`CurrentItem);
+ initDiscoveryDomainSetMembers (dds_id);
+ break;
+ }
+ case `remove:
+ {
+ y2milestone("Unassign a dds member");
+ string dds_id =
(string)UI::QueryWidget(`id(`dds_table),`CurrentItem);
+ string dd_id = (string)UI::QueryWidget(`id
(`dds_members_table),`CurrentItem);
+ IsnsServer::deleteDDSMember(address,dds_id,dd_id);
+ initDiscoveryDomainSetMembers (dds_id);
+ break;
+ }
+ case `adddd:
+ {
+ y2milestone("Add a dds member");
+ string dds_id =
(string)UI::QueryWidget(`id(`dds_table),`CurrentItem);
+ string dds_name =
((term)UI::QueryWidget(`id(`dds_table),`Item(dds_id)))[1]:"";
+ map<string, any> add_map1 =
DisplayAllDiscoveryDomainsDialog(dds_name,dds_id);
+ initDiscoveryDomainSetMembers (dds_id);
+ break;
+ }
+ }
+ }
+}
+
+integer checkISNS()
+{
+ string isns_status = IsnsServer::testISNSAccess(address);
+ if (isns_status != "OK")
+ {
+// boolean display = true;
+// Report::DisplayErrors(display,10);
+ Report::Error(_("Unable to connection to iSNS server. Check iSNS
server address"));
+ return 1;
+ }
+
+ return 0;
+}

Added: branches/SuSE-Code-11-Branch/isns/src/wizards.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/src/wizards.ycp?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/src/wizards.ycp (added)
+++ branches/SuSE-Code-11-Branch/isns/src/wizards.ycp Tue Jul 7 10:20:30 2009
@@ -0,0 +1,105 @@
+/**
+ * File: include/isns-server/wizards.ycp
+ * Package: Configuration of isns-server
+ * Summary: Wizards definitions
+ * Authors: Michal Zugec <mzugec@xxxxxxx>
+ *
+ * $Id: wizards.ycp 35355 2007-01-15 15:06:49Z mzugec $
+ */
+
+{
+
+textdomain "isns";
+
+import "Sequencer";
+import "Wizard";
+
+include "isns/complex.ycp";
+include "isns/dialogs.ycp";
+
+
+/**
+ * Main workflow of the isns-server configuration
+ * @return sequence result
+ */
+any MainSequence() {
+
+ /* FIXME: adapt to your needs */
+ map aliases = $[
+ "summary" : ``( SummaryDialog() ),
+ ];
+
+ /* FIXME: adapt to your needs */
+ map sequence = $[
+ "ws_start" : "summary",
+ "summary" : $[
+ `abort : `abort,
+ `next : `next,
+ ],
+ ];
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ return ret;
+}
+
+/**
+ * Whole configuration of isns-server
+ * @return sequence result
+ */
+any IsnsServerSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ "write" : [ ``( WriteDialog() ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/**
+ * Whole configuration of isns-server but without reading and writing.
+ * For use with autoinstallation.
+ * @return sequence result
+ */
+any IsnsServerAutoSequence() {
+
+ /* Initialization dialog caption */
+ string caption = _("isns daemon configuration");
+ /* Initialization dialog contents */
+ term contents = `Label(_("Initializing..."));
+
+ Wizard::CreateDialog();
+ Wizard::SetContentsButtons(caption, contents, "",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = MainSequence();
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-Branch/isns/testsuite/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/testsuite/Makefile.am?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/testsuite/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/isns/testsuite/Makefile.am Tue Jul 7 10:20:30
2009
@@ -0,0 +1,21 @@
+#
+# Makefile.am for .../testsuite
+#
+# Do not edit this file (Makefile.am) as it will be overwritten!
+#
+
+AUTOMAKE_OPTIONS = dejagnu
+EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard
tests/*.ycp) $(wildcard tests/*.yh)
+
+testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite
+
+all-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir)
+
+clean-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) clean
+
+check-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) check
+
+# EOF

Added: branches/SuSE-Code-11-Branch/isns/testsuite/_cvsignore
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/testsuite/_cvsignore?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/testsuite/_cvsignore (added)
+++ branches/SuSE-Code-11-Branch/isns/testsuite/_cvsignore Tue Jul 7 10:20:30
2009
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test

Added: branches/SuSE-Code-11-Branch/isns/testsuite/tests/_cvsignore
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/testsuite/tests/_cvsignore?rev=57881&view=auto
==============================================================================
(empty)

Added: branches/SuSE-Code-11-Branch/isns/yast2-isns.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/isns/yast2-isns.spec.in?rev=57881&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/isns/yast2-isns.spec.in (added)
+++ branches/SuSE-Code-11-Branch/isns/yast2-isns.spec.in Tue Jul 7 10:20:30
2009
@@ -0,0 +1,32 @@
+@HEADER-COMMENT@
+
+@HEADER@
+Requires: yast2
+BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools
yast2-testsuite
+
+BuildArchitectures: noarch
+
+Summary: Configuration of isns
+
+%description
+-
+
+@PREP@
+
+@BUILD@
+
+@INSTALL@
+
+@CLEAN@
+
+%files
+%defattr(-,root,root)
+%dir @yncludedir@/isns
+@yncludedir@/isns/*
+@clientdir@/isns.ycp
+@clientdir@/isns_*.ycp
+@moduledir@/*.ycp
+@moduledir@/*.ybc
+@desktopdir@/isns.desktop
+@scrconfdir@/*.scr
+%doc @docdir@

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages