[yast-commit] r63864 - in /trunk/fcoe-client/src: complex.ycp dialogs.ycp
Author: gs Date: Tue Apr 26 14:17:29 2011 New Revision: 63864 URL: http://svn.opensuse.org/viewcvs/yast?rev=63864&view=rev Log: GetFCoEStatus Modified: trunk/fcoe-client/src/complex.ycp trunk/fcoe-client/src/dialogs.ycp Modified: trunk/fcoe-client/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/complex.ycp?rev=63864&r1=63863&r2=63864&view=diff ============================================================================== --- trunk/fcoe-client/src/complex.ycp (original) +++ trunk/fcoe-client/src/complex.ycp Tue Apr 26 14:17:29 2011 @@ -91,9 +91,9 @@ // // // -boolean GetFCoEStatus( string interface ) +string GetFCoEStatus( string interface ) { - boolean ret = true; + string status = "\"no\""; string vlan_interface = ""; string command = sformat( "sed -n 's/\\([^ ]*\\) *.*%1/\\1/p' /proc/net/vlan/config", interface ); y2milestone( "Executing command: %1", command ); @@ -104,18 +104,29 @@ if ( vlan_interface != "") { - y2milestone( "VLAN channel %1 found, reading /etc/fcoe/cfg-%1", vlan_interface ); - + string file_name = sformat( "/etc/fcoe/cfg-%1", vlan_interface ); + y2milestone( "VLAN channel %1 found, reading %2", vlan_interface, file_name ); + string content = (string)SCR::Read(.target.string, file_name); + y2milestone( "Content: %1", content ); + list <string> lines = splitstring( content, "\n" ); + + foreach( string line, (list<string>)lines, { + if ( regexpmatch( line, "^FCOE_ENABLE" ) ) + { + status = substring( line, 12 ); + y2milestone( "FCOE_ENABLE: %1", status ); + } + }); } else { y2milestone( "Nothing configured for %1", interface ); - ret = false; } - return ret; + return status; } + void InitInterfacesDialog (string id) { y2milestone( "Init interfaces dialog" ); @@ -124,11 +135,12 @@ list <term> table_items = []; integer row = 0; - boolean fcoe_status = false; foreach ( map card, netcards, { - fcoe_status = GetFCoEStatus( card["dev_name"]:"" ); - table_items = add( table_items, `item(`id(row), card["dev_name"]:"", card["device"]:"" ) ); + table_items = add( table_items, + `item(`id(row), card["dev_name"]:"", card["device"]:"", + GetFCoEStatus(card["dev_name"]:"") ) + ); row = row + 1; }); @@ -152,6 +164,11 @@ UI::ChangeWidget(`id("debug"), `Value, "yes" ); else UI::ChangeWidget(`id("debug"), `Value, "no" ); + + if ( syslog_val == "yes" ) + UI::ChangeWidget(`id("syslog"), `Value, "yes" ); + else + UI::ChangeWidget(`id("syslog"), `Value, "no" ); } else { Modified: trunk/fcoe-client/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/dialogs.ycp?rev=63864&r1=63863&r2=63864&view=diff ============================================================================== --- trunk/fcoe-client/src/dialogs.ycp (original) +++ trunk/fcoe-client/src/dialogs.ycp Tue Apr 26 14:17:29 2011 @@ -82,7 +82,7 @@ return `MarginBox( mbox_x, mbox_y, `VBox( `Table(`id(`interfaces), `opt(`notify, `immediate ), - `header(_("Device Name"), _("Model"), _("FCoE Satus"), _("DCB Status")), + `header(_("Device Name"), _("Model"), _("FCoE Enabled"), _("DCB Required")), [] ), `Left(`HBox( @@ -107,8 +107,8 @@ `VBox ( // ComboBox label `Left(`ComboBox(`id("debug"), _("&Debug"), - [`item(`id("yes"), "yes", true ), - `item(`id("no"), "no" ) + [`item(`id("yes"), "yes" ), + `item(`id("no"), "no", true ) ]) ), `Left(`ComboBox(`id("syslog"), _("&Use syslog"), -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn2.opensuse.org