Author: gs
Date: Tue Jul 5 11:38:22 2011
New Revision: 64743
URL: http://svn.opensuse.org/viewcvs/yast?rev=64743&view=rev
Log:
info 'modified' is not needed in map of netcards,
it's available from FcoeClient::Modified()
Modified:
trunk/fcoe-client/src/FcoeClient.ycp
trunk/fcoe-client/src/complex.ycp
trunk/fcoe-client/src/fcoe-client_auto.ycp
Modified: trunk/fcoe-client/src/FcoeClient.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/FcoeClient.ycp?rev=64743&r1=64742&r2=64743&view=diff
==============================================================================
--- trunk/fcoe-client/src/FcoeClient.ycp (original)
+++ trunk/fcoe-client/src/FcoeClient.ycp Tue Jul 5 11:38:22 2011
@@ -327,7 +327,7 @@
{
string vlan_device_name = "";
- string command = sformat( "sed -n 's/\\([^ ]*\\) |.*%1*.*%2/\\1/p' /proc/net/vlan/config",
+ string command = sformat( "sed -n 's/\\([^ ]*\\) *.*%1*.*%2/\\1/p' /proc/net/vlan/config",
vlan_interface, interface );
y2milestone( "Executing command: %1", command );
@@ -372,7 +372,6 @@
status_map = add( status_map, "FCOE_ENABLE", "yes");
status_map = add( status_map, "DCB_REQUIRED", "yes");
status_map = add( status_map, "Filename", file_name );
- status_map = add( status_map, "Created", "yes" );
}
else
{
@@ -554,8 +553,8 @@
}
//
-// dev_name device fcoe_vlan fcoe_enable dcb_required dcb_capable vlan_interface modified cfg_file
-// eth3 Ethernet card ... eth3.200 yes/no yes/no yes/no 200 yes/no /etc/fcoe/cfg-eth3.200
+// 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
//
// Detect network interface cards (hardware probe) and get status
//
@@ -575,14 +574,15 @@
map info_map = $[];
map status_map = $[];
+ // It's not possible to distinguish between no cable attached
+ // and interface not up in 'link' map got from .probe.network
+ // (according to snwint), so we have to check every interface.
+ // This may take a while!
vlan_interface = GetVlanInterface( card["dev_name"]:"" );
if ( vlan_interface == "" )
{
// FCoE isn't enabled on the switch - we can't do anything here.
- // It's not possible to distinguish between no cable attached
- // and interface not up in 'link' map got from .probe.network
- // (according to snwint)
fcoe_vlan_interface = NOT_AVAILABLE;
}
else
@@ -608,7 +608,6 @@
info_map = add( info_map, "dcb_required", status_map["DCB_REQUIRED"]:""); // DCB_REQUIRED
info_map = add( info_map, "dcb_capable", dcb_capable ); // DCB capable
info_map = add( info_map, "vlan_interface", vlan_interface ); // VLAN interface, e.g. 200
- info_map = add( info_map, "modified", status_map["Created"]:"no" ); // data modified?
info_map = add( info_map, "cfg_file", status_map["Filename"]:"" ); // cfg file name, e.g. /etc/fcoe/cfg-eth3.200
network_interfaces = add( network_interfaces, info_map );
@@ -671,7 +670,8 @@
y2milestone( "Writing /etc/fcoe/cfg-ethx files" );
foreach ( map card, (list<map>)netcards, {
- if ( card["modified"]:"no" == "yes" ) // data modified
+ if ( card["fcoe_vlan"]:"" != FcoeClient::NOT_AVAILABLE && // FCoE VLAN is configured
+ card["fcoe_vlan"]:"" != FcoeClient::NOT_CONFIGURED && Modified() ) // and data are modified
{
string content = (string)SCR::Read( .target.string, card["cfg_file"]:"" );
y2milestone( "Original content of %1: %2", card["cfg_file"]:"", content );
@@ -707,7 +707,7 @@
}
else
{
- y2milestone( "%1 not modified", card["dev_name"]:"" );
+ y2milestone( "%1 not configured for FCoE", card["dev_name"]:"" );
}
} );
Modified: trunk/fcoe-client/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/complex.ycp?rev=64743&r1=64742&r2=64743&view=diff
==============================================================================
--- trunk/fcoe-client/src/complex.ycp (original)
+++ trunk/fcoe-client/src/complex.ycp Tue Jul 5 11:38:22 2011
@@ -397,7 +397,6 @@
card["fcoe_enable"] = status_map["FCOE_ENABLE"]:"";
card["dcb_required"] = status_map["DCB_REQUIRED"]:"";
card["cfg_file"] = status_map["Filename"]:"";
- card["modified"] = "yes";
FcoeClient::SetModified( true );
FcoeClient::SetNetworkCardsValue( FcoeClient::current_card, card );
@@ -485,7 +484,6 @@
if ( card["fcoe_enable"]:"" != fcoe_enabled )
{
card["fcoe_enable"] = fcoe_enabled;
- card["modified"] = "yes"; // set modified to "yes"
FcoeClient::SetModified( true );
}
@@ -493,7 +491,6 @@
if ( card["dcb_required"]:"" != dcb_required )
{
card["dcb_required"] = dcb_required;
- card["modified"] = "yes"; // set modified to "yes"
FcoeClient::SetModified( true );
}
Modified: trunk/fcoe-client/src/fcoe-client_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/fcoe-client_auto.ycp?rev=64743&r1=64742&r2=64743&view=diff
==============================================================================
--- trunk/fcoe-client/src/fcoe-client_auto.ycp (original)
+++ trunk/fcoe-client/src/fcoe-client_auto.ycp Tue Jul 5 11:38:22 2011
@@ -104,7 +104,6 @@
list<map> netcards = FcoeClient::GetNetworkCards();
y2milestone( "Netcards: %1", netcards );
- integer index = 0;
foreach ( map card, netcards, {
string vlan_interface = "";
@@ -162,16 +161,15 @@
{
// read or create /etc/fcoe/ethx file
FcoeClient::GetFCoEStatus( fcoe_vlan_interface );
- netcards[index, "modified"] = "yes";
}
}
}
- index = index + 1;
});
if ( write )
{
- FcoeClient::SetNetworkCards( netcards );
+ // FcoeClient::SetModified(true) is called in FcoeClient::Import(),
+ // i.e. modified is set before calling FcoeClient::Write()
ret = FcoeClient::Write();
}
else // don't continue in case of error
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org