Accepting request 835384 from home:pgajdos:python

- use pytest instead of nose and replace deprecated
  yamlordereddictloader by yamlloader
- added patches:
  + python-junos-eznc-remove-nose.patch
  + python-junos-eznc-remove-yamlordereddictloader.patch

OBS-URL: https://build.opensuse.org/request/show/835384
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-junos-eznc?expand=0&rev=16
This commit is contained in:
Tomáš Chvátal 2020-09-18 11:25:19 +00:00 committed by Git OBS Bridge
parent 66bc821e5a
commit daa3546840
4 changed files with 1584 additions and 5 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,350 @@
Index: py-junos-eznc-2.5.3/lib/jnpr/junos/command/__init__.py
===================================================================
--- py-junos-eznc-2.5.3.orig/lib/jnpr/junos/command/__init__.py 2020-08-25 11:35:29.000000000 +0200
+++ py-junos-eznc-2.5.3/lib/jnpr/junos/command/__init__.py 2020-09-15 09:47:59.613429201 +0200
@@ -5,7 +5,7 @@ import types
from jnpr.junos.factory.factory_loader import FactoryLoader
-import yamlordereddictloader
+import yamlloader
__all__ = []
@@ -30,7 +30,7 @@ class MetaPathLoader(object):
with open(os.path.join(os.path.dirname(__file__), mod + ".yml"), "r") as stream:
try:
modules = FactoryLoader().load(
- yaml.load(stream, Loader=yamlordereddictloader.Loader)
+ yaml.load(stream, Loader=yamlloader.ordereddict.Loader)
)
except yaml.YAMLError as exc:
raise ImportError("%s is not loaded" % mod)
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_cmdtable.py
===================================================================
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_cmdtable.py 2020-09-15 09:47:59.509428602 +0200
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_cmdtable.py 2020-09-15 09:50:10.066179959 +0200
@@ -11,7 +11,7 @@ from jnpr.junos.exception import RpcErro
from ncclient.manager import Manager, make_device_handler
from ncclient.transport import SSHSession
from mock import MagicMock, patch
-import yamlordereddictloader
+import yamlloader
from jnpr.junos.factory.factory_loader import FactoryLoader
import yaml
import json
@@ -50,7 +50,7 @@ CMErrorView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CMErrorTable(self.dev)
@@ -85,7 +85,7 @@ sysctlView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = sysctlVeriexecTable(self.dev)
@@ -126,7 +126,7 @@ CMErrorView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CMErrorTable(self.dev)
@@ -188,7 +188,7 @@ CMErrorView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CMErrorTable(self.dev)
@@ -212,7 +212,7 @@ CMErrorView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CMErrorTable(self.dev)
@@ -240,7 +240,7 @@ CMErrorView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CMErrorTable(self.dev)
@@ -267,7 +267,7 @@ CMErrorView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CMErrorTable(self.dev)
@@ -293,7 +293,7 @@ CMErrorView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CMErrorTable(self.dev).get()
@@ -327,7 +327,7 @@ FPCLinkStatTable:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = FPCLinkStatTable(self.dev)
@@ -371,7 +371,7 @@ ShowLuchipView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = ShowLuchipTable(self.dev)
@@ -474,7 +474,7 @@ FPCLinkStatTable:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = FPCLinkStatTable(self.dev)
@@ -518,7 +518,7 @@ XMChipStatsView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = XMChipStatsTable(self.dev)
@@ -537,7 +537,7 @@ FPCLinkStatTable:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = FPCLinkStatTable(self.dev)
@@ -636,7 +636,7 @@ FPCTTPReceiveStatsView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = FPCTTPStatsTable(self.dev)
@@ -710,7 +710,7 @@ MtipCgeStatisticsTable:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = MtipCgeSummaryTable(self.dev)
@@ -804,7 +804,7 @@ _ICMPRateView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = ICMPStatsTable(self.dev)
@@ -905,7 +905,7 @@ _ThrottleStatsTable:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = IthrottleIDTable(self.dev).get(target="fpc2")
@@ -946,7 +946,7 @@ ShowPciErrorsView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = ShowPciErrorsTable(self.dev).get()
@@ -988,7 +988,7 @@ FPCMemoryView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = FPCMemory(self.dev).get()
@@ -1046,7 +1046,7 @@ PQ3PCI:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = PQ3PCITable(self.dev)
@@ -1172,7 +1172,7 @@ _TopThreadTable:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = SchedulerTable(self.dev)
@@ -1209,7 +1209,7 @@ HostlbStatusSummaryView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = HostlbStatusSummaryTable(self.dev)
@@ -1235,7 +1235,7 @@ HostlbStatusSummaryView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = HostlbStatusSummaryTable(
@@ -1311,7 +1311,7 @@ _TransmitPerQueueView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = DevicesLocalTable(self.dev)
@@ -1382,7 +1382,7 @@ _ReceiveView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = DevicesLocalTable(self.dev)
@@ -1402,7 +1402,7 @@ EthernetSwitchStatisticsIterTable:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = EthernetSwitchStatisticsIterTable(self.dev)
@@ -1532,7 +1532,7 @@ _EthSwitchStatsFpc5Table:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = EthernetSwitchStatistics(self.dev)
@@ -1689,7 +1689,7 @@ _ShowToePfePacketStatsStream_rx_errors:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = ShowToePfePacketStatsTable(self.dev)
@@ -1757,7 +1757,7 @@ _ShowToePfePacketStatsStream_rx_errors:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = ShowToePfePacketStatsTable(self.dev)
@@ -2094,7 +2094,7 @@ XMChipInterruptStatsView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = XMChipInterruptStatsTable(self.dev)
@@ -2127,7 +2127,7 @@ XMChipInterruptStatsView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = XMChipInterruptStatsTable(self.dev)
@@ -2161,7 +2161,7 @@ FPCThreadView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = FPCThreads(self.dev)
@@ -2328,7 +2328,7 @@ CChipLoStatsView:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = CChipLoStatsTable(self.dev)
@@ -2356,7 +2356,7 @@ ARPview:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = ARPtable(self.dev)
@@ -2387,7 +2387,7 @@ ARPview:
"""
globals().update(
FactoryLoader().load(
- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader)
+ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader)
)
)
stats = ARPtable(self.dev)

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Sep 18 10:55:57 UTC 2020 - pgajdos@suse.com
- use pytest instead of nose and replace deprecated
yamlordereddictloader by yamlloader
- added patches:
+ python-junos-eznc-remove-nose.patch
+ python-junos-eznc-remove-yamlordereddictloader.patch
-------------------------------------------------------------------
Fri Aug 28 15:56:45 UTC 2020 - Martin Hauke <mardnh@gmx.de>

View File

@ -26,22 +26,30 @@ Summary: Junos 'EZ' automation for non-programmers
License: Apache-2.0
URL: https://www.github.com/Juniper/py-junos-eznc
Source: https://github.com/Juniper/py-junos-eznc/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# replace deprecated nose by pytest
# https://github.com/Juniper/py-junos-eznc/pull/1078
Patch0: python-junos-eznc-remove-nose.patch
# replace deprecated yamlordereddictloader by yamlloader
# https://github.com/Juniper/py-junos-eznc/pull/1078
Patch1: python-junos-eznc-remove-yamlordereddictloader.patch
BuildRequires: %{python_module Jinja2 >= 2.7.1}
BuildRequires: %{python_module PyYAML >= 5.1}
BuildRequires: %{python_module lxml >= 3.2.4}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module ncclient >= 0.6.3}
BuildRequires: %{python_module netaddr}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module ntc-templates}
BuildRequires: %{python_module paramiko >= 1.15.2}
BuildRequires: %{python_module pyparsing}
BuildRequires: %{python_module pyserial}
BuildRequires: %{python_module pytest-forked}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scp >= 0.7.0}
BuildRequires: %{python_module selectors2}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: %{python_module transitions}
BuildRequires: %{python_module yamlloader}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Jinja2 >= 2.7.1
@ -74,9 +82,8 @@ These capabilities include, but are not limited to:
%prep
%setup -q -n py-junos-eznc-%{version}
sed -i -e '/yamlordereddictloader/d' requirements.txt
# requires deprecated and not working yamlordereddictloader
rm tests/unit/factory/test_cmdtable.py
%patch0 -p1
%patch1 -p1
%build
%python_build
@ -86,7 +93,7 @@ rm tests/unit/factory/test_cmdtable.py
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_expand PYTHONPATH=lib/ nosetests-%{$python_bin_suffix} -v tests/unit
%pytest -m "not functional" --forked
%files %{python_files}
%license COPYRIGHT LICENSE