Author: mvidner
Date: Thu Aug 11 16:58:34 2011
New Revision: 65315
URL: http://svn.opensuse.org/viewcvs/yast?rev=65315&view=rev
Log:
Omit unnecessary INTERFACETYPE declaration in ifcfg (bnc#711762)
This broke the VM-proposed bridge because it copied ifcfg-ethN's
INTERFACETYPE=eth (bnc#704999).
Refactored ProposeInterfaces.
svn merge -r 65311:65314 http://svn.opensuse.org/svn/yast/branches/SuSE-Code-11-SP2-Branch/network .
Manually resolved the merge conflicts
Modified:
trunk/network/ (props changed)
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/modules/Lan.ycp
trunk/network/src/modules/LanItems.ycp
Modified: trunk/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=65315&r1=65314&r2=65315&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Thu Aug 11 16:58:34 2011
@@ -1 +1 @@
-2.21.1
+2.21.2
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=65315&r1=65314&r2=65315&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Thu Aug 11 16:58:34 2011
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu Aug 11 16:33:26 CEST 2011 - mvidner@suse.cz
+
+- Omit unnecessary INTERFACETYPE declaration in ifcfg (bnc#711762)
+ This broke the VM-proposed bridge because it copied ifcfg-ethN's
+ INTERFACETYPE=eth (bnc#704999).
+- 2.17.160
+
+-------------------------------------------------------------------
Fri Aug 5 12:34:09 CEST 2011 - tgoettlicher@suse.de
- fixed .desktop file (bnc #681249)
Modified: trunk/network/src/modules/Lan.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Lan.ycp?rev=65315&r1=65314&r2=65315&view=diff
==============================================================================
--- trunk/network/src/modules/Lan.ycp (original)
+++ trunk/network/src/modules/Lan.ycp Thu Aug 11 16:58:34 2011
@@ -827,51 +827,41 @@
}
-/**
- * Propose interface configuration
- * @return true if something was proposed
- */
-global define boolean ProposeInterfaces () {
-
- y2milestone("Hardware=%1", LanItems::Hardware);
-// y2milestone("InstallInf=%1", InstallInf);
-
- y2milestone("NetworkConfig::Config=%1", NetworkConfig::Config);
- y2milestone("NetworkConfig::DHCP=%1", NetworkConfig::DHCP);
-
- // test if we have any virtualization installed
- if (virt_net_proposal)
- {
- y2milestone("Virtualization [xen|kvm|qemu] detected - will propose virtualization network");
- // in case of virtualization use special proposal
- // collect all interfaces that will be skipped from bridged proposal
+list<string> IfcfgsToSkipVirtualizedProposal() {
list<string> skipped = [];
foreach(integer current, any config, LanItems::Items, {
- string ifcfg = LanItems::Items[current, "ifcfg"]:"";
- if (NetworkInterfaces::GetType(ifcfg)=="br"){
- NetworkInterfaces::Edit(ifcfg);
- y2milestone("Bridge %1 with ports (%2) found", ifcfg, NetworkInterfaces::Current["BRIDGE_PORTS"]:"");
- skipped=add(skipped, ifcfg);
- foreach(string port, (list<string>) splitstring(NetworkInterfaces::Current["BRIDGE_PORTS"]:"", " "), {
- skipped=add(skipped, port);
- });
- }
- if (NetworkInterfaces::GetType(ifcfg)=="bond"){
- NetworkInterfaces::Edit(ifcfg);
- foreach(string i, (list<string>)splitstring("0,1,2,3,4,5,6,7,8,9", ","), {
- string slave = NetworkInterfaces::Current[sformat("BONDING_SLAVE%1", i)]:"";
- y2milestone("For interface %1 found slave %2", ifcfg, slave);
- if(size(slave)>0) skipped=add(skipped, slave);
- });
- }
- if (NetworkInterfaces::GetValue(ifcfg, "STARTMODE")=="nfsroot"){
- y2milestone("Skipped %1 interface from bridge slaves because of nfsroot.", ifcfg);
- skipped=add(skipped, ifcfg);
- }
- });
+ string ifcfg = LanItems::Items[current, "ifcfg"]:"";
+ if (NetworkInterfaces::GetType(ifcfg)=="br"){
+ NetworkInterfaces::Edit(ifcfg);
+ y2milestone("Bridge %1 with ports (%2) found", ifcfg, NetworkInterfaces::Current["BRIDGE_PORTS"]:"");
+ skipped=add(skipped, ifcfg);
+ foreach(string port, (list<string>) splitstring(NetworkInterfaces::Current["BRIDGE_PORTS"]:"", " "), {
+ skipped=add(skipped, port);
+ });
+ }
+ if (NetworkInterfaces::GetType(ifcfg)=="bond"){
+ NetworkInterfaces::Edit(ifcfg);
+ foreach(string i, (list<string>)splitstring("0,1,2,3,4,5,6,7,8,9", ","), {
+ string slave = NetworkInterfaces::Current[sformat("BONDING_SLAVE%1", i)]:"";
+ y2milestone("For interface %1 found slave %2", ifcfg, slave);
+ if(size(slave)>0) skipped=add(skipped, slave);
+ });
+ }
+ if (NetworkInterfaces::GetValue(ifcfg, "STARTMODE")=="nfsroot"){
+ y2milestone("Skipped %1 interface from bridge slaves because of nfsroot.", ifcfg);
+ skipped=add(skipped, ifcfg);
+ }
+ });
y2milestone("Skipped interfaces : %1", skipped);
+ return skipped;
+}
- // configure all connected unconfigured devices with dhcp (with default parameters)
+void ProposeVirtualized() {
+ // in case of virtualization use special proposal
+ // collect all interfaces that will be skipped from bridged proposal
+ list<string> skipped = IfcfgsToSkipVirtualizedProposal();
+
+ // first configure all connected unconfigured devices with dhcp (with default parameters)
foreach (integer number, any lanitem, LanItems::Items, {
if (hasAnyValue(((map)lanitem)["hwinfo", "dev_name"]:"")) {
LanItems::current = number;
@@ -892,106 +882,118 @@
// then each configuration (except bridges) move to the bridge
// and add old device name into bridge_ports
foreach(integer current, any config, LanItems::Items, {
- string ifcfg = LanItems::Items[current, "ifcfg"]:"";
- if (contains(skipped, ifcfg)){
- y2milestone("Skipping interface %1", ifcfg);
- continue;
- }
- if (size(ifcfg)>0){
- NetworkInterfaces::Edit(ifcfg);
- map old_config = NetworkInterfaces::Current;
- y2debug("Old Config %1\n%2", ifcfg, old_config);
- string new_ifcfg = sformat("br%1", NetworkInterfaces::GetFreeDevice("br"));
- y2milestone("old configuration %1, bridge %2", ifcfg, new_ifcfg);
- NetworkInterfaces::Name = new_ifcfg;
- // from bridge interface remove all bonding-related stuff
- foreach(string key, any value, NetworkInterfaces::Current, {
- if (issubstring(key, "BONDING")){
- NetworkInterfaces::Current[key]=nil;
- }
- });
- NetworkInterfaces::Current["BRIDGE"]="yes";
- NetworkInterfaces::Current["BRIDGE_PORTS"]=ifcfg;
- NetworkInterfaces::Current["BRIDGE_STP"]="off";
- NetworkInterfaces::Current["BRIDGE_FORWARDDELAY"]="0";
- // hardcode startmode (bnc#450670), it can't be ifplugd!
- NetworkInterfaces::Current["STARTMODE"]="auto";
- // remove description - will be replaced by new (real) one
- NetworkInterfaces::Current=remove(NetworkInterfaces::Current, "NAME");
- if( NetworkInterfaces::Commit() ){
- NetworkInterfaces::Add();
- NetworkInterfaces::Edit(ifcfg);
- old_config["BOOTPROTO"]="static";
- old_config["IPADDR"]="0.0.0.0/32";
- // remove all aliases (bnc#590167)
- foreach (string a, any v, (map )NetworkInterfaces::Current["_aliases"]:$[], {
- if (v != nil) { NetworkInterfaces::DeleteAlias (NetworkInterfaces::Name, a); }
- });
- old_config["_aliases"]=$[];
- y2milestone("Old Config with apllied changes %1\n%2", ifcfg, old_config);
- NetworkInterfaces::Current = old_config;
- NetworkInterfaces::Commit();
-
- LanItems::Items[current, "ifcfg"] = new_ifcfg;
- LanItems::modified=true;
- LanItems::force_restart=true;
- y2internal("List %1", NetworkInterfaces::List(""));
- // re-read configuration to see new items in UI
- LanItems::Read();
- }
- } else y2warning("empty ifcfg");
- });
- } else {
+ string ifcfg = LanItems::Items[current, "ifcfg"]:"";
+ if (contains(skipped, ifcfg)){
+ y2milestone("Skipping interface %1", ifcfg);
+ continue;
+ }
+ else if (size(ifcfg)>0){
+ NetworkInterfaces::Edit(ifcfg);
+ map old_config = NetworkInterfaces::Current;
+ y2debug("Old Config %1\n%2", ifcfg, old_config);
+ string new_ifcfg = sformat("br%1", NetworkInterfaces::GetFreeDevice("br"));
+ y2milestone("old configuration %1, bridge %2", ifcfg, new_ifcfg);
+ NetworkInterfaces::Name = new_ifcfg;
+ // from bridge interface remove all bonding-related stuff
+ foreach(string key, any value, NetworkInterfaces::Current, {
+ if (issubstring(key, "BONDING")){
+ NetworkInterfaces::Current[key]=nil;
+ }
+ });
+ NetworkInterfaces::Current["BRIDGE"]="yes";
+ NetworkInterfaces::Current["BRIDGE_PORTS"]=ifcfg;
+ NetworkInterfaces::Current["BRIDGE_STP"]="off";
+ NetworkInterfaces::Current["BRIDGE_FORWARDDELAY"]="0";
+ // hardcode startmode (bnc#450670), it can't be ifplugd!
+ NetworkInterfaces::Current["STARTMODE"]="auto";
+ // remove description - will be replaced by new (real) one
+ NetworkInterfaces::Current=remove(NetworkInterfaces::Current, "NAME");
+ if( NetworkInterfaces::Commit() ){
+ NetworkInterfaces::Add();
+ NetworkInterfaces::Edit(ifcfg);
+ old_config["BOOTPROTO"]="static";
+ old_config["IPADDR"]="0.0.0.0/32";
+ // remove all aliases (bnc#590167)
+ foreach (string a, any v, (map )NetworkInterfaces::Current["_aliases"]:$[], {
+ if (v != nil) { NetworkInterfaces::DeleteAlias (NetworkInterfaces::Name, a); }
+ });
+ old_config["_aliases"]=$[];
+ y2milestone("Old Config with apllied changes %1\n%2", ifcfg, old_config);
+ NetworkInterfaces::Current = old_config;
+ NetworkInterfaces::Commit();
+
+ LanItems::Items[current, "ifcfg"] = new_ifcfg;
+ LanItems::modified=true;
+ LanItems::force_restart=true;
+ y2internal("List %1", NetworkInterfaces::List(""));
+ // re-read configuration to see new items in UI
+ LanItems::Read();
+ }
+ }
+ else y2warning("empty ifcfg");
+ });
+}
- if (! LanItems::nm_proposal_valid)
- {
- NetworkService::SetManaged (UseNetworkManager ());
- LanItems::nm_proposal_valid = true;
- }
+/**
+ * Propose interface configuration
+ * @return true if something was proposed
+ */
+global define boolean ProposeInterfaces () {
+ y2milestone("Hardware=%1", LanItems::Hardware);
- if (NetworkService::IsManaged ())
- {
- ProposeNMInterfaces ();
-
- LanItems::modified = true; // #144139 workaround
- y2milestone ("NM proposal");
- return true;
+ y2milestone("NetworkConfig::Config=%1", NetworkConfig::Config);
+ y2milestone("NetworkConfig::DHCP=%1", NetworkConfig::DHCP);
+
+ // test if we have any virtualization installed
+ if (virt_net_proposal) {
+ y2milestone("Virtualization [xen|kvm|qemu] detected - will propose virtualization network");
+ ProposeVirtualized();
}
+ else {
+ if (! LanItems::nm_proposal_valid) {
+ NetworkService::SetManaged (UseNetworkManager ());
+ LanItems::nm_proposal_valid = true;
+ }
+
+ if (NetworkService::IsManaged ()) {
+ ProposeNMInterfaces ();
- }
+ LanItems::modified = true; // #144139 workaround
+ y2milestone ("NM proposal");
+ return true;
+ }
+
+ }
/* Something is already configured -> do nothing */
boolean configured=false;
foreach (integer number, any lanitem, LanItems::Items, {
- LanItems::current = number;
- if (LanItems::IsItemConfigured()){
- y2milestone("Something already configured: don't propose.");
- configured = true;
- break;
- }
- });
+ LanItems::current = number;
+ if (LanItems::IsItemConfigured()){
+ y2milestone("Something already configured: don't propose.");
+ configured = true;
+ break;
+ }
+ });
if (configured) return false;
foreach (integer number, any lanitem, LanItems::Items, {
- if (hasAnyValue(((map)lanitem)["hwinfo", "dev_name"]:"")) {
- LanItems::current = number;
- boolean link = LanItems::getCurrentItem()["hwinfo", "link"]:false;
- if (LanItems::getCurrentItem()["hwinfo", "type"]:"" == "wlan")
- y2warning("Will not propose wlan interfaces");
- else{
- if (!link) y2warning("item number %1 has link:false detected", number);
- else if (!LanItems::IsItemConfigured() && link){
- y2milestone("Nothing already configured - start proposing");
- LanItems::ProposeItem();
- break;
- }
- }
- }
- });
-
-
-
+ if (hasAnyValue(((map)lanitem)["hwinfo", "dev_name"]:"")) {
+ LanItems::current = number;
+ boolean link = LanItems::getCurrentItem()["hwinfo", "link"]:false;
+ if (LanItems::getCurrentItem()["hwinfo", "type"]:"" == "wlan")
+ y2warning("Will not propose wlan interfaces");
+ else{
+ if (!link) y2warning("item number %1 has link:false detected", number);
+ else if (!LanItems::IsItemConfigured() && link){
+ y2milestone("Nothing already configured - start proposing");
+ LanItems::ProposeItem();
+ break;
+ }
+ }
+ }
+ });
y2milestone("NetworkConfig::Config=%1", NetworkConfig::Config);
y2milestone("NetworkConfig::DHCP=%1", NetworkConfig::DHCP);
Modified: trunk/network/src/modules/LanItems.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp?rev=65315&r1=65314&r2=65315&view=diff
==============================================================================
--- trunk/network/src/modules/LanItems.ycp (original)
+++ trunk/network/src/modules/LanItems.ycp Thu Aug 11 16:58:34 2011
@@ -1181,7 +1181,8 @@
// L3: bnc#585458
// FIXME: INTERFACETYPE confuses sysconfig, bnc#458412
// Only test when newdev has enough info for GetTypeFromIfcfg to work.
- if (NetworkInterfaces::GetTypeFromIfcfg(newdev) != type) {
+ string implied_type = NetworkInterfaces::GetTypeFromIfcfg(newdev);
+ if (implied_type != nil && implied_type != type) {
newdev["INTERFACETYPE"]=type;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org