aboutsummaryrefslogtreecommitdiff
path: root/tests/test_merge_config.py
AgeCommit message (Collapse)AuthorFilesLines
2026-08-24merge_configs: Add lstrip_blocksMichal Nasiadka1-0/+41
Closes-Bug: #2164718 Change-Id: If5b7f30d2467b61c3578d09992faf446b5d25f4e Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com> (cherry picked from commit 0f4da209da6fa39739ffc7b7fb1a69dc967734b7)
2024-03-29tests: Replace imp with importlib.machineryMichal Nasiadka1-2/+3
It's needed for Python3.12 support, because imp has been dropped [1]. Also shlex dropped s=None support [2]. [1]: https://docs.python.org/3/whatsnew/3.12.html [2]: https://github.com/python/cpython/issues/94352 Change-Id: I23f37897ea08ac708f6df485f699122df647e552
2021-03-05Remove whitespace around equal signs in zookeeper.cfgPierre Riteau1-0/+32
The merge_configs action plugin is updated with an option to control whether whitespace should be used around equal signs. The default remains to use whitespace: only zookeeper.cfg doesn't use them. This is to avoid issues with the zkCleanup.sh script which expects no whitespace. The ZooKeeper documentation also uses no whitespace in configuration file examples. Change-Id: Ia082a1c002cc4e8b04f7696fdee827b747c6d13f Closes-Bug: #1917490
2020-05-11Stop mocking ansible modules globallyWill Szumski1-5/+0
This causes non-local side effects that are hard to track down. E.g: --- import errors --- Failed to import test module: tests.test_merge_yaml Traceback (most recent call last): File "/home/will/.pyenv/versions/3.7.7/lib/python3.7/unittest/loader.py", line 436, in _find_test_path module = self._get_module_from_name(name) File "/home/will/.pyenv/versions/3.7.7/lib/python3.7/unittest/loader.py", line 377, in _get_module_from_name __import__(name) File "/home/will/code/kolla-ansible/tests/test_merge_yaml.py", line 19, in <module> from ansible.errors import AnsibleModuleError ModuleNotFoundError: No module named 'ansible.errors'; 'ansible' is not a package This `'ansible' is not a package` message occurs because ansible is a Mock. Depends-On: https://review.opendev.org/#/c/726768/ Change-Id: Iddbdd3d855daadbf12536cc990559e6b8e123051
2020-04-26Cleanup py27 supportRadosław Piliszek1-0/+2
Removes and/or replaces all mentions of py27. Cleans up obsolete requirements and their lower-constraints. Separates test-requirements. Makes lower-constraints pass outside of CI (MarkupSafe). Adds FIXMEs about some hacky Mocks that may misbehave. Change-Id: Ifc090bf3c1db17d8542ee591c91e8225a597bfe2
2020-04-02Use unittest.mock instead of PyPI mockRadosław Piliszek1-1/+1
Now that py2 is gone, oslotest dropped dependency on mock and will soon affect Ussuri CI [1], let's use unittest.mock built in py3. This also fixes py38 jobs and proactively prevents py36 and py37 failing due to [1]. This is because we never included mock in test-requirements (but in lower-constraints where it does not really belong at all) and instead relied on oslotest to bring it in. [1] https://review.opendev.org/716322 Change-Id: I30e82e2d87418272a71c7ee089a8acdaf8872158
2019-12-11Drop python 2 support from action pluginsMark Goddard1-1/+1
These are executed on the local host where we run ansible-playbook, and we have agreed to drop Python 2 support there. Partially Implements: blueprint drop-py2-support Change-Id: Id2190c3a22a56f4f048afbf0f7200daa8f41a292
2018-03-16Support parsing ini files with no sectionsDoug Szumski1-1/+76
Services such as Zookeeper and Kafka use ini files which do not explicitly specify sections. This change supports merging ini files with no sections, so that the configuration for these services follows the example configuration provided for them as closely as possible. Closes-Bug: #1756101 Partially-Implements: blueprint monasca-roles Change-Id: I1061729875e5545c7af7d80779f9c2124b6c7134
2017-02-16Change python interpreterAbel Lopez1-1/+1
There is inconsistent use of either `/usr/bin/python` or `/usr/bin/env python`. This makes for unexpected results when a user might be using a virtualenv. Change-Id: Ibb030f920a8869f9113ade70b66a921cc815060d
2017-01-19Close file-like object after usedCuong Nguyen1-0/+2
Change-Id: I7df581243deef7bda4b9b5926addf61421bd42f7
2017-01-04Support multi key in merge_config moduleJeffrey Zhang1-0/+106
Change-Id: Ibf9ee55c48a5181c5ba3aa46bef485cd3468f14c Closes-Bug: #1647065