[yast-commit] r60444 - /branches/SuSE-Code-11-SP1-Branch/network/src/modules/Lan.ycp
Author: kmachalkova Date: Tue Jan 19 13:15:51 2010 New Revision: 60444 URL: http://svn.opensuse.org/viewcvs/yast?rev=60444&view=rev Log: Normal indentation. See also: http://forgeftp.novell.com/yast/doc/SL11.1/codingrules/indentation.html Modified: branches/SuSE-Code-11-SP1-Branch/network/src/modules/Lan.ycp Modified: branches/SuSE-Code-11-SP1-Branch/network/src/modules/Lan.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/src/modules/Lan.ycp?rev=60444&r1=60443&r2=60444&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/src/modules/Lan.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/network/src/modules/Lan.ycp Tue Jan 19 13:15:51 2010 @@ -383,6 +383,7 @@ // if(!write_only && NetHwDetection::running) NetHwDetection::Stop(); /* Stop the detection */ + //FIXME: not only LanItems if(!LanItems::modified) { y2milestone("No changes to network setup -> nothing to write"); return true; @@ -434,7 +435,8 @@ if(Abort()) return false; /* Progress step 3 - multiple devices may be present, really plural*/ ProgressNextStage(_("Writing device configuration...")); - if (!Mode::autoinst()) LanItems::WriteUdevDriverRules(); + if (!Mode::autoinst()) + LanItems::WriteUdevDriverRules(); NetworkInterfaces::Write("netcard"); // WriteDevices(); sleep(sl); @@ -483,94 +485,99 @@ } if(!write_only) { - if(Abort()) return false; - /* Progress step 9 */ - ProgressNextStage(_("Activating network services...")); -// NetworkModules::HwUp (); - // during installation export sysconfig settings into NetworkManager (bnc#433084) - if (Mode::installation() && NetworkService::IsManaged()) y2internal("Export sysconfig settings into NetworkManager %1", SCR::Execute(.target.bash_output, "/usr/lib/NetworkManager/nm-opensuse-sysconfig-merge --connections")); - -y2internal("virt_net_proposal %1", virt_net_proposal); - if (Stage::cont() && virt_net_proposal && (Linuxrc::usessh() || Linuxrc::vnc() || Linuxrc::display_ip())) { - UI::OpenDialog(`opt(`decorated), `HBox( - `HSpacing(1), - `HCenter(`HSquash(`VBox( - `HCenter(`HSquash(`VBox( - // This is the heading of the popup box - `Left(`Heading(_("Confirm Network Restart"))), - `VSpacing(0.5), - // This is in information message. Next come the - // hardware class name (network cards). - `HVCenter(`Label(_("Because of bridged network YaST2 needs to restart network to apply the settings."))), - `VSpacing(0.5) - ))), - `ButtonBox ( - `HWeight (1, `PushButton (`id(`ok), `opt(`default, `okButton), Label::OKButton())), - /* PushButton label */ - `HWeight (1, `PushButton (`id (`cancel), `opt (`cancelButton), Label::CancelButton())) - ), - `VSpacing(0.2) - ))), - `HSpacing(1) - )); - - UI::SetFocus (`id(`ok)); - - // for autoinstallation popup has timeout 10 seconds (#192181) - // timeout for every case (bnc#429562) - any ret = UI::TimeoutUserInput(10*1000); - if (ret==`ok){ - y2internal("Restarting network because of bridged proposal"); - Service::Restart("network"); - } - UI::CloseDialog(); - } + if(Abort()) + return false; + /* Progress step 9 */ + ProgressNextStage(_("Activating network services...")); - // For ssh/vnc installation don't reload/restart network because possibility of IP change (bnc#347482) - else if (Stage::cont() && (Linuxrc::usessh() || Linuxrc::vnc() || Linuxrc::display_ip())) - y2milestone("For ssh or vnc installation don't reload/restart network during installation."); - else if (LanItems::force_restart) - Service::Restart("network"); - else if(Service::Status("network")==0){ - Service::Reload("network"); - } - else Service::Restart("network"); -// NetworkService::StartStop (); - sleep(sl); + // NetworkModules::HwUp (); + // during installation export sysconfig settings into NetworkManager (bnc#433084) + if (Mode::installation() && NetworkService::IsManaged()) + y2internal("Export sysconfig settings into NetworkManager %1", SCR::Execute(.target.bash_output, "/usr/lib/NetworkManager/nm-opensuse-sysconfig-merge --connections")); + + y2internal("virt_net_proposal %1", virt_net_proposal); + if (Stage::cont() && virt_net_proposal && (Linuxrc::usessh() || Linuxrc::vnc() || Linuxrc::display_ip())) { + UI::OpenDialog(`opt(`decorated), `HBox( + `HSpacing(1), + `HCenter(`HSquash(`VBox( + `HCenter(`HSquash(`VBox( + // This is the heading of the popup box + `Left(`Heading(_("Confirm Network Restart"))), + `VSpacing(0.5), + // This is in information message. Next come the + // hardware class name (network cards). + `HVCenter(`Label(_("Because of bridged network YaST2 needs to restart network to apply the settings."))), + `VSpacing(0.5) + ))), + `ButtonBox ( + `HWeight (1, `PushButton (`id(`ok), `opt(`default, `okButton), Label::OKButton())), + /* PushButton label */ + `HWeight (1, `PushButton (`id (`cancel), `opt (`cancelButton), Label::CancelButton())) + ), + `VSpacing(0.2) + ))), + `HSpacing(1) + )); + + UI::SetFocus (`id(`ok)); + + // for autoinstallation popup has timeout 10 seconds (#192181) + // timeout for every case (bnc#429562) + any ret = UI::TimeoutUserInput(10*1000); + if (ret==`ok){ + y2internal("Restarting network because of bridged proposal"); + Service::Restart("network"); + } + UI::CloseDialog(); + } + + // For ssh/vnc installation don't reload/restart network because possibility of IP change (bnc#347482) + else if (Stage::cont() && (Linuxrc::usessh() || Linuxrc::vnc() || Linuxrc::display_ip())) + y2milestone("For ssh or vnc installation don't reload/restart network during installation."); + else if (LanItems::force_restart) + Service::Restart("network"); + else if(Service::Status("network")==0){ + Service::Reload("network"); + } + else Service::Restart("network"); +// NetworkService::StartStop (); + sleep(sl); } if(Abort()) return false; /* Progress step 10 */ ProgressNextStage(_("Running SuSEconfig...")); - if(!write_only) RunSuSEconfig(); + if(!write_only) + RunSuSEconfig(); sleep(sl); if (!NetworkService::IsManaged() /*&& (boolean) SCR::Read(.init.scripts.exists, "smpppd")*/ && !write_only ) - { + { if(Abort()) return false; /* Progress step 11 */ ProgressNextStage(_("Setting up smpppd(8)...")); // takes care of autoinst by itself SetupSMPPPD(false); sleep(sl); + } - } - + // can't there just be 'else' instead of 'if'? fB. if (NetworkService::IsManaged()) - { - boolean network=false; - integer timeout=15; - while(timeout>0) - { - if (NetworkService::isNetworkRunning()){ - network=true; - break; + { + boolean network=false; + integer timeout=15; + while(timeout>0) + { + if (NetworkService::isNetworkRunning()){ + network=true; + break; + } + y2milestone("waiting for network ... %1", timeout); + sleep(1000); + timeout = timeout-1; } - y2milestone("waiting for network ... %1", timeout); - sleep(1000); - timeout = timeout-1; - } - if (!network) y2error("No network running"); + if (!network) + y2error("No network running"); } /* Final progress step */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org