Mailinglist Archive: yast-commit (687 mails)

< Previous Next >
[yast-commit] r43542 - in /trunk/iscsi-server: VERSION package/yast2-iscsi-server.changes src/IscsiServer.ycp src/IscsiServerFunctions.pm src/dialogs.ycp src/widgets.ycp
  • From: mzugec@xxxxxxxxxxxxxxxx
  • Date: Thu, 10 Jan 2008 18:20:15 -0000
  • Message-id: <20080110182016.2036812E1D3@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Thu Jan 10 19:20:15 2008
New Revision: 43542

URL: http://svn.opensuse.org/viewcvs/yast?rev=43542&view=rev
Log:
added iSNS support (FaTE #302083)

Modified:
trunk/iscsi-server/VERSION
trunk/iscsi-server/package/yast2-iscsi-server.changes
trunk/iscsi-server/src/IscsiServer.ycp
trunk/iscsi-server/src/IscsiServerFunctions.pm
trunk/iscsi-server/src/dialogs.ycp
trunk/iscsi-server/src/widgets.ycp

Modified: trunk/iscsi-server/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/iscsi-server/VERSION?rev=43542&r1=43541&r2=43542&view=diff
==============================================================================
--- trunk/iscsi-server/VERSION (original)
+++ trunk/iscsi-server/VERSION Thu Jan 10 19:20:15 2008
@@ -1 +1 @@
-2.14.3
+2.14.4

Modified: trunk/iscsi-server/package/yast2-iscsi-server.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/iscsi-server/package/yast2-iscsi-server.changes?rev=43542&r1=43541&r2=43542&view=diff
==============================================================================
--- trunk/iscsi-server/package/yast2-iscsi-server.changes (original)
+++ trunk/iscsi-server/package/yast2-iscsi-server.changes Thu Jan 10 19:20:15
2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Jan 10 19:19:10 CET 2008 - mzugec@xxxxxxx
+
+- added iSNS support (FaTE #302083)
+- 2.14.4
+
+-------------------------------------------------------------------
Fri Nov 9 10:29:58 CET 2007 - mzugec@xxxxxxx

- fixed description in file dialogs

Modified: trunk/iscsi-server/src/IscsiServer.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/iscsi-server/src/IscsiServer.ycp?rev=43542&r1=43541&r2=43542&view=diff
==============================================================================
--- trunk/iscsi-server/src/IscsiServer.ycp (original)
+++ trunk/iscsi-server/src/IscsiServer.ycp Thu Jan 10 19:20:15 2008
@@ -132,7 +132,6 @@
{
Popup::Error( Message::CannotContinueWithoutPackagesInstalled() );
} else ret = true;
-
return ret;
}


Modified: trunk/iscsi-server/src/IscsiServerFunctions.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/iscsi-server/src/IscsiServerFunctions.pm?rev=43542&r1=43541&r2=43542&view=diff
==============================================================================
--- trunk/iscsi-server/src/IscsiServerFunctions.pm (original)
+++ trunk/iscsi-server/src/IscsiServerFunctions.pm Thu Jan 10 19:20:15 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: trunk/iscsi-server/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/iscsi-server/src/dialogs.ycp?rev=43542&r1=43541&r2=43542&view=diff
==============================================================================
--- trunk/iscsi-server/src/dialogs.ycp (original)
+++ trunk/iscsi-server/src/dialogs.ycp Thu Jan 10 19:20:15 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: trunk/iscsi-server/src/widgets.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/iscsi-server/src/widgets.ycp?rev=43542&r1=43541&r2=43542&view=diff
==============================================================================
--- trunk/iscsi-server/src/widgets.ycp (original)
+++ trunk/iscsi-server/src/widgets.ycp Thu Jan 10 19:20:15 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<string, any> row, IscsiServerFunctions::getConfig()["iSNS"]:[], {
+ if(row["KEY"]:""=="iSNSAccessControl") ac=(row["VALUE"]:"No"=="Yes") ? true :
false;
+ if(row["KEY"]:""=="iSNSServer") ip=row["VALUE"]:"";
+});
+UI::ChangeWidget(`isns_ac, `Value, ac);
+UI::ChangeWidget(`isns_ip, `Value, ip);
+}
+
+boolean validateiSNS(string key, map event){
+ string ip = (string)UI::QueryWidget(`isns_ip, `Value);
+ boolean valid=true;
+ if (size(ip)>0) valid = IP::Check(ip);
+ else valid= true;
+ if (!valid)Popup::Error (_("Invalid IP address."));
+ return valid;
+}
+
+void storeiSNS(string option_id, map option_map){
+ string ip = (string)UI::QueryWidget(`isns_ip, `Value);
+ string ac=((boolean)UI::QueryWidget(`isns_ac, `Value))?"Yes":"No";
+ if (ip=="") ac="";
+ IscsiServerFunctions::setiSNS(ip, ac);
+}
+
+
// **************** Global Dialog *********************
void initGlobalValues(list<map<string, any> > values){
setAuthIn(false);

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

< Previous Next >
This Thread
  • No further messages