[node-patches] Change in ovirt-node[master]: network: Always write lo config

fabiand at fedoraproject.org fabiand at fedoraproject.org
Mon Jul 8 12:11:44 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: network: Always write lo config
......................................................................

network: Always write lo config

Previously the lo config got removed but wasn't created afterwards. Now
the lo config is always written.

Change-Id: I45d92ef2314b02b8ce40aad53e7aab32b1d86505
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/config/defaults.py
M tests/nose/network_config.py
2 files changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/69/16569/1

diff --git a/src/ovirt/node/config/defaults.py b/src/ovirt/node/config/defaults.py
index 26fe1f7..e740667 100644
--- a/src/ovirt/node/config/defaults.py
+++ b/src/ovirt/node/config/defaults.py
@@ -331,11 +331,21 @@
                 else:
                     topology = NetworkLayout().configure_direct()
 
+                self.__write_lo()
+
                 aug.set("/files/etc/sysconfig/network/NETWORKING",
                         "yes" if has_network else "no")
                 fs.Config().persist("/etc/sysconfig/network")
                 fs.Config().persist("/etc/hosts")
 
+            def __write_lo(self):
+                cfg = NicConfig("lo")
+                cfg.device = "lo"
+                cfg.ipaddr = "127.0.0.1"
+                cfg.netmask = "255.0.0.0"
+                cfg.onboot = "yes"
+                cfg.save()
+
             def __assign_common(self, cfg):
                 m = Network().retrieve()
                 m_dns = Nameservers().retrieve()
diff --git a/tests/nose/network_config.py b/tests/nose/network_config.py
index e9d949d..7554e11 100644
--- a/tests/nose/network_config.py
+++ b/tests/nose/network_config.py
@@ -211,8 +211,6 @@
                                [('DEVICE', 'ens3'), ('MASTER', 'bond0'),
                                 ('ONBOOT', 'yes'), ('SLAVE', 'yes')])
 
-        assert len(FakeFs.filemap) == (1 + 1 + 3)
-
     def test_bridged_dhcp(self, *args, **kwargs):
         mb = defaults.NicBonding()
         mt = defaults.NetworkLayout()
@@ -250,8 +248,6 @@
                                 ('ONBOOT', 'yes'),
                                 ('PEERNTP', 'yes'),
                                 ('TYPE', 'Bridge')])
-
-        assert len(FakeFs.filemap) == (1 + 1 + 3 + 1)
 
     def test_bond_slave_as_primary(self, *args, **kwargs):
         mb = defaults.NicBonding()


-- 
To view, visit http://gerrit.ovirt.org/16569
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I45d92ef2314b02b8ce40aad53e7aab32b1d86505
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list