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, '', ''), }