Author: gs
Date: Thu Oct 6 14:23:07 2011
New Revision: 66290
URL: http://svn.opensuse.org/viewcvs/yast?rev=66290&view=rev
Log:
destroy FcoE interface before removing it
Modified:
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
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=66290&r1=66289&r2=66290&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 Oct 6 14:23:07 2011
@@ -357,9 +357,9 @@
// write config for FCoE VLAN interface
FcoeClient::CreateFcoeConfig( fcoe_vlan_interface, card );
status_map = FcoeClient::GetFcoeStatus ( fcoe_vlan_interface, card["dev_name"]:"" );
-
- // store command to be able to revert the creation of FCoE VLAN interface in case of 'Cancel'
- FcoeClient::AddRevertCommand( sformat("vconfig rem %1", fcoe_vlan_interface ) );
+
+ // command to be able to revert the creation of FCoE VLAN interface in case of 'Cancel'
+ FcoeClient::AddRevertCommand( sformat("fcoeadm -d %1 && vconfig rem %1", fcoe_vlan_interface ) );
}
else
{
@@ -406,45 +406,59 @@
if ( ret == true )
{
y2milestone( "Removing %1", card["fcoe_vlan"]:"" );
-
- command = sformat( "vconfig rem %1", card["fcoe_vlan"]:"") ;
+
+ // call fcoeadm -d first (bnc #719443)
+ command = sformat( "fcoeadm -d %1", card["fcoe_vlan"]:"") ;
y2milestone( "Calling %1", command );
output = (map)SCR::Execute( .target.bash_output, command );
y2milestone( "Output: %1", output );
if ( output["exit"]:255 == 0 )
{
- command = sformat( "rm /etc/fcoe/cfg-%1", card["cfg_file"]:"" );
- y2milestone( "Calling %1", command );
- output = (map)SCR::Execute( .target.bash_output, command );
- y2milestone( "Output: %1", output );
- command = sformat( "rm /etc/sysconfig/network/ifcfg-%1", card["fcoe_vlan"]:"" );
+ command = sformat( "vconfig rem %1", card["fcoe_vlan"]:"") ;
y2milestone( "Calling %1", command );
output = (map)SCR::Execute( .target.bash_output, command );
y2milestone( "Output: %1", output );
+
+ if ( output["exit"]:255 == 0 )
+ {
+ command = sformat( "rm /etc/fcoe/cfg-%1", card["cfg_file"]:"" );
+ y2milestone( "Calling %1", command );
+ output = (map)SCR::Execute( .target.bash_output, command );
+ y2milestone( "Output: %1", output );
+ command = sformat( "rm /etc/sysconfig/network/ifcfg-%1", card["fcoe_vlan"]:"" );
+ y2milestone( "Calling %1", command );
+ output = (map)SCR::Execute( .target.bash_output, command );
+ y2milestone( "Output: %1", output );
- // set new values in global map network_interfaces
- card["fcoe_vlan"] = FcoeClient::NOT_CONFIGURED;
- card["fcoe_enable"] = "";
- card["dcb_required"] = "";
- card["auto_vlan"] = "";
- card["cfg_file"] = "";
- FcoeClient::SetModified( true );
+ // set new values in global map network_interfaces
+ card["fcoe_vlan"] = FcoeClient::NOT_CONFIGURED;
+ card["fcoe_enable"] = "";
+ card["dcb_required"] = "";
+ card["auto_vlan"] = "";
+ card["cfg_file"] = "";
+ FcoeClient::SetModified( true );
- FcoeClient::SetNetworkCardsValue( FcoeClient::current_card, card );
- y2milestone( "Current network interfaces: %1", FcoeClient::GetNetworkCards() );
+ FcoeClient::SetNetworkCardsValue( FcoeClient::current_card, card );
+ y2milestone( "Current network interfaces: %1", FcoeClient::GetNetworkCards() );
- // replace values in table
- 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();
+ // replace values in table
+ 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
+ {
+ Popup::Error( sformat( _("Removing of interface %1 failed"), card["fcoe_vlan"]:"") );
+ y2error( "Removing of interface %1 failed", card["fcoe_vlan"]:"" );
+ }
}
else
{
- Popup::Error( sformat( _("Removing of interface %1 failed"), card["fcoe_vlan"]:"") );
- y2error( "Removing of interface %1 failed", card["fcoe_vlan"]:"" );
+ Popup::Error( sformat( _("Destroying interface %1 failed."), card["fcoe_vlan"]:"") );
+ y2error( "Destroying interface %1 failed", card["fcoe_vlan"]:"" );
}
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org