summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-10-20 14:40:14 -0400
committerScott Moser <smoser@ubuntu.com>2014-10-20 14:40:14 -0400
commitdd1853b5b64c43995e33c129bc71def9f4bad0ce (patch)
tree4805f0f28317dc4dbba0ec36f9fd300b000df25e /tests
parent96c40932e147c84f0299fac830cdb94aad9c9478 (diff)
parent87a75c52902d7550acb812a626fddd72a6b2036f (diff)
downloadvyos-cloud-init-dd1853b5b64c43995e33c129bc71def9f4bad0ce.tar.gz
vyos-cloud-init-dd1853b5b64c43995e33c129bc71def9f4bad0ce.zip
fix for rhel7 by using 'uses_systemd' to detect upstart/systemd
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_handler/test_handler_set_hostname.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/unittests/test_handler/test_handler_set_hostname.py b/tests/unittests/test_handler/test_handler_set_hostname.py
index 03004ab9..e1530e30 100644
--- a/tests/unittests/test_handler/test_handler_set_hostname.py
+++ b/tests/unittests/test_handler/test_handler_set_hostname.py
@@ -37,10 +37,11 @@ class TestHostname(t_help.FilesystemMockingTestCase):
self.patchUtils(self.tmp)
cc_set_hostname.handle('cc_set_hostname',
cfg, cc, LOG, [])
- contents = util.load_file("/etc/sysconfig/network")
- n_cfg = ConfigObj(StringIO(contents))
- self.assertEquals({'HOSTNAME': 'blah.blah.blah.yahoo.com'},
- dict(n_cfg))
+ if not distro.uses_systemd():
+ contents = util.load_file("/etc/sysconfig/network")
+ n_cfg = ConfigObj(StringIO(contents))
+ self.assertEquals({'HOSTNAME': 'blah.blah.blah.yahoo.com'},
+ dict(n_cfg))
def test_write_hostname_debian(self):
cfg = {