[node-patches] Change in ovirt-node[master]: network: Drop el6 compat code

fabiand at redhat.com fabiand at redhat.com
Wed Jul 22 12:12:03 UTC 2015


Fabian Deutsch has uploaded a new change for review.

Change subject: network: Drop el6 compat code
......................................................................

network: Drop el6 compat code

In 3.6 we only support el7 hosts.

Change-Id: I36c933e1031c581bc72c5c577c4abba9cbcbc24a
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/config/network.py
1 file changed, 0 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/96/43896/1

diff --git a/src/ovirt/node/config/network.py b/src/ovirt/node/config/network.py
index a011b35..01354fb 100644
--- a/src/ovirt/node/config/network.py
+++ b/src/ovirt/node/config/network.py
@@ -225,36 +225,12 @@
 def hostname(new_hostname=None):
     """Get or set the current hostname
     """
-    if system.is_max_el(6):
-        return __legacy_hostname(new_hostname)
-
     if new_hostname:
         # hostnamectl set's runtime and config file
         utils.process.check_call(["hostnamectl", "set-hostname",
                                   new_hostname])
 
     return socket.gethostname()
-
-
-def __legacy_hostname(new_hostname=None):
-    """The legacy way of setting a hostname.
-    """
-    aug = utils.AugeasWrapper()
-    augpath = "/files/etc/sysconfig/network/HOSTNAME"
-    sys_hostname = None
-    if new_hostname:
-        aug.set(augpath, new_hostname)
-        sys_hostname = utils.network.hostname(new_hostname)
-    cfg_hostname = aug.get(augpath)
-
-    if sys_hostname and (sys_hostname != cfg_hostname):
-        # A trivial check: Check that the configured hostname equals the
-        # configured one (only check if we are configuring a new hostname)
-        raise RuntimeError(("A new hostname was configured (%s) but the " +
-                            "systems hostname (%s) wasn't set accordingly.") %
-                           (cfg_hostname, sys_hostname))
-
-    return cfg_hostname
 
 
 def ifaces():


-- 
To view, visit https://gerrit.ovirt.org/43896
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36c933e1031c581bc72c5c577c4abba9cbcbc24a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list