[yast-commit] r63959 - in /trunk/fcoe-client/src: FcoeClient.ycp complex.ycp dialogs.ycp wizards.ycp
Author: gs Date: Wed May 11 12:54:13 2011 New Revision: 63959 URL: http://svn.opensuse.org/viewcvs/yast?rev=63959&view=rev Log: add service lldpad Modified: trunk/fcoe-client/src/FcoeClient.ycp trunk/fcoe-client/src/complex.ycp trunk/fcoe-client/src/dialogs.ycp trunk/fcoe-client/src/wizards.ycp Modified: trunk/fcoe-client/src/FcoeClient.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/FcoeClient.ycp?rev=63959&r1=63958&r2=63959&view=diff ============================================================================== --- trunk/fcoe-client/src/FcoeClient.ycp (original) +++ trunk/fcoe-client/src/FcoeClient.ycp Wed May 11 12:54:13 2011 @@ -377,7 +377,7 @@ // // Set status of services // -global void AdjustStatusOfServices( ) +global void AdjustStartStatus( ) { y2milestone( "Setting start of /etc/init.d/fcoe to %1", service_start["fcoe"]:false ); if ( service_start["fcoe"]:false == true ) @@ -393,7 +393,7 @@ } -global void SetServiceStatus( string service, boolean status ) +global void SetStartStatus( string service, boolean status ) { y2milestone( "Setting status of %1 to %2", service, status ); service_start[ service ] = status; @@ -402,7 +402,7 @@ // // Get status of services // -void DetectStatusOfServices() +void DetectStartStatus() { boolean status = false; @@ -416,11 +416,59 @@ } -global map<string, boolean> GetServiceStatus() +global map<string, boolean> GetStartStatus() { return service_start; } +global boolean ServiceStatus() +{ + // TODO - check whether loading any modules in Stage::initial() is required + // (like in IsciClientLib.ycp, line 469 ) + boolean ret = true; + + if ( Service::Status( "fcoe" ) != 0 ) + { + boolean success = Service::Start( "fcoe" ); + if ( success ) + { + y2milestone( "FCoE started (/etc/init.d/fcoe start)"); + } + else + { + y2error( "Cannot start FCoE service - '/etc/init.d/fcoe start' failed" ); + Popup::Error( "Cannot start FCoE service. +'/etc/init.d/fcoe start' failed" ); + ret = false; + } + } + else + { + y2milestone( "FCoE service is running"); + } + + if ( Service::Status( "lldpad" ) != 0 ) + { + boolean success = Service::Start( "lldpad" ); + if ( success ) + { + y2milestone( "Lldpad started (/etc/init.d/lldpad start)"); + } + else + { + y2error( "Cannot start service lldpad - '/etc/init.d/lldpad start' failed" ); + Popup::Error( "Cannot start service lldpad. +'/etc/init.d/lldpad start' failed" ); + ret = false; + } + } + else + { + y2milestone( "Lldpad service is running"); + } + return ret; +} + // // Detect network interface cards (hardware probe) and get status // @@ -590,6 +638,9 @@ "" ); + // TODO - is this check needed here (like in IsciClient.ycp) + // if(!NetworkService::RunningNetworkPopup()) return false; + if(Abort()) return false; Progress::NextStage(); @@ -604,11 +655,13 @@ if(Abort()) return false; Progress::NextStage(); - // check daemon fcoemon and lldpad - DetectStatusOfServices(); + // check whether auto start of daemon fcoemon and lldpad is enabled or not + DetectStartStatus(); + // check whether fcoe and lldpad are running and start services if required + boolean start_status = ServiceStatus(); /* Error message */ - if(false) Report::Error(_("Checking for services failed")); + if(!start_status) Report::Error(_("Starting of services failed")); sleep(sl); if(Abort()) return false; @@ -661,12 +714,12 @@ /* Progress stage 1/2 */ _("Write the settings"), /* Progress stage 2/2 */ - _("Run SuSEconfig") + _("Adjust start of services") ], [ /* Progress step 1/2 */ _("Writing the settings..."), /* Progress step 2/2 */ - _("Running SuSEconfig..."), + _("Adjusting start of services..."), /* Progress finished */ _("Finished") ], @@ -687,6 +740,8 @@ if(Abort()) return false; Progress::NextStage (); + AdjustStartStatus(); + /* Error message */ if(false) Report::Error (Message::SuSEConfigFailed()); sleep(sl); Modified: trunk/fcoe-client/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/complex.ycp?rev=63959&r1=63958&r2=63959&view=diff ============================================================================== --- trunk/fcoe-client/src/complex.ycp (original) +++ trunk/fcoe-client/src/complex.ycp Wed May 11 12:54:13 2011 @@ -82,13 +82,15 @@ return ret ? `next : `abort; } +// TODO - check whether a 'validate' is required + /** * Init **/ void InitServicesDialog (string id) { y2milestone( "Init services dialog" ); - map status_map = FcoeClient::GetServiceStatus(); + map status_map = FcoeClient::GetStartStatus(); if ( status_map["fcoe"]:false == true ) { @@ -100,6 +102,17 @@ UI::ChangeWidget( `id( "fcoe_startup_auto" ), `Value, false ); UI::ChangeWidget( `id( "fcoe_startup_manual" ), `Value, true ); } + + if ( status_map["lldpad"]:false == true ) + { + UI::ChangeWidget( `id( "lldpad_startup_auto" ), `Value, true ); + UI::ChangeWidget( `id( "lldpad_startup_manual" ), `Value, false ); + } + else + { + UI::ChangeWidget( `id( "lldap_startup_auto" ), `Value, false ); + UI::ChangeWidget( `id( "lldpad_startup_manual" ), `Value, true ); + } } // @@ -322,29 +335,16 @@ if ( fcoe_auto ) { - FcoeClient::SetServiceStatus( "fcoe", true ); + FcoeClient::SetStartStatus( "fcoe", true ); y2milestone( "Setting auto start of FCoE to true"); } - // Check whether FCoE is already running and start if required - integer status = Service::Status("fcoe"); - if ( status != 0 ) - { - boolean success = Service::Start("fcoe"); - if ( success ) - { - y2milestone( "FCoE started (/etc/init.d/fcoe start)"); - } - else - { - y2error( "Cannot start FCoE service - '/etc/init.d/fcoe start' failed" ); - Popup::Error( "Cannot start FCoE service. -'/etc/init.d/fcoe start' failed" ); - } - } - else + boolean lldpad_auto = (boolean)UI::QueryWidget( `id ("llpad_startup_auto"), `Value ); + + if ( lldpad_auto ) { - y2milestone( "FCoE service is running"); + FcoeClient::SetStartStatus( "lldpad", true ); + y2milestone( "Setting auto start of lldpad to true"); } } @@ -356,6 +356,10 @@ void StoreConfigurationDialog (string id, map event) { y2milestone( "Store configuration dialog" ); + string debug_val = (string)UI::QueryWidget( `id("debug"), `Value ); + string syslog_val = (string)UI::QueryWidget( `id("syslog"), `Value ); + FcoeClient::SetFcoeConfigValue( "DEBUG", debug_val ); + FcoeClient::SetFcoeConfigValue( "USE_SYSLOG", syslog_val ); } void StoreEditDialog (string id, map event) Modified: trunk/fcoe-client/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/dialogs.ycp?rev=63959&r1=63958&r2=63959&view=diff ============================================================================== --- trunk/fcoe-client/src/dialogs.ycp (original) +++ trunk/fcoe-client/src/dialogs.ycp Wed May 11 12:54:13 2011 @@ -39,7 +39,7 @@ integer mbox_x = 1; integer mbox_y = 0.5; -term items = `VBox( +term items_fcoe = `VBox( `VSpacing (0.4), `Left (`RadioButton (`id ("fcoe_startup_auto"), `opt (`notify), "When Booting")), @@ -49,6 +49,15 @@ `VSpacing (0.4) ); +term items_lldpad = `VBox( + `VSpacing (0.4), + `Left (`RadioButton (`id ("lldpad_startup_auto"), `opt (`notify), + "When Booting")), + `Left (`RadioButton (`id ("lldpad_startup_manual"), `opt (`notify), + "Manually") + ), + `VSpacing (0.4) + ); term EditDialogContents() { @@ -88,9 +97,13 @@ `VSpacing(2.0), // frame `Frame (_("FCoE Service Start"), - `VBox (`RadioButtonGroup (`id ("service_startup"), items)) + `VBox (`RadioButtonGroup (`id ("fcoe_service_startup"), items_fcoe)) ), - `VStretch() + `VStretch(), + `Frame (_("Lldpad Service Start"), + `VBox (`RadioButtonGroup (`id ("lldpadservice_startup"), items_lldpad)) + ), + `VStretch() ) ); } Modified: trunk/fcoe-client/src/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/wizards.ycp?rev=63959&r1=63958&r2=63959&view=diff ============================================================================== --- trunk/fcoe-client/src/wizards.ycp (original) +++ trunk/fcoe-client/src/wizards.ycp Wed May 11 12:54:13 2011 @@ -98,7 +98,7 @@ string ini_tab = ""; - map <string, boolean> status_map = FcoeClient::GetServiceStatus(); + map <string, boolean> status_map = FcoeClient::GetStartStatus(); if ( status_map["fcoe"]:false == true || status_map["lldpad"]:false == true ) ini_tab = "interfaces"; -- 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