[yast-commit] r64929 - /branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
Author: gs Date: Thu Jul 21 14:35:05 2011 New Revision: 64929 URL: http://svn.opensuse.org/viewcvs/yast?rev=64929&view=rev Log: check return value from removing interface and add error popup 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=64929&r1=64928&r2=64929&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 Jul 21 14:35:05 2011 @@ -377,8 +377,8 @@ y2milestone( "FCoE VLAN interface %1 created/started", fcoe_vlan_interface ); status_map = FcoeClient::GetFCoEStatus( fcoe_vlan_interface ); - // store command to be able to revert the creation of FCoE VLAN interface in case of abort - // TODO: is this also OK if only 'fipvlan -s <interface>' is called? + // store command to be able to revert the creation of FCoE VLAN interface in case of 'Abort' + // (also if only 'fipvlan -s <interface>' is called) FcoeClient::AddRevertCommand( sformat("vconfig rem %1", fcoe_vlan_interface ) ); if ( create_ifcfg ) { @@ -416,41 +416,50 @@ { map card = FcoeClient::GetCurrentNetworkCard(); map output = $[]; + string command = ""; // headline of a popup boolean ret = Popup::YesNoHeadline( _("Removing FCoE VLAN device"), // question to the user: really remove FCoE VLAN interface sformat( _("Do you really want to remove the VLAN device %1? -Please note: The device is not enabled again on 'Abort'."), card["fcoe_vlan"]:"" ) ); +Please note: The device won't be restored on 'Abort'."), card["fcoe_vlan"]:"" ) ); if ( ret == true ) { y2milestone( "Removing %1", card["fcoe_vlan"]:"" ); - string rm_interface = sformat( "vconfig rem %1", card["fcoe_vlan"]:"") ; - y2milestone( "Calling %1", rm_interface ); - output = (map)SCR::Execute( .target.bash_output, rm_interface ); - y2milestone( "Output: %1", output ); - - string rm_cfg = sformat( "rm %1", card["cfg_file"]:"" ); - y2milestone( "Calling %1", rm_cfg ); - output = (map)SCR::Execute( .target.bash_output, rm_cfg ); + command = sformat( "vconfig rem %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["cfg_file"] = ""; - FcoeClient::SetModified( true ); + if ( output["exit"]:255 == 0 ) + { + command = sformat( "rm %1", card["cfg_file"]:"" ); + 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["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"]:"" ); - 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"]:"" ); + AdjustButtons(); + } + else + { + Popup::Error( sformat( _("Removing of interface %1 failed"), card["fcoe_vlan"]:"") ); + y2error( "Removing of 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
participants (1)
-
gs@svn2.opensuse.org