Remove the python-nose compilation dependency and resolve the compilation error.

(cherry picked from commit 0bb2a3020f6eb272d9a45dbf44d4256d0644056a)
This commit is contained in:
starlet-dx 2022-05-09 12:15:58 +08:00 committed by openeuler-sync-bot
parent 706f5dce58
commit a185b1fd17
3 changed files with 100 additions and 2 deletions

View File

@ -0,0 +1,12 @@
diff --color -Nur ansible-2.9.23.orig/docs/docsite/_extensions/pygments_lexer.py ansible-2.9.23/docs/docsite/_extensions/pygments_lexer.py
--- ansible-2.9.23.orig/docs/docsite/_extensions/pygments_lexer.py 2021-06-21 23:04:48.000000000 -0700
+++ ansible-2.9.23/docs/docsite/_extensions/pygments_lexer.py 2021-07-10 12:33:05.790899630 -0700
@@ -178,7 +178,7 @@
See http://www.sphinx-doc.org/en/stable/extdev/index.html#dev-extensions.
"""
for lexer in [
- AnsibleOutputLexer(startinline=True)
+ AnsibleOutputLexer
]:
app.add_lexer(lexer.name, lexer)
for alias in lexer.aliases:

View File

@ -0,0 +1,81 @@
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:

View File

@ -2,7 +2,7 @@
Name: ansible-2.9
Summary: SSH-based configuration management, deployment, and task execution system
Version: 2.9.24
Release: 1
Release: 2
License: GPLv3+
Source0: https://releases.ansible.com/ansible/ansible-%{version}.tar.gz
Source1: ansible.attr
@ -15,6 +15,8 @@ Patch2: ansible-2.9.6-disable-test_build_requirement_from_path_no_v
Patch3: fix-python-3.9-compatibility.patch
Patch4: Disable-strict-markers-with-pytest-3.6.patch
Patch5: Skip-some-test-cases-that-fail-because-the-pytest-too-old.patch
Patch6: ansible-2.9.23-sphinx4.patch
Patch7: ansible-2.9.27-pyyaml-6-compat.patch
Provides: ansible-2.9-python3 = %{version}-%{release}
Obsoletes: ansible-2.9-python3 < %{version}-%{release}
Conflicts: ansible-base > 2.10.0
@ -27,7 +29,7 @@ BuildRequires: openssl
BuildRequires: python3-sphinx python3-sphinx-theme-alabaster python3-sphinx-notfound-page
BuildRequires: asciidoc python3-straight-plugin
%endif
BuildRequires: python3-devel python3-setuptools python3-six python3-nose python3-pytest
BuildRequires: python3-devel python3-setuptools python3-six python3-pytest
BuildRequires: python3-pytest-xdist python3-pytest-mock python3-requests python3-mock
BuildRequires: python3-jinja2 python3-pyyaml python3-cryptography python3-pyvmomi make
Recommends: python3-paramiko
@ -166,5 +168,8 @@ make PYTHON=/usr/bin/python3 tests-py3
%{python3_sitelib}/ansible_test
%changelog
* Mon May 9 2022 yaoxin <yaoxin30@h-partners.com> - 2.9.24-2
- Remove the python-nose compilation dependency and resolve the compilation error.
* Tue Sep 14 2021 huanghaitao <huanghaitao8@huawei.com> - 2.9.24-1
- package init