Fabian Deutsch has uploaded a new change for review. Change subject: net: Fix hostname setting on el7 ......................................................................
net: Fix hostname setting on el7 A few fixes to make setting the hostname more reliable on el7. Change-Id: I750bf996e04904ab07a123794ec498c6b4a9c474 Signed-off-by: Fabian Deutsch <[email protected]> --- M scripts/ovirt-functions.in M scripts/ovirt-init-functions.sh.in M src/ovirt/node/config/network.py 3 files changed, 11 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/86/42386/1 diff --git a/scripts/ovirt-functions.in b/scripts/ovirt-functions.in index b3882ee..a923e55 100644 --- a/scripts/ovirt-functions.in +++ b/scripts/ovirt-functions.in @@ -1169,10 +1169,7 @@ load_keyboard_config () { - python <<EOP -import ovirtnode.ovirtfunctions as ovirtfunctions -ovirtfunctions.load_keyboard_config() -EOP + _pyovirtfunctions "load_keyboard_config()" } configure_dns () diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in index e4dd7d7..dc7e8ed 100644 --- a/scripts/ovirt-init-functions.sh.in +++ b/scripts/ovirt-init-functions.sh.in @@ -932,6 +932,13 @@ hostname $HOSTNAME fi fi + if [ -f /etc/hostname ]; then + if [ -n "$(cat /etc/hostname)" ]; then + hostname -b -F /etc/hostname + hostname -F /etc/hostname + fi + fi + [[ -f "/etc/udev/rules.d/71-persistent-node-net.rules" ]] && { [[ $(rpm -E "%{?rhel"}) = 6 ]] || [[ $(rpm -E "%{?centos}") = 6 ]] && { diff --git a/src/ovirt/node/config/network.py b/src/ovirt/node/config/network.py index 833b83b..b5cbc61 100644 --- a/src/ovirt/node/config/network.py +++ b/src/ovirt/node/config/network.py @@ -19,7 +19,7 @@ # MA 02110-1301, USA. A copy of the GNU General Public License is # also available at http://www.gnu.org/copyleft/gpl.html. from ovirt.node import utils, base -from ovirt.node.utils import AugeasWrapper as Augeas, fs, is_fileobj +from ovirt.node.utils import AugeasWrapper as Augeas, fs, is_fileobj, system from ovirt.node.utils.fs import ShellVarFile import glob import os @@ -227,12 +227,12 @@ """ hostnamefile = "/etc/hostname" - if not os.path.isfile(hostnamefile): + 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", "--static", "set-hostname", + utils.process.check_call(["hostnamectl", "set-hostname", new_hostname]) current_hostname = utils.fs.get_contents(hostnamefile) -- To view, visit https://gerrit.ovirt.org/42386 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I750bf996e04904ab07a123794ec498c6b4a9c474 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Fabian Deutsch <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
