summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGreg Padgett <gpadgett@redhat.com>2013-03-26 17:48:40 -0400
committerGreg Padgett <gpadgett@redhat.com>2013-03-26 17:48:40 -0400
commit984c72e522c585c6d3f6b3d3aec39fb21dd84028 (patch)
tree599087f987fe534d4bc8acff8c8e3a0ae074deaa /tests
parent41190448decad51cf76a85d727e6935a8a206cca (diff)
downloadvyos-cloud-init-984c72e522c585c6d3f6b3d3aec39fb21dd84028.tar.gz
vyos-cloud-init-984c72e522c585c6d3f6b3d3aec39fb21dd84028.zip
compatibility fixes for Fedora and RHEL
This patch fixes issues in Fedora 18 (and upcoming RHEL 7) which are present due to their use of systemd: - store locale configuration in /etc/locale.conf - store hostname in /etc/hostname - use a symlink for /etc/localtime (prior code would set the timezone but corrupt data in /usr/share/zoneinfo due to presence of symlink) It also contains fixes for issues unrelated to systemd adoption: - explicitly scan /dev/sr0 with blkid in order to get the optical drive in the blkid cache. This prevents an issue on systems running 2.6 kernels (such as RHEL 6) in which config disks on some devices won't be detected unless the device has previously been queried. (For reference, see https://patchwork.kernel.org/patch/1770241/) - append a newline when rewriting sysconfig files, as this is customary text configuration file formatting and is expected by some parsers (such as the ifcfg-rh plugin for NetworkManager)
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_datasource/test_configdrive.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py
index 930086db..d5935294 100644
--- a/tests/unittests/test_datasource/test_configdrive.py
+++ b/tests/unittests/test_datasource/test_configdrive.py
@@ -259,8 +259,9 @@ class TestConfigDriveDataSource(MockerTestCase):
def test_find_candidates(self):
devs_with_answers = {}
- def my_devs_with(criteria):
- return devs_with_answers[criteria]
+ def my_devs_with(*args, **kwargs):
+ criteria = args[0] if len(args) else kwargs.pop('criteria', None)
+ return devs_with_answers.get(criteria, [])
def my_is_partition(dev):
return dev[-1] in "0123456789" and not dev.startswith("sr")