Author: mzugec
Date: Thu Jan 10 19:33:45 2008
New Revision: 43544
URL: http://svn.opensuse.org/viewcvs/yast?rev=43544&view=rev
Log:
added support for iSNS (FaTE #302083)
Modified:
branches/SuSE-SLE-10-SP2-Branch/iscsi-server/VERSION
branches/SuSE-SLE-10-SP2-Branch/iscsi-server/package/yast2-iscsi-server.changes
branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServer.ycp
branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServerFunctions.pm
branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/dialogs.ycp
branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/widgets.ycp
Modified: branches/SuSE-SLE-10-SP2-Branch/iscsi-server/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/iscsi-server/VERSION?rev=43544&r1=43543&r2=43544&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/iscsi-server/VERSION (original)
+++ branches/SuSE-SLE-10-SP2-Branch/iscsi-server/VERSION Thu Jan 10 19:33:45 2008
@@ -1 +1 @@
-2.13.25
+2.13.26
Modified: branches/SuSE-SLE-10-SP2-Branch/iscsi-server/package/yast2-iscsi-server.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/iscsi-server/package/yast2-iscsi-server.changes?rev=43544&r1=43543&r2=43544&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/iscsi-server/package/yast2-iscsi-server.changes (original)
+++ branches/SuSE-SLE-10-SP2-Branch/iscsi-server/package/yast2-iscsi-server.changes Thu Jan 10 19:33:45 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Jan 10 20:32:53 CET 2008 - mzugec@suse.de
+
+- added support for iSNS (FaTE #302083)
+- 2.13.26
+
+-------------------------------------------------------------------
Tue Mar 6 12:51:03 CET 2007 - mzugec@suse.cz
- iscsi-server writes to stdout (#250628)
Modified: branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServer.ycp?rev=43544&r1=43543&r2=43544&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServer.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServer.ycp Thu Jan 10 19:33:45 2008
@@ -132,7 +132,6 @@
{
Popup::Error( Message::CannotContinueWithoutPackagesInstalled() );
} else ret = true;
-
return ret;
}
Modified: branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServerFunctions.pm
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServerFunctions.pm?rev=43544&r1=43543&r2=43544&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServerFunctions.pm (original)
+++ branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/IscsiServerFunctions.pm Thu Jan 10 19:33:45 2008
@@ -30,16 +30,23 @@
my $scope="auth";
foreach my $row ( @$values ){
+
if ($$row{'name'} eq 'Target'){
$scope = $$row{'value'};
$config{$scope} = [ {'KEY' => 'Target', 'VALUE' => $scope } ];
- } else {
+ } else {
+
+ if ( $$row{'name'}=~'iSNS' ) {$scope = 'iSNS';}
+ else {
+ $scope='auth' if ($scope eq 'iSNS');
+ }
+
if (!ref($config{$scope})) {
$config{$scope} = [ {'KEY' => $$row{'name'}, 'VALUE' => $$row{'value'} } ];
} else {
- push(@{$config{$scope}}, ({'KEY'=>$$row{'name'}, 'VALUE'=>$$row{'value'}}));
- }
+ push(@{$config{$scope}}, ({'KEY'=>$$row{'name'}, 'VALUE'=>$$row{'value'}}));
}
+ }
};
return \%config;
}
@@ -77,7 +84,7 @@
sub getTargets {
my $self = shift;
- return $self->removeKeyFromMap(\%config, 'auth');
+ return $self->removeKeyFromMap($self->removeKeyFromMap(\%config, 'auth'), 'iSNS');
}
# set discovery authentication
@@ -96,6 +103,19 @@
$config{'auth'}=\@tmp_auth;
}
+# set iSNS data
+BEGIN { $TYPEINFO{setiSNS} = ["function", "void", "string", "string" ]; }
+sub setiSNS {
+ my $self = shift;
+ my $ip = shift;
+ my $ac = shift;
+ my @isns = ();
+
+
+ push(@isns, {'KEY'=>'iSNSServer', 'VALUE'=>$ip}) if ($ip ne '');
+ push(@isns, {'KEY'=>'iSNSAccessControl', 'VALUE'=>$ac}) if ($ac ne '');
+ $config{'iSNS'}=\@isns;
+}
# set authentication for given target
BEGIN { $TYPEINFO{setTargetAuth} = ["function", "void", "string", ["list", "string"], "string" ]; }
sub setTargetAuth {
@@ -203,22 +223,6 @@
return $ret;
}
-# get highest lun +1
-#BEGIN { $TYPEINFO{getNextLun} = [ "function", "integer" ] ; }
-#sub getNextLun {
-# my $self = shift;
-# my $lun = -1;
-# foreach my $target (keys %{$self->removeKeyFromMap(\%config, 'auth')}){
-# foreach my $tmp_hash (@{$config{$target}}){
-# if ($$tmp_hash{'KEY'} eq 'Lun'){
-# if ($$tmp_hash{'VALUE'}=~/([\d]+)[\s]*/) {
-# $lun=$1 if ($1>$lun);
-# }
-# }
-# }
-# }
-# return $lun+1;
-#}
# internal function
# create map from given map in format needed by ini-agent
@@ -263,6 +267,7 @@
$scope = $$row{'value'};
$new_config{$scope} = [ $row ];
} else {
+
if (!ref($new_config{$scope})) {
$new_config{$scope} = [ $row ];
} else {
@@ -270,7 +275,6 @@
}
}
};
-
# deleted items add to $changes{'del'}
foreach my $key (keys %new_config){
if (! defined $config{$key}){
@@ -302,8 +306,10 @@
$new_config{$key} = \@new;
}
}
- # write 'auth' into %new_config
- $config_file{'value'} = $new_config{'auth'};
+ # write 'iSNS' and 'auth' into %new_config
+ $config_file{'value'} = $new_config{'iSNS'};
+ delete ($new_config{'iSNS'});
+ @{$config_file{'value'}} = (@{$config_file{'value'}}, @{$new_config{'auth'}}) ;
delete ($new_config{'auth'});
#write all targets into %new_config
foreach my $key (reverse(keys %new_config )){
Modified: branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/dialogs.ycp?rev=43544&r1=43543&r2=43544&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/dialogs.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/dialogs.ycp Thu Jan 10 19:33:45 2008
@@ -46,6 +46,8 @@
`VBox(
"auto_start_up",
`VSpacing (2),
+ "isns",
+ `VSpacing (2),
"firewall",
`VSpacing (2)
),
@@ -54,7 +56,7 @@
),
`VStretch()
),
- "widget_names" : [ "auto_start_up", "firewall" ]
+ "widget_names" : [ "auto_start_up", "isns", "firewall" ]
],
// second tab - global authentication
"global":$[
@@ -172,6 +174,18 @@
"services" : [ "iscsi-server" ],
"display_details" : true,
]),
+ "isns" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `HBox(
+ `CheckBox(`id(`isns_ac), _("iSNS Access Control")),
+ `TextEntry(`id(`isns_ip), _("iSNS Server"))
+ ),
+ "init" : initiSNS,
+ "validate_type" : `function,
+ "validate_function" : validateiSNS,
+ "store" : storeiSNS
+ ],
// discovery authentication dialog
"global_config" : $[
@@ -303,7 +317,7 @@
contents = CWM::PrepareDialog(contents, w);
Wizard::SetContentsButtons(caption, contents, help, Label::NextButton (), Label::FinishButton ());
- Wizard::HideBackButton();
+ Wizard::DisableBackButton();
symbol ret = CWM::Run(w, $[`abort:ReallyAbort ]);
return ret;
Modified: branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/widgets.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/widgets.ycp?rev=43544&r1=43543&r2=43544&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/widgets.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/iscsi-server/src/widgets.ycp Thu Jan 10 19:33:45 2008
@@ -3,6 +3,7 @@
textdomain "iscsi-server";
import "IscsiServerFunctions";
import "Label";
+import "IP";
// **************** global funcions and variables *****
string curr_target = "";
string modify_record = "";
@@ -239,6 +240,34 @@
return inc_items;
}
+void initiSNS (string key) ``{
+boolean ac=false;
+string ip = "";
+foreach(map