Author: gs Date: Tue Jul 5 12:40:10 2011 New Revision: 64748 URL: http://svn.opensuse.org/viewcvs/yast?rev=64748&view=rev Log: only enable services if any FCoE interface is enabled Modified: trunk/fcoe-client/src/fcoe-client_finish.ycp Modified: trunk/fcoe-client/src/fcoe-client_finish.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fcoe-client/src/fcoe-client_finish.ycp?rev=64748&r1=64747&r2=64748&view=diff ============================================================================== --- trunk/fcoe-client/src/fcoe-client_finish.ycp (original) +++ trunk/fcoe-client/src/fcoe-client_finish.ycp Tue Jul 5 12:40:10 2011 @@ -46,13 +46,28 @@ } else if (func == "Write") { - // copy fcoe config files to destdir - WFM::Execute (.local.bash,"test -d /etc/fcoe/ && mkdir -p '" + String::Quote(Installation::destdir) + "/etc/fcoe' && cp -a /etc/fcoe/* '" + String::Quote(Installation::destdir) + "/etc/fcoe/'"); + boolean start_services = false; + + // copy fcoe config files to destdir + WFM::Execute (.local.bash,"test -d /etc/fcoe/ && mkdir -p '" + String::Quote(Installation::destdir) + "/etc/fcoe' && cp -a /etc/fcoe/* '" + String::Quote(Installation::destdir) + "/etc/fcoe/'"); - // TODO: only enable if any FCoE VLAN interface was enabled - Service::Enable("fcoe"); - Service::Enable("lldpad"); - y2milestone("fcoe and lldpad services enabled"); + // only enable services if any FCoE VLAN interface is enabled + list <map> netcards = FcoeClient::GetNetworkCards(); + + foreach ( map card, netcards { + if ( card["fcoe_vlan"]:"" != FcoeClient::NOT_AVAILABLE && + card["fcoe_vlan"]:"" != FcoeClient::NOT_CONFIGURED ) + { + // FCoE VLAN interface is configured + start_services = true; + } + } ); + if ( start_services ) + { + Service::Enable("fcoe"); + Service::Enable("lldpad"); + } + y2milestone("fcoe and lldpad services enabled"); } else -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org