Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65200 - in /branches/SuSE-Code-11-SP2-Branch/fcoe-client/src: FcoeClient.ycp complex.ycp dialogs.ycp
Author: gs
Date: Thu Aug 4 11:52:49 2011
New Revision: 65200

URL: http://svn.opensuse.org/viewcvs/yast?rev=65200&view=rev
Log:
add column AUTO VLAN, use String::StartsWith

Modified:
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/dialogs.ycp

Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp?rev=65200&r1=65199&r2=65200&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp Thu Aug 4
11:52:49 2011
@@ -44,6 +44,7 @@
import "Popup";
import "Service";
import "NetworkService";
+import "String";

/**
* Prototypes
@@ -313,9 +314,9 @@
// check whether there is a line for the given interface, e.g.
// eth3 | 200 | 00:0d:ec:a2:ef:00\n
// and extract name/number of VLAN channel.
- if ( regexpmatch( line, sformat( "^%1", interface) ) )
+ if ( String::StartsWith( line, interface ) )
{
- line = deletechars( line, " " );
+ line = deletechars( line, " \t" );
vlan_interface = substring( line, findfirstof( line, "|" )+1,
findlastof( line, "|"
)-findfirstof( line, "|")-1 );
y2milestone( "VLAN: %1", vlan_interface );
@@ -388,9 +389,9 @@
// (e.g. eth3.200) then set AUTO_VLAN to "no"
list <string> lines = (list<string>)splitstring( content, "\n"
);
lines = maplist( string line, lines, {
- if ( regexpmatch( line, "^AUTO_VLAN" ) )
+ if ( String::StartsWith( line, "AUTO_VLAN" ) )
{
- return sformat( "AUTO_VLAN=\"%1\"", "no" );
+ return "AUTO_VLAN=\"no\"";
}
else
{
@@ -426,18 +427,15 @@
{
list <string> lines = splitstring( content, "\n" );
foreach( string line, (list<string>)lines, {
- if ( regexpmatch( line, "^FCOE_ENABLE" ) )
- {
- status_map = add( status_map, "FCOE_ENABLE",
deletechars( substring(line, 12), "\"") );
- }
- if ( regexpmatch( line, "^DCB_REQUIRED" ) )
- {
- status_map = add( status_map, "DCB_REQUIRED",
deletechars( substring( line, 13 ),"\"") );
- }
- if ( regexpmatch( line, "^AUTO_VLAN" ) )
- {
- status_map = add( status_map, "AUTO_VLAN", deletechars(
substring( line, 10 ),"\"") );
- }
+ line = deletechars( line, " \t" );
+ foreach( string var, ["FCOE_ENABLE", "DCB_REQUIRED",
"AUTO_VLAN"], {
+ if ( String::StartsWith(line, var) )
+ {
+ status_map = add( status_map, var,
+ deletechars( substring(line,
size(var) + 1), "\"") );
+ }
+ });
+
});
status_map = add( status_map, "Filename", file_name );
}
@@ -471,7 +469,7 @@
{
list <string> lines = splitstring( output["stdout"]:"", "\n" );
foreach( string line, (list<string>)lines, {
- if ( regexpmatch( line, "^Status" ) )
+ if ( String::StartsWith( line, "Status" ) )
{
// Status: Failed interface not DCB
capable
// Status: Successful
@@ -593,8 +591,8 @@
}

//
-// dev_name device fcoe_vlan fcoe_enable dcb_required
dcb_capable vlan_interface cfg_file
-// eth3 Ethernet card ... eth3.200 yes/no yes/no yes/no
200 /etc/fcoe/cfg-eth3.200
+// dev_name device fcoe_vlan fcoe_enable dcb_required auto_vlan
dcb_capable vlan_interface cfg_file
+// eth3 Ethernet card ... eth3.200 yes/no yes/no yes/no
yes/no 200 /etc/fcoe/cfg-eth3.200
//
// Detect network interface cards (hardware probe) and get status
//
@@ -721,15 +719,16 @@

list <string> lines = (list<string>)splitstring( content, "\n"
);
lines = maplist( string line, lines, {
- if ( regexpmatch( line, "^FCOE_ENABLE" ) )
+ line = deletechars( line, " \t" );
+ if ( String::StartsWith( line, "FCOE_ENABLE" ) )
{
return sformat( "FCOE_ENABLE=\"%1\"",
card["fcoe_enable"]:"no" );
}
- else if ( regexpmatch( line, "^DCB_REQUIRED" ) )
+ else if ( String::StartsWith( line, "DCB_REQUIRED" ) )
{
return sformat( "DCB_REQUIRED=\"%1\"",
card["dcb_required"]:"no" );
}
- else if ( regexpmatch( line, "^AUTO_VLAN" ) )
+ else if ( String::StartsWith( line, "AUTO_VLAN" ) )
{
return sformat( "AUTO_VLAN=\"%1\"",
card["auto_vlan"]:"no" );
}

Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp?rev=65200&r1=65199&r2=65200&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp Thu Aug 4
11:52:49 2011
@@ -188,7 +188,7 @@
foreach ( map card, (list<map>)netcards, {
table_items = add( table_items,
`item(`id(row), card["dev_name"]:"",
card["device"]:"", card["fcoe_vlan"]:"",
- card["fcoe_enable"]:"",
card["dcb_required"]:"", card["dcb_capable"]:"" )
+ card["fcoe_enable"]:"",
card["dcb_required"]:"", card["auto_vlan"]:"", card["dcb_capable"]:"" )
);
row = row + 1;
});
@@ -412,6 +412,7 @@
UI::ChangeWidget( `id( `interfaces), `Cell( FcoeClient::current_card,
2), fcoe_vlan_interface );
UI::ChangeWidget( `id( `interfaces), `Cell( FcoeClient::current_card,
3), status_map["FCOE_ENABLE"]:"" );
UI::ChangeWidget( `id( `interfaces), `Cell( FcoeClient::current_card,
4), status_map["DCB_REQUIRED"]:"" );
+ UI::ChangeWidget( `id( `interfaces), `Cell( FcoeClient::current_card,
5), status_map["AUTO_VLAN"]:"" );
AdjustButtons();
}
else if ( action == `remove )
@@ -456,6 +457,7 @@
UI::ChangeWidget( `id( `interfaces), `Cell(
FcoeClient::current_card, 2), card["fcoe_vlan"]:"" );
UI::ChangeWidget( `id( `interfaces), `Cell(
FcoeClient::current_card, 3), card["fcoe_enable"]:"" );
UI::ChangeWidget( `id( `interfaces), `Cell(
FcoeClient::current_card, 4), card["dcb_required"]:"" );
+ UI::ChangeWidget( `id( `interfaces), `Cell(
FcoeClient::current_card, 5), card["auto_vlan"]:"" );
AdjustButtons();
}
else

Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/dialogs.ycp?rev=65200&r1=65199&r2=65200&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/dialogs.ycp Thu Aug 4
11:52:49 2011
@@ -104,11 +104,12 @@
return `MarginBox( mbox_x, mbox_y,
`VBox (
`VSpacing(2.0),
- // frame
+ // frame containing radio buttons for fcoe
service start
`Frame (_("FCoE Service Start"),
`VBox (`RadioButtonGroup (`id
("fcoe_service_startup"), items_fcoe))
),
`VStretch(),
+ // frame containing radio buttons for lldpad
service start
`Frame (_("Lldpad Service Start"),
`VBox (`RadioButtonGroup (`id
("lldpad_service_startup"), items_lldpad))
),
@@ -125,10 +126,13 @@
return `MarginBox( mbox_x, mbox_y,
`VBox(
`Table(`id(`interfaces), `opt(`notify, `immediate,
`keepSorting ),
+ // column headers of a table with network
interfaces (keep them short)
`header(_("Device Name"), _("Model"),
_("FCoE VLAN Interface"),
- _("FCoE Enable"), _("DCB
Required"), _("DCB capable") ),
+ // continue column headers
+ _("FCoE Enable"), _("DCB
Required"), _("AUTO VLAN"), _("DCB capable") ),
[]
),
+ // button labels
`Left(`HBox( `PushButton(`id(`edit), _("Change
&Settings")),
`PushButton(`id(`create), _("Create
FCoE &VLAN Interface")),
`PushButton(`id(`remove), _("&Remove
Interface")) )
@@ -155,6 +159,7 @@
`item(`id("no"),
"no", true )
])
),
+ // ComboBox label
`Left(`ComboBox(`id("syslog"),
_("&Use syslog"),
[`item(`id("yes"),
"yes", true ),
`item(`id("no"),
"no" )

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

< Previous Next >
This Thread
  • No further messages