diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2024-03-28 09:10:33 +0100 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2024-03-29 05:16:51 +0000 |
| commit | 3c3c5179586f4ceebd70f0fee7e127f636b1c1af (patch) | |
| tree | 98d56264874049cbd67a41109511489e95da5842 /tests/test_merge_config.py | |
| parent | 2a150d1be9be242b0ee1e9075840d3802cfb21e6 (diff) | |
| download | kolla-ansible-3c3c5179586f4ceebd70f0fee7e127f636b1c1af.tar.gz kolla-ansible-3c3c5179586f4ceebd70f0fee7e127f636b1c1af.zip | |
tests: Replace imp with importlib.machinery
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
Diffstat (limited to 'tests/test_merge_config.py')
| -rw-r--r-- | tests/test_merge_config.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_merge_config.py b/tests/test_merge_config.py index 1a4cb3bc4..d64b2ae6b 100644 --- a/tests/test_merge_config.py +++ b/tests/test_merge_config.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import imp +from importlib.machinery import SourceFileLoader import os from io import StringIO @@ -25,7 +25,8 @@ MERGE_CONFIG_FILE = os.path.join(PROJECT_DIR, 'ansible/action_plugins/merge_configs.py') -merge_configs = imp.load_source('merge_configs', MERGE_CONFIG_FILE) +merge_configs = SourceFileLoader('merge_configs', + MERGE_CONFIG_FILE).load_module() TESTA = '''[DEFAULT] key1 = b |
