diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-10-20 14:40:14 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-10-20 14:40:14 -0400 |
commit | dd1853b5b64c43995e33c129bc71def9f4bad0ce (patch) | |
tree | 4805f0f28317dc4dbba0ec36f9fd300b000df25e /tests | |
parent | 96c40932e147c84f0299fac830cdb94aad9c9478 (diff) | |
parent | 87a75c52902d7550acb812a626fddd72a6b2036f (diff) | |
download | vyos-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.py | 9 |
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 = { |