From 493c16cd75f13aa40711a13720d3c3ca243508ad Mon Sep 17 00:00:00 2001 From: Lukas Bednar Date: Wed, 22 Jun 2016 16:47:55 +0200 Subject: [PATCH] Fixes issue #54: add -f for hostname cmd (#64) --- rrmngmnt/network.py | 2 +- tests/test_network.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rrmngmnt/network.py b/rrmngmnt/network.py index 0bb373a..56ede50 100644 --- a/rrmngmnt/network.py +++ b/rrmngmnt/network.py @@ -64,7 +64,7 @@ def get_hostname(self): :return: hostname :rtype: string """ - rc, out, _ = self._m.runCmd(['hostname']) + rc, out, _ = self._m.runCmd(['hostname', '-f']) if rc: return None return out.strip() diff --git a/tests/test_network.py b/tests/test_network.py index 9fb2c2e..222a8e1 100644 --- a/tests/test_network.py +++ b/tests/test_network.py @@ -235,7 +235,7 @@ class TestHostNameEtc(object): data = { 'which hostnamectl': (1, '', ''), - 'hostname': (0, 'local', ''), + 'hostname -f': (0, 'local', ''), 'hostname something ; sed -i -e /^HOSTNAME/d /etc/sysconfig/network ' '&& echo HOSTNAME=something >> /etc/sysconfig/network': (0, '', ''), }