aboutsummaryrefslogtreecommitdiff
path: root/tests/test_merge_yaml.py
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2024-03-28 09:10:33 +0100
committerMichal Nasiadka <mnasiadka@gmail.com>2024-03-29 05:16:51 +0000
commit3c3c5179586f4ceebd70f0fee7e127f636b1c1af (patch)
tree98d56264874049cbd67a41109511489e95da5842 /tests/test_merge_yaml.py
parent2a150d1be9be242b0ee1e9075840d3802cfb21e6 (diff)
downloadkolla-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_yaml.py')
-rw-r--r--tests/test_merge_yaml.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_merge_yaml.py b/tests/test_merge_yaml.py
index 5c6baa182..d6b74ae77 100644
--- a/tests/test_merge_yaml.py
+++ b/tests/test_merge_yaml.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 ansible.errors import AnsibleModuleError
@@ -22,7 +22,7 @@ from oslotest import base
PROJECT_DIR = os.path.abspath(os.path.join(os. path.dirname(__file__), '../'))
MERGE_YAML_FILE = os.path.join(PROJECT_DIR,
'ansible/action_plugins/merge_yaml.py')
-merge_yaml = imp.load_source('merge_yaml', MERGE_YAML_FILE)
+merge_yaml = SourceFileLoader('merge_yaml', MERGE_YAML_FILE).load_module()
class MergeYamlConfigTest(base.BaseTestCase):