ansible-2.9/ansible-2.9.27-pyyaml-6-compat.patch
starlet-dx a185b1fd17 Remove the python-nose compilation dependency and resolve the compilation error.
(cherry picked from commit 0bb2a3020f6eb272d9a45dbf44d4256d0644056a)
2022-06-28 15:35:52 +08:00

82 lines
3.9 KiB
Diff

diff --color -Nur ansible-2.9.27.orig/test/units/modules/cloud/openstack/test_os_server.py ansible-2.9.27/test/units/modules/cloud/openstack/test_os_server.py
--- ansible-2.9.27.orig/test/units/modules/cloud/openstack/test_os_server.py 2021-10-11 08:18:57.290846800 -0700
+++ ansible-2.9.27/test/units/modules/cloud/openstack/test_os_server.py 2021-10-26 14:36:44.086550302 -0700
@@ -22,7 +22,7 @@
module.'''
doc = inspect.getdoc(func)
- cfg = yaml.load(doc)
+ cfg = yaml.load(doc, Loader=yaml.CLoader)
for task in cfg:
for module, params in task.items():
diff --color -Nur ansible-2.9.27.orig/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py ansible-2.9.27/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py
--- ansible-2.9.27.orig/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py 2021-10-11 08:18:57.447847000 -0700
+++ ansible-2.9.27/test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py 2021-10-26 14:37:25.647363390 -0700
@@ -141,7 +141,7 @@
self.resource.update.return_value = data_merged
self.mock_ov_client.connection_templates.get.return_value = {"uri": "uri"}
- self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES)
+ self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES, Loader=yaml.CLoader)
EthernetNetworkModule().run()
@@ -155,7 +155,7 @@
self.resource.get_by.return_value = [DICT_PARAMS_WITH_CHANGES]
self.mock_ov_client.connection_templates.get.return_value = {"uri": "uri"}
- self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES)
+ self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES, Loader=yaml.CLoader)
EthernetNetworkModule().run()
@@ -174,7 +174,7 @@
self.mock_ov_client.connection_templates.get.return_value = {
"bandwidth": DICT_PARAMS_WITH_CHANGES['bandwidth']}
- self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES)
+ self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES, Loader=yaml.CLoader)
EthernetNetworkModule().run()
@@ -191,7 +191,7 @@
self.resource.get_by.return_value = [DEFAULT_ENET_TEMPLATE]
self.resource.update.return_value = data_merged
- self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES)
+ self.mock_ansible_module.params = yaml.load(YAML_PARAMS_WITH_CHANGES, Loader=yaml.CLoader)
EthernetNetworkModule().run()
@@ -329,7 +329,7 @@
"max": 1
}}
- self.mock_ansible_module.params = yaml.load(YAML_RESET_CONNECTION_TEMPLATE)
+ self.mock_ansible_module.params = yaml.load(YAML_RESET_CONNECTION_TEMPLATE, Loader=yaml.CLoader)
EthernetNetworkModule().run()
@@ -340,7 +340,7 @@
def test_should_fail_when_reset_not_existing_ethernet_network(self):
self.resource.get_by.return_value = [None]
- self.mock_ansible_module.params = yaml.load(YAML_RESET_CONNECTION_TEMPLATE)
+ self.mock_ansible_module.params = yaml.load(YAML_RESET_CONNECTION_TEMPLATE, Loader=yaml.CLoader)
EthernetNetworkModule().run()
diff --color -Nur ansible-2.9.27.orig/test/units/plugins/action/test_synchronize.py ansible-2.9.27/test/units/plugins/action/test_synchronize.py
--- ansible-2.9.27.orig/test/units/plugins/action/test_synchronize.py 2021-10-11 08:18:57.476847000 -0700
+++ ansible-2.9.27/test/units/plugins/action/test_synchronize.py 2021-10-26 15:22:02.968085259 -0700
@@ -121,7 +121,7 @@
metapath = os.path.join(fixturepath, 'meta.yaml')
with open(metapath, 'rb') as f:
fdata = f.read()
- test_meta = yaml.load(fdata)
+ test_meta = yaml.load(fdata, Loader=yaml.CLoader)
# load initial play context vars
if '_play_context' in test_meta: