From f580471fa748fa9cd1a5cfac1a535225b60703827c6f1a89f098c5c10c2ca99c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 15 Apr 2025 10:20:32 +0000 Subject: [PATCH] Enable sle15_python_module_pythons, project is Python 3.8+ OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-junos-eznc?expand=0&rev=36 --- .gitattributes | 23 + .gitignore | 1 + get-telnetlib-from-netmiko.patch | 23 + no-six.patch | 597 +++++++++++++++++ python-311.patch | 33 + python-junos-eznc-2.7.1.tar.gz | 3 + python-junos-eznc-2.7.2.tar.gz | 3 + python-junos-eznc-no-mock.patch | 611 ++++++++++++++++++ ...os-eznc-remove-yamlordereddictloader.patch | 364 +++++++++++ python-junos-eznc.changes | 378 +++++++++++ python-junos-eznc.spec | 100 +++ 11 files changed, 2136 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 get-telnetlib-from-netmiko.patch create mode 100644 no-six.patch create mode 100644 python-311.patch create mode 100644 python-junos-eznc-2.7.1.tar.gz create mode 100644 python-junos-eznc-2.7.2.tar.gz create mode 100644 python-junos-eznc-no-mock.patch create mode 100644 python-junos-eznc-remove-yamlordereddictloader.patch create mode 100644 python-junos-eznc.changes create mode 100644 python-junos-eznc.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/get-telnetlib-from-netmiko.patch b/get-telnetlib-from-netmiko.patch new file mode 100644 index 0000000..ea3deed --- /dev/null +++ b/get-telnetlib-from-netmiko.patch @@ -0,0 +1,23 @@ +Index: py-junos-eznc-2.7.2/lib/jnpr/junos/transport/tty_telnet.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/lib/jnpr/junos/transport/tty_telnet.py ++++ py-junos-eznc-2.7.2/lib/jnpr/junos/transport/tty_telnet.py +@@ -1,5 +1,5 @@ + from time import sleep +-import telnetlib ++from netmiko._telnetlib import telnetlib + import logging + import sys + +Index: py-junos-eznc-2.7.2/requirements.txt +=================================================================== +--- py-junos-eznc-2.7.2.orig/requirements.txt ++++ py-junos-eznc-2.7.2/requirements.txt +@@ -5,6 +5,7 @@ scp>=0.7.0 + jinja2>=2.7.1 + PyYAML>=5.1 + paramiko>=3.5.0 ++netmiko>=4.4.0 + pyserial + pyparsing + transitions diff --git a/no-six.patch b/no-six.patch new file mode 100644 index 0000000..136b450 --- /dev/null +++ b/no-six.patch @@ -0,0 +1,597 @@ +Index: py-junos-eznc-2.7.2/lib/jnpr/junos/jxml.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/lib/jnpr/junos/jxml.py ++++ py-junos-eznc-2.7.2/lib/jnpr/junos/jxml.py +@@ -1,7 +1,6 @@ + from ncclient import manager + from ncclient.xml_ import NCElement + from lxml import etree +-import six + + """ + These are Junos XML 'helper' definitions use for generic XML processing +@@ -226,8 +225,7 @@ def cscript_conf(reply): + + + # xslt to remove prefix like junos:ns +-strip_namespaces_prefix = six.b( +- """ ++strip_namespaces_prefix = b""" + + + +@@ -249,4 +247,3 @@ strip_namespaces_prefix = six.b( + + + """ +-) +Index: py-junos-eznc-2.7.2/lib/jnpr/junos/transport/tty_netconf.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/lib/jnpr/junos/transport/tty_netconf.py ++++ py-junos-eznc-2.7.2/lib/jnpr/junos/transport/tty_netconf.py +@@ -11,23 +11,22 @@ from lxml.etree import XMLSyntaxError + from datetime import datetime, timedelta + from ncclient.operations.rpc import RPCReply, RPCError + from ncclient.xml_ import to_ele +-import six + from ncclient.transport.session import HelloHandler + + + class PY6: +- NEW_LINE = six.b("\n") +- EMPTY_STR = six.b("") +- NETCONF_EOM = six.b("]]>]]>") +- STARTS_WITH = six.b("" +- ), +- six.b(""), +- six.b( +- """ ++ b"", ++ b"", ++ b""" + + + urn:ietf:params:netconf:base:1.0 +@@ -114,9 +110,8 @@ class TestSerialWin(unittest.TestCase): + + 7478 + +-]]>]]>""" +- ), +- six.b(""), ++]]>]]>""", ++ b"", + ] + self.dev.open() + +@@ -144,7 +139,7 @@ class TestSerialWin(unittest.TestCase): + self.dev._tty.read = MagicMock() + self.dev._tty.rawwrite = MagicMock() + self.dev._tty.read.side_effect = [ +- six.b( ++ bytes( + '' + '0.120.080." + "06]]>]]>" ++ "ormation>]]>]]>", ++ 'utf-8' + ) + ] + res = self.dev.rpc.get_route_engine_information() +Index: py-junos-eznc-2.7.2/tests/unit/transport/test_tty_netconf.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/tests/unit/transport/test_tty_netconf.py ++++ py-junos-eznc-2.7.2/tests/unit/transport/test_tty_netconf.py +@@ -7,7 +7,6 @@ from unittest.mock import MagicMock, pat + + from jnpr.junos.transport.tty_netconf import tty_netconf + +-import six + import os + import select + import socket +@@ -43,7 +42,7 @@ class TestTTYNetconf(unittest.TestCase): + @patch("jnpr.junos.transport.tty_netconf.timedelta") + def test_open_RuntimeError(self, mock_delta, mock_rcv): + mock_rcv.return_value = "]]>]]>" +- self.tty_net._tty.read.return_value = six.b("testing") ++ self.tty_net._tty.read.return_value = b"testing" + from datetime import timedelta + + mock_delta.return_value = timedelta(seconds=0.5) +@@ -56,7 +55,7 @@ class TestTTYNetconf(unittest.TestCase): + mock_rcv.return_value = "]]>]]>" + self.tty_net.rpc("get-interface-information") + self.tty_net._tty.rawwrite.assert_called_with( +- six.b("") ++ b"" + ) + + @patch("jnpr.junos.transport.tty_netconf.tty_netconf._receive") +@@ -103,7 +102,7 @@ class TestTTYNetconf(unittest.TestCase): + @patch("jnpr.junos.transport.tty_netconf.select.select") + def test_tty_netconf_receive_empty_line(self, mock_select): + rx = MagicMock() +- rx.read_until.side_effect = iter([six.b(""), six.b("]]>]]>")]) ++ rx.read_until.side_effect = iter([b"", b"]]>]]>"]) + mock_select.return_value = ([rx], [], []) + self.assertEqual(self.tty_net._receive().tag, "error-in-receive") + +@@ -117,7 +116,7 @@ class TestTTYNetconf(unittest.TestCase): + @patch("jnpr.junos.transport.tty_netconf.select.select") + def test_tty_netconf_receive_splited_eom(self, mock_select): + rx = MagicMock() +- rx.read_until.side_effect = iter([six.b(i) for i in ["testing]", "]>", "]]>"]]) ++ rx.read_until.side_effect = iter([i.encode('utf-8') for i in ["testing]", "]>", "]]>"]]) + mock_select.return_value = ([rx], [], []) + self.assertEqual(self.tty_net._receive().tag, "error-in-receive") + +@@ -126,30 +125,30 @@ class TestTTYNetconf(unittest.TestCase): + rx = MagicMock() + + rx.read_until.side_effect = iter( +- [six.b("ok"), six.b("\n]]>]]>")] ++ [b"ok", b"\n]]>]]>"] + ) + mock_select.return_value = ([rx], [], []) + self.assertEqual( +- self.tty_net._receive(), six.b("ok") ++ self.tty_net._receive(), b"ok" + ) + + @patch("jnpr.junos.transport.tty_netconf.select.select") + def test_tty_netconf_receive_XMLSyntaxError_eom_in_center(self, mock_select): + rx = MagicMock() + rx.read_until.side_effect = iter( +- [six.b("ok"), six.b("]]>]]>\ndummy")] ++ [b"ok", b"]]>]]>\ndummy"] + ) + mock_select.return_value = ([rx], [], []) +- self.assertEqual(self.tty_net._receive(), six.b("ok")) ++ self.assertEqual(self.tty_net._receive(), b"ok") + + @patch("jnpr.junos.transport.tty_netconf.select.select") + def test_tty_netconf_receive_xmn_error(self, mock_select): + rx = MagicMock() + rx.read_until.side_effect = iter( + [ +- six.b("ok"), +- six.b("\n\n"), +- six.b("]]>]]>\ndummy"), ++ b"ok", ++ b"\n\n", ++ b"]]>]]>\ndummy", + ] + ) + mock_select.return_value = ([rx], [], []) +Index: py-junos-eznc-2.7.2/tests/unit/transport/test_tty_telnet.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/tests/unit/transport/test_tty_telnet.py ++++ py-junos-eznc-2.7.2/tests/unit/transport/test_tty_telnet.py +@@ -7,7 +7,6 @@ except ImportError: + import nose2 + from unittest.mock import MagicMock, patch + from jnpr.junos.transport.tty_telnet import Telnet +-import six + + + class TestTTYTelnet(unittest.TestCase): +@@ -62,7 +61,7 @@ class TestTTYTelnet(unittest.TestCase): + self.tel_conn._tn.expect.return_value = ( + None, + None, +- six.b("port already in use"), ++ b"port already in use", + ) + self.assertRaises(RuntimeError, self.tel_conn._login_state_machine) + +Index: py-junos-eznc-2.7.2/lib/jnpr/junos/device.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/lib/jnpr/junos/device.py ++++ py-junos-eznc-2.7.2/lib/jnpr/junos/device.py +@@ -1,6 +1,5 @@ + # stdlib + import os +-import six + import types + import platform + import warnings +@@ -659,7 +658,7 @@ class _Connection(object): + command = command.strip() + # Get the equivalent RPC + rpc = self.display_xml_rpc(command) +- if isinstance(rpc, six.string_types): ++ if isinstance(rpc, str): + # No RPC is available. + return None + rpc_string = "rpc.%s(" % (rpc.tag.replace("-", "_")) +Index: py-junos-eznc-2.7.2/lib/jnpr/junos/utils/start_shell.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/lib/jnpr/junos/utils/start_shell.py ++++ py-junos-eznc-2.7.2/lib/jnpr/junos/utils/start_shell.py +@@ -3,7 +3,6 @@ import re + import datetime + from jnpr.junos.utils.ssh_client import open_ssh_client + import subprocess +-import six + from threading import Thread + import time + +Index: py-junos-eznc-2.7.2/requirements.txt +=================================================================== +--- py-junos-eznc-2.7.2.orig/requirements.txt ++++ py-junos-eznc-2.7.2/requirements.txt +@@ -5,7 +5,6 @@ scp>=0.7.0 + jinja2>=2.7.1 + PyYAML>=5.1 + paramiko>=3.5.0 +-six + pyserial + pyparsing + transitions +Index: py-junos-eznc-2.7.2/tests/unit/facts/test_swver.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/tests/unit/facts/test_swver.py ++++ py-junos-eznc-2.7.2/tests/unit/facts/test_swver.py +@@ -1,8 +1,6 @@ + __author__ = "Stacy Smith" + __credits__ = "Jeremy Schulman, Nitin Kumar" + +-import six +- + try: + import unittest2 as unittest + except: +@@ -13,9 +11,6 @@ from jnpr.junos.facts.swver import versi + + + class TestVersionInfo(unittest.TestCase): +- if six.PY2: +- assertCountEqual = unittest.TestCase.assertItemsEqual +- + def test_version_info_after_type_len_else(self): + self.assertEqual(version_info("12.1X46-D10").build, None) + +Index: py-junos-eznc-2.7.2/tests/unit/utils/test_scp.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/tests/unit/utils/test_scp.py ++++ py-junos-eznc-2.7.2/tests/unit/utils/test_scp.py +@@ -1,5 +1,5 @@ + import sys +-from six import StringIO ++from io import StringIO + from contextlib import contextmanager + + import unittest +Index: py-junos-eznc-2.7.2/tests/unit/utils/test_sw.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/tests/unit/utils/test_sw.py ++++ py-junos-eznc-2.7.2/tests/unit/utils/test_sw.py +@@ -1,7 +1,7 @@ + from __future__ import print_function + import os + import sys +-from six import StringIO ++from io import StringIO + + try: + import unittest2 as unittest diff --git a/python-311.patch b/python-311.patch new file mode 100644 index 0000000..96a5e89 --- /dev/null +++ b/python-311.patch @@ -0,0 +1,33 @@ +Index: py-junos-eznc-2.7.0/lib/jnpr/junos/device.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/lib/jnpr/junos/device.py ++++ py-junos-eznc-2.7.0/lib/jnpr/junos/device.py +@@ -43,6 +43,12 @@ from jnpr.junos.exception import JSONLoa + from ncclient.operations.third_party.juniper.rpc import ExecuteRpc + import inspect + ++# Python 3.11 compatibility ++# gh#Juniper/py-junos-eznc#1236 ++if not hasattr(inspect, "getargspec"): ++ inspect.getargspec = inspect.getfullargspec ++ ++ + if sys.version_info[0] >= 3: + NCCLIENT_FILTER_XML = len(inspect.signature(ExecuteRpc.request).parameters) == 3 + else: +Index: py-junos-eznc-2.7.0/lib/jnpr/junos/utils/scp.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/lib/jnpr/junos/utils/scp.py ++++ py-junos-eznc-2.7.0/lib/jnpr/junos/utils/scp.py +@@ -1,6 +1,11 @@ + from __future__ import absolute_import + import inspect + ++# Python 3.11 compatibility ++# gh#Juniper/py-junos-eznc#1236 ++if not hasattr(inspect, "getargspec"): ++ inspect.getargspec = inspect.getfullargspec ++ + from scp import SCPClient + from jnpr.junos.utils.ssh_client import open_ssh_client + diff --git a/python-junos-eznc-2.7.1.tar.gz b/python-junos-eznc-2.7.1.tar.gz new file mode 100644 index 0000000..a54a0ad --- /dev/null +++ b/python-junos-eznc-2.7.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c584ffe63b1c4e7d2f9313291a92cce3110997f51eb5c056e12ab7dcf9b497e5 +size 589560 diff --git a/python-junos-eznc-2.7.2.tar.gz b/python-junos-eznc-2.7.2.tar.gz new file mode 100644 index 0000000..ea15c14 --- /dev/null +++ b/python-junos-eznc-2.7.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24baccdce1ed147c732e2fc9d0c675a6f6c46e757201ac7aa0eba14e0959a3c2 +size 590993 diff --git a/python-junos-eznc-no-mock.patch b/python-junos-eznc-no-mock.patch new file mode 100644 index 0000000..e2ec2b7 --- /dev/null +++ b/python-junos-eznc-no-mock.patch @@ -0,0 +1,611 @@ +Index: py-junos-eznc-2.7.0/tests/unit/factory/test_cfgtable.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/factory/test_cfgtable.py ++++ py-junos-eznc-2.7.0/tests/unit/factory/test_cfgtable.py +@@ -13,7 +13,7 @@ from jnpr.junos import Device + from ncclient.manager import Manager, make_device_handler + from ncclient.transport import SSHSession + from lxml import etree +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + + from jnpr.junos.factory import loadyaml + from jnpr.junos.factory.factory_loader import FactoryLoader +Index: py-junos-eznc-2.7.0/tests/unit/factory/test_cmdtable.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/factory/test_cmdtable.py ++++ py-junos-eznc-2.7.0/tests/unit/factory/test_cmdtable.py +@@ -10,7 +10,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 ++from unittest.mock import MagicMock, patch + import yamlloader + from jnpr.junos.factory.factory_loader import FactoryLoader + import yaml +Index: py-junos-eznc-2.7.0/tests/unit/factory/test_factory_loader.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/factory/test_factory_loader.py ++++ py-junos-eznc-2.7.0/tests/unit/factory/test_factory_loader.py +@@ -4,7 +4,7 @@ __credits__ = "Jeremy Schulman" + import unittest + import nose2 + from jnpr.junos.factory import FactoryLoader +-from mock import patch ++from unittest.mock import patch + + + class TestFactoryLoader(unittest.TestCase): +Index: py-junos-eznc-2.7.0/tests/unit/factory/test_optable.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/factory/test_optable.py ++++ py-junos-eznc-2.7.0/tests/unit/factory/test_optable.py +@@ -19,7 +19,7 @@ from ncclient.operations.rpc import RPCR + + from lxml import etree + +-from mock import patch ++from unittest.mock import patch + + + class TestFactoryOpTable(unittest.TestCase): +Index: py-junos-eznc-2.7.0/tests/unit/factory/test_table.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/factory/test_table.py ++++ py-junos-eznc-2.7.0/tests/unit/factory/test_table.py +@@ -8,7 +8,7 @@ import os + from jnpr.junos import Device + from jnpr.junos.factory.table import Table + +-from mock import patch ++from unittest.mock import patch + from lxml import etree + from jnpr.junos.op.phyport import PhyPortTable + +Index: py-junos-eznc-2.7.0/tests/unit/factory/test_to_json.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/factory/test_to_json.py ++++ py-junos-eznc-2.7.0/tests/unit/factory/test_to_json.py +@@ -5,7 +5,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import patch ++from unittest.mock import patch + import os + import json + +Index: py-junos-eznc-2.7.0/tests/unit/factory/test_view.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/factory/test_view.py ++++ py-junos-eznc-2.7.0/tests/unit/factory/test_view.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman" + + import unittest + import nose2 +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + from jnpr.junos import Device + from jnpr.junos.factory.view import View + from jnpr.junos.op.phyport import PhyPortStatsTable, PhyPortStatsView +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_current_re.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_current_re.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_current_re.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from lxml import etree + +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_domain.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_domain.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_domain.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from lxml import etree + +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_ethernet_mac_table.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_ethernet_mac_table.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_ethernet_mac_table.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from lxml import etree + +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_file_list.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_file_list.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_file_list.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_get_chassis_cluster_status.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_get_chassis_cluster_status.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_get_chassis_cluster_status.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from lxml import etree + +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_get_chassis_inventory.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_get_chassis_inventory.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_get_chassis_inventory.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_get_route_engine_information.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_get_route_engine_information.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_get_route_engine_information.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from lxml import etree + +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_get_software_information.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_get_software_information.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_get_software_information.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from lxml import etree + +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_get_virtual_chassis_information.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_get_virtual_chassis_information.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_get_virtual_chassis_information.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + import sys + from lxml import etree +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_ifd_style.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_ifd_style.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_ifd_style.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from lxml import etree + +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_iri_mapping.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_iri_mapping.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_iri_mapping.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/facts/test_personality.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/facts/test_personality.py ++++ py-junos-eznc-2.7.0/tests/unit/facts/test_personality.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman, Nitin Ku + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + from jnpr.junos.exception import RpcError + +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_chassis.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_chassis.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_chassis.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman" + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + from lxml import etree + import os + +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_domain.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_domain.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_domain.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman" + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + from lxml import etree + + from jnpr.junos.ofacts.domain import facts_domain +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_ifd_style.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_ifd_style.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_ifd_style.py +@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman" + __credits__ = "Jeremy Schulman" + + import unittest +-from mock import patch ++from unittest.mock import patch + import nose2 + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_personality.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_personality.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_personality.py +@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman" + __credits__ = "Jeremy Schulman" + + import unittest +-from mock import patch ++from unittest.mock import patch + import nose2 + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_routing_engines.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_routing_engines.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_routing_engines.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman" + + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + import sys + +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_srx_cluster.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_srx_cluster.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_srx_cluster.py +@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman" + + import unittest + import nose2 +-from mock import patch ++from unittest.mock import patch + import os + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/test_decorators.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/test_decorators.py ++++ py-junos-eznc-2.7.0/tests/unit/test_decorators.py +@@ -12,7 +12,7 @@ from jnpr.junos.exception import RpcErro + from jnpr.junos.decorators import timeoutDecorator, normalizeDecorator + from jnpr.junos.decorators import ignoreWarnDecorator + +-from mock import patch, MagicMock, PropertyMock, call ++from unittest.mock import patch, MagicMock, PropertyMock, call + + from ncclient.operations.rpc import RPCError + from ncclient.manager import Manager, make_device_handler +Index: py-junos-eznc-2.7.0/tests/unit/test_rpcmeta.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/test_rpcmeta.py ++++ py-junos-eznc-2.7.0/tests/unit/test_rpcmeta.py +@@ -10,7 +10,7 @@ from ncclient.manager import Manager, ma + from ncclient.transport import SSHSession + from jnpr.junos.exception import JSONLoadError + +-from mock import patch, MagicMock, call ++from unittest.mock import patch, MagicMock, call + from lxml import etree + + __author__ = "Nitin Kumar, Rick Sherman" +Index: py-junos-eznc-2.7.0/tests/unit/utils/test_config.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/utils/test_config.py ++++ py-junos-eznc-2.7.0/tests/unit/utils/test_config.py +@@ -19,7 +19,7 @@ from ncclient.manager import Manager, ma + from ncclient.transport import SSHSession + from ncclient.operations import RPCError, RPCReply + +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + from lxml import etree + import os + +Index: py-junos-eznc-2.7.0/tests/unit/utils/test_fs.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/utils/test_fs.py ++++ py-junos-eznc-2.7.0/tests/unit/utils/test_fs.py +@@ -9,7 +9,7 @@ from jnpr.junos import Device + from jnpr.junos.utils.fs import FS + from jnpr.junos.exception import RpcError + +-from mock import patch, MagicMock, call ++from unittest.mock import patch, MagicMock, call + from lxml import etree + + __author__ = "Nitin Kumar, Rick Sherman" +Index: py-junos-eznc-2.7.0/tests/unit/utils/test_ftp.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/utils/test_ftp.py ++++ py-junos-eznc-2.7.0/tests/unit/utils/test_ftp.py +@@ -7,7 +7,7 @@ import os + from jnpr.junos import Device + import jnpr.junos.utils.ftp + +-from mock import patch ++from unittest.mock import patch + + if sys.version < "3": + builtin_string = "__builtin__" +Index: py-junos-eznc-2.7.0/tests/unit/utils/test_scp.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/utils/test_scp.py ++++ py-junos-eznc-2.7.0/tests/unit/utils/test_scp.py +@@ -8,7 +8,7 @@ import nose2 + from jnpr.junos import Device + from jnpr.junos.utils.scp import SCP + +-from mock import patch ++from unittest.mock import patch + + __author__ = "Rick Sherman, Nitin Kumar" + __credits__ = "Jeremy Schulman" +Index: py-junos-eznc-2.7.0/tests/unit/utils/test_start_shell.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/utils/test_start_shell.py ++++ py-junos-eznc-2.7.0/tests/unit/utils/test_start_shell.py +@@ -4,7 +4,7 @@ import nose2 + from jnpr.junos import Device + from jnpr.junos.utils.start_shell import StartShell + +-from mock import patch, MagicMock, call ++from unittest.mock import patch, MagicMock, call + + __author__ = "Rick Sherman" + __credits__ = "Jeremy Schulman, Nitin Kumar" +Index: py-junos-eznc-2.7.0/tests/unit/utils/test_sw.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/utils/test_sw.py ++++ py-junos-eznc-2.7.0/tests/unit/utils/test_sw.py +@@ -16,7 +16,7 @@ from jnpr.junos.facts.swver import versi + from ncclient.manager import Manager, make_device_handler + from ncclient.transport import SSHSession + from lxml import etree +-from mock import patch, MagicMock, call, mock_open ++from unittest.mock import patch, MagicMock, call, mock_open + + if sys.version < "3": + builtin_string = "__builtin__" +Index: py-junos-eznc-2.7.0/tests/unit/utils/test_util.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/utils/test_util.py ++++ py-junos-eznc-2.7.0/tests/unit/utils/test_util.py +@@ -7,7 +7,7 @@ import nose2 + from jnpr.junos import Device + from jnpr.junos.utils.util import Util + +-from mock import patch ++from unittest.mock import patch + + + class TestUtil(unittest.TestCase): +Index: py-junos-eznc-2.7.0/tests/unit/__init__.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/__init__.py ++++ py-junos-eznc-2.7.0/tests/unit/__init__.py +@@ -2,7 +2,7 @@ import unittest + import sys + + import nose2 +-from mock import patch ++from unittest.mock import patch + + __author__ = "Nitin Kumar" + __credits__ = "Jeremy Schulman" +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_switch_style.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_switch_style.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_switch_style.py +@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman" + __credits__ = "Jeremy Schulman" + + import unittest +-from mock import patch ++from unittest.mock import patch + import nose2 + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/ofacts/test_swver.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/ofacts/test_swver.py ++++ py-junos-eznc-2.7.0/tests/unit/ofacts/test_swver.py +@@ -6,7 +6,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import patch, MagicMock ++from unittest.mock import patch, MagicMock + import os + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/test_console.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/test_console.py ++++ py-junos-eznc-2.7.0/tests/unit/test_console.py +@@ -4,7 +4,7 @@ except ImportError: + import unittest + from jnpr.junos.utils.config import Config + import nose2 +-from mock import patch, MagicMock, call ++from unittest.mock import patch, MagicMock, call + import re + import sys + import os +Index: py-junos-eznc-2.7.0/tests/unit/test_device.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/test_device.py ++++ py-junos-eznc-2.7.0/tests/unit/test_device.py +@@ -3,7 +3,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import MagicMock, patch, mock_open, call ++from unittest.mock import MagicMock, patch, mock_open, call + import os + from lxml import etree + import sys +Index: py-junos-eznc-2.7.0/tests/unit/test_factcache.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/test_factcache.py ++++ py-junos-eznc-2.7.0/tests/unit/test_factcache.py +@@ -3,7 +3,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import patch, MagicMock, call ++from unittest.mock import patch, MagicMock, call + from jnpr.junos.exception import FactLoopError + + from jnpr.junos import Device +Index: py-junos-eznc-2.7.0/tests/unit/test_junos.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/test_junos.py ++++ py-junos-eznc-2.7.0/tests/unit/test_junos.py +@@ -4,7 +4,7 @@ import unittest + import sys + + import nose2 +-from mock import patch ++from unittest.mock import patch + + __author__ = "Nitin Kumar" + __credits__ = "Jeremy Schulman" +Index: py-junos-eznc-2.7.0/tests/unit/test_jxml.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/test_jxml.py ++++ py-junos-eznc-2.7.0/tests/unit/test_jxml.py +@@ -2,7 +2,7 @@ import os + import unittest + from io import StringIO + import nose2 +-from mock import patch ++from unittest.mock import patch + from jnpr.junos.jxml import ( + NAME, + INSERT, +Index: py-junos-eznc-2.7.0/tests/unit/transport/test_serial.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/transport/test_serial.py ++++ py-junos-eznc-2.7.0/tests/unit/transport/test_serial.py +@@ -3,7 +3,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + import sys + import six + +Index: py-junos-eznc-2.7.0/tests/unit/transport/test_tty.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/transport/test_tty.py ++++ py-junos-eznc-2.7.0/tests/unit/transport/test_tty.py +@@ -6,7 +6,7 @@ except ImportError: + import unittest + + import nose2 +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + + from jnpr.junos.transport.tty import Terminal + from jnpr.junos import exception as EzErrors +Index: py-junos-eznc-2.7.0/tests/unit/transport/test_tty_netconf.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/transport/test_tty_netconf.py ++++ py-junos-eznc-2.7.0/tests/unit/transport/test_tty_netconf.py +@@ -3,7 +3,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + + from jnpr.junos.transport.tty_netconf import tty_netconf + +Index: py-junos-eznc-2.7.0/tests/unit/transport/test_tty_ssh.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/transport/test_tty_ssh.py ++++ py-junos-eznc-2.7.0/tests/unit/transport/test_tty_ssh.py +@@ -6,7 +6,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + from jnpr.junos.transport.tty_ssh import SSH + + +Index: py-junos-eznc-2.7.0/tests/unit/transport/test_tty_telnet.py +=================================================================== +--- py-junos-eznc-2.7.0.orig/tests/unit/transport/test_tty_telnet.py ++++ py-junos-eznc-2.7.0/tests/unit/transport/test_tty_telnet.py +@@ -5,7 +5,7 @@ try: + except ImportError: + import unittest + import nose2 +-from mock import MagicMock, patch ++from unittest.mock import MagicMock, patch + from jnpr.junos.transport.tty_telnet import Telnet + import six + diff --git a/python-junos-eznc-remove-yamlordereddictloader.patch b/python-junos-eznc-remove-yamlordereddictloader.patch new file mode 100644 index 0000000..26183e1 --- /dev/null +++ b/python-junos-eznc-remove-yamlordereddictloader.patch @@ -0,0 +1,364 @@ +Index: py-junos-eznc-2.7.2/lib/jnpr/junos/command/__init__.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/lib/jnpr/junos/command/__init__.py ++++ py-junos-eznc-2.7.2/lib/jnpr/junos/command/__init__.py +@@ -4,7 +4,7 @@ from importlib.abc import Loader, MetaPa + from importlib.util import spec_from_loader + + import yaml +-import yamlordereddictloader ++import yamlloader + from jnpr.junos.factory.factory_loader import FactoryLoader + + __all__ = [] +@@ -32,7 +32,7 @@ class MetaPathLoader(Loader): + 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.7.2/tests/unit/factory/test_cmdtable.py +=================================================================== +--- py-junos-eznc-2.7.2.orig/tests/unit/factory/test_cmdtable.py ++++ py-junos-eznc-2.7.2/tests/unit/factory/test_cmdtable.py +@@ -11,7 +11,7 @@ from jnpr.junos.exception import RpcErro + from ncclient.manager import Manager, make_device_handler + from ncclient.transport import SSHSession + from unittest.mock import MagicMock, patch +-import yamlordereddictloader ++import yamlloader + from jnpr.junos.factory.factory_loader import FactoryLoader + import yaml + import json +@@ -49,7 +49,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) +@@ -84,7 +84,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) +@@ -125,7 +125,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) +@@ -187,7 +187,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) +@@ -211,7 +211,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) +@@ -239,7 +239,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) +@@ -266,7 +266,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) +@@ -292,7 +292,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() +@@ -326,7 +326,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) +@@ -370,7 +370,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) +@@ -473,7 +473,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) +@@ -517,7 +517,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) +@@ -536,7 +536,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) +@@ -635,7 +635,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) +@@ -709,7 +709,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) +@@ -803,7 +803,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) +@@ -904,7 +904,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") +@@ -945,7 +945,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() +@@ -987,7 +987,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() +@@ -1045,7 +1045,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) +@@ -1171,7 +1171,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) +@@ -1208,7 +1208,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) +@@ -1234,7 +1234,7 @@ HostlbStatusSummaryView: + """ + globals().update( + FactoryLoader().load( +- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader) ++ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader) + ) + ) + stats = HostlbStatusSummaryTable( +@@ -1310,7 +1310,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) +@@ -1381,7 +1381,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) +@@ -1401,7 +1401,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) +@@ -1531,7 +1531,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) +@@ -1688,7 +1688,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) +@@ -1756,7 +1756,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) +@@ -2093,7 +2093,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) +@@ -2126,7 +2126,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) +@@ -2160,7 +2160,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) +@@ -2327,7 +2327,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) +@@ -2355,7 +2355,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) +@@ -2384,9 +2384,10 @@ ARPview: + interface: INTERFACE + flag: FLAGS + """ ++ raise unittest.SkipTest("broken with yamlloader") + globals().update( + FactoryLoader().load( +- yaml.load(yaml_data, Loader=yamlordereddictloader.Loader) ++ yaml.load(yaml_data, Loader=yamlloader.ordereddict.Loader) + ) + ) + stats = ARPtable(self.dev) +Index: py-junos-eznc-2.7.2/requirements.txt +=================================================================== +--- py-junos-eznc-2.7.2.orig/requirements.txt ++++ py-junos-eznc-2.7.2/requirements.txt +@@ -7,6 +7,5 @@ PyYAML>=5.1 + paramiko>=3.5.0 + six + pyserial +-yamlordereddictloader + pyparsing + transitions diff --git a/python-junos-eznc.changes b/python-junos-eznc.changes new file mode 100644 index 0000000..d87f6c5 --- /dev/null +++ b/python-junos-eznc.changes @@ -0,0 +1,378 @@ +------------------------------------------------------------------- +Mon Apr 14 12:17:24 UTC 2025 - Georg Pfuetzenreuter + +- Enable sle15_python_module_pythons, project is Python 3.8+ + +------------------------------------------------------------------- +Wed Nov 27 08:56:52 UTC 2024 - Nico Krapp + +- Add get-telnetlib-from-netmiko.patch, telnetlib was removed from + the standardlibrary in Python 3.13 + * https://github.com/Juniper/py-junos-eznc/issues/1324 + +------------------------------------------------------------------- +Mon Oct 28 05:41:18 UTC 2024 - Steve Kowalik + +- Update to 2.7.2: + * Enhancements done + + Introduced bind_addr parameter in Device() API #1279 + + Introduced vmhost paramater in dev.facts #1333 + + Introduced hostkey_verify paramater in Device() API #1321 + * Bugs Fixed + + Fixed the missing key to EthernetSwitchingTable #1228 + + Fixed error handling on HelloHandler #1339 + + Fixed the version check #1338 + + Removed Google and Stackflow link from the ReadME #1337 + + Fixed SystemStorageTable tables and views to handles multiple + routing-engine file system storage information.#1244 + + Fixed Console' object has no attribute '_use_filter' error when + executed Table/View script #1335 + + Fixed cli function to get full RPC response #1315 + + Fixed sw.install to set no_validate option when validate=False for + NSSU and ISSU upgrade #1323 + + Fixed UT framework mock to use built-in unittest.mock #1311 + + Fixed specific VC member reboot handling #1308 #1310 + + Supported latest paramiko version which supports aes128-gcm and + aes256-gcm cipher +- Dropped patches: + * python-311.patch + * python-junos-eznc-no-mock.patch +- Refreshed all other patches. +- Switch to pyproject macros. +- Use nose2 to run the testsuite, like upstream. + +------------------------------------------------------------------- +Wed Apr 17 12:37:53 UTC 2024 - Markéta Machová + +- Update to 2.7.1 + * Added customer juniper paramiko module as a dependency which + supported aes128 and aes257 cipher #1299 +- Create no-six.patch to get rid of six dependency. + +------------------------------------------------------------------- +Mon Feb 12 11:01:26 UTC 2024 - Daniel Garcia + +- Update to 2.7.0: + - Support added for Python 3.10 and above version. +- 2.6.8: + - Introduced optional argument routing instance for fs.cp() API + - Introduced optional argument member_id for installation of pkg on + specific member id of EX-VC + - Changed the VlanTable field name to vlan-name and BfdSessionTable + field name to client-name #423 + - Fixed the port details in StartShell to use the port from Device + object instead of default Port 22 #573 + - Fixed the sw.install to use Windows file path for package copy + #1206 + - Fixed the sw.install to install the vc_master after the other + vc_members gets installed for EX-3400 where unlink is set by + default #1247 + - Removed Unused Dependency: Netaddr #1257 + - Fixed "object": version_info(re_version) emits ValueError: invalid + literal for int() with base 10: '17-EVO' for EVO version + X50.17-EVO#1264 +- Drop python-junos-eznc-remove-nose.patch + +------------------------------------------------------------------- +Thu Mar 2 07:14:57 UTC 2023 - Daniel Garcia + +- Add python-311.patch to support python 3.11, gh#Juniper/py-junos-eznc#1236 +- Remove python-junos-eznc-fix-unittests.patch, not needed anymore +- Update to 2.6.7: + * Supported option to set look_for_keys with bool True/False #1234 + * Fixed build failure against setuptools #1231 +- 2.6.6 + * Fixed reboot failing on other RE #1199 + * Fixed passing 'sleep' arg to StartShell run() #1202 + * Fixed PyEZ get-facts support for ACX model #1209 + * Fixed EthPortTable regex pattern #1215 + * Fixed StartShell UnboundLocalError #1203 #1211 +- 2.6.5 + * Supported multi-gig ports for EthPortTable.yml #1177 + * Fixed on-box support for start shell types #1190 #1186 + * Fixed conn_open_timeout value was getting set None , changed it to + default 30 seconds #1184 +- 2.6.4 + * Supported start_shell options to choose the shell types (sh or csh) #995 + * Supported for python 3.9 + * Fixed Device facts current_re returns the SRX cluster node0 and + node1 details with cluster ID 16 #1135 + * Fixed upgrade ncclient version 0.6.13, updated requirements.txt to + install ncclient==0.6.13 #1153 + * Fixed deprecation warning due to invalid escape sequences #1034 + * Fixed Unit tests test_sw_put_ftp failure #1165 + +------------------------------------------------------------------- +Tue May 3 11:54:14 UTC 2022 - pgajdos@suse.com + +- added patches + fix https://github.com/Juniper/py-junos-eznc/issues/1176 + + python-junos-eznc-no-mock.patch + +------------------------------------------------------------------- +Tue May 3 11:48:41 UTC 2022 - pgajdos@suse.com + +- added patches + fix https://github.com/Juniper/py-junos-eznc/commit/96f25bb8aa006e12e48902a91a1dc6ff595bdd2d + + python-junos-eznc-fix-unittests.patch + +------------------------------------------------------------------- +Tue Jan 11 20:48:52 UTC 2022 - Ben Greiner + +- remove selectors2 build requirement: It's unmaintained and pulled + in by ncclient only if necessary, i.e. on python <= 3.4, but + nowhere declared or used by this junos-eznc. + +------------------------------------------------------------------- +Wed Oct 13 10:15:04 UTC 2021 - ecsos + +- Update to version 2.6.3 + * Enhancements done + Adding ignore warning for rollback api #1131 + Add escaped $ Bourne-style shell prompt support #868 + * Bugs Fixed + - Fix for junos versions returning a bool value for config diff + if there are no changes #1093 + - Handle ncclient timeout exception at close. #787 + - Newer junos versions return a bool for config diff and not + etree if there are no changes #1093 +- Changes from 2.6.2 + * Bugs Fixed + - Fix for evo device as Password prompt comes directly during + telnet #1112 +- Changes from 2.6.1 + * Enhancement Added + - Flag for json.loads() for special character like newline was + made false by default. #1029 + * Bugs Fixed + - Transform function modified only for the rpc and set back to + original value. #1108 + - Skip the values returned in re-list without numbers during + multi re software install #1099 + - getiterator() replaced with iter() as was deprecated in + Python 3.2 and removed in Python 3.9 #1110 +- Drop python-junos-eznc-py39xml.patch because now in upstream. + +------------------------------------------------------------------- +Mon Apr 26 16:58:17 UTC 2021 - Ben Greiner + +- Update to 2.6.0 + * Python 2 support removed from this release. + * Session-id variable added to support telnet based persistent + connection in Juniper supported ansible collections. +- Add python-junos-eznc-py39xml.patch gh#Juniper/py-junos-eznc#1110 +- Skip failing test gh#Juniper/py-junos-eznc/issues/1109 + +------------------------------------------------------------------- +Thu Oct 29 19:40:57 UTC 2020 - Martin Hauke + +- Update to version 2.5.4 + Features Added + * cRPD model check to be added for on-box junos. + Bugs Fixed + * support use-fast-diff in diff/pdff function. + * Zeroize handling modified for scenario where only warning is + returned in the rpc-reply. + * ntc_template and textfsm module's installation made optional + and to be done explicitly if one want to use PyEZ table/view + for other vendors cli o/p parsing. + * Checksum algorithm argument to be passed during remote + checksum in software installation. + * docstring initialized with empty string as it becomes empty + if optimization flag is added. + +------------------------------------------------------------------- +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 + +- Update to version 2.5.3 + Bugs fixed: + * vmhost single re based image upgrade is failing while reboot. + +------------------------------------------------------------------- +Sat Aug 22 14:14:26 UTC 2020 - Martin Hauke + +- Update to version 2.5.2 + * juniper_junos_system fails when (vmhost) rebooting MX204 router + * Testcase failing in PyEZ after ncclient upgrade + * Wheel support for version integrated with versioneer. + * rpc-reply during reboot parsing gives error + +------------------------------------------------------------------- +Fri Jul 31 20:30:01 UTC 2020 - Martin Hauke + +- Update to version 2.5.1 + * Adding monitor-failure information in juniper_junos_facts + output + * Raise exception when dev.cli fails with exception + * Device version fix for srx when cluster id greater than 15 + +------------------------------------------------------------------- +Tue Jun 30 19:33:10 UTC 2020 - Martin Hauke + +- Update to version 2.5.0 + Features Added + * Versioneer support added for the code. + * Changes for ansible actions of the reboot, shutdown to be + handled in PyEZ + Bugs Fixed + * sax parser filter generation generic logic + * Changes for the msg displayed in case of failure in software + update + * ntc_template latest version uses textfsm 1.1.0 #1042 + * drop hard dependency on unittest2 #1040 +- Drop patch (fixed upstream) + * python-junos-eznc-no-unittest2.patch + +------------------------------------------------------------------- +Thu Jun 4 11:04:08 UTC 2020 - pgajdos@suse.com + +- version update to 2.4.1 + ## [1.4.0] + ### Fixed + - [#617] - IOS show ip ospf database router: Removed reliance on static spacing + - [#620] - NXOS show fex: Allow spaces in descriptions + - [#621] - Juniper show arp, etc.: Account for virtual chassis output (`{master:0}`) + - [#626] - ASA show vpn-sessiondb anyconnect: Require index, capture different format style + - [#650] - IOS show ip ospf database network: Change to allow one or more whitespace at the beginning of the line rather than 1 or more due to different output + - [#647] - ASA show route: Allow multiline route statements + - [#659] - IOS show mac address-table: Allow VLAN to be non-whitespace to allow N/A as an option + ### Added + - [#618] - IOS show ip ospf database network: New template + - [#619] - HP Comware display lldp neighbor information verbose: New template + - [#625] - ASA show vpn-sessiondb anyconnect: New template + - [#628] - Cisco WLC show mobility sum: New template + - [#631] - ASA show vpn-sessiondb anyconnect: Account for new data for assigned/public IP, group policy, and tunnel group + - [#629] - ASA show crypto ipsec sa - Add LOCAL_ADDRESS_NAME, CURRENT_PEER_NAME, DYNAMIC_PEER_NAME, LOCAL_CRYPTO_ENDPOINT_NAME, REMOTE_CRYPTO_ENDPOINT_NAME + - [#632] - ASA show nat: Added SERVICE_PROTOCOL + - [#635] - IOS show ip route summary: New template + - [#636] - ASA show vpn-sessiondb: New template + - [#638] - ASA show inventory: Capture PID and VID withoout serial + - [#637] - Cisco WLC show band select: New template + ## [1.4.0] + ### Fixed + - [#548] IOS show mac address-table: Account for Total Mac Addresses + - [#565] IOS show license: Avoid trailing spaces for features + - [#575] NXOS show version: Match N5K PLATFORM & LAST_REBOOT captures split words + - [#574] ASA show failover: Account for new output (IPS) + - [#577] IOS show mac address-table: Account for Multicast Entries + - [#582] NXOS show interface transceiver: Remove requirement for TYPE + - [#585] IOS show mac address-table: Fixed ordering for TYPE2 + - [#587] IOS show interfaces switchport: Account for Vepa Enabled and Operational Dot1q Ethertype + - [#584] IOS show switch detail: Account for Mac persistency wait time + - [#589] EOS show ip route: Filldown for DISTANCE and METRIC - Added new data formats for VRF and NEXT_HOP and INTERFACE + - [#592] Fortinet get router info bgp summary: Account for more data, fix UP_DOWN regex from word to non-whitespace + - [#603] IOS show ip access-list: Update PROTOCOL to capture numbered protocols + - [610] Aruba os show arp: Fix tests to have the full output from the command and device + - [#608] Vyatta VyOS show interfaces: Capture IP_ADDRESS with or without netmask + - [#614] IOS show interfaces status: Remove reliance on whitespaces + ### Added + - [#406] Testing: Add yamllint to test suite + - [#407] Testing: Add python black to test suite + - [#553] IOS show lldp neighbors: Added CAPABILITIES capture group + - [#554] IOS show logging: New template + - [#563] IOS show interfaces switchport: Added ADMIN_MDOE capture group + - [#562] ASA show logging: New template + - [#564] NXOS show interface transceiver: New template + - [#567] XR show arp: New template + - [#572] IOS show lldp neighbors detail: Added SERIAL capture group + - [#573] ASA show arp: New template + - [#578] Fortinet get system interface: New template + - [#576] Huawei VRP display lldp neighbor: New template + - [#581] Cisco WLC show vlan sum: New template + - [#580] XR show interfaces summary: New template + - [#590] IOS show ip bgp neighbors: New template + - [#591] NXOS show vdc: New template + - [#595] Checkpoint GAIA show arp dynamic all: New template + - [#593] IOS show module: New template + - [#597] Huwai VRP display version: New template + - [#602] NXOS show vrf interface: New template + - [#598] IOS show running-config partition access list: Added TCP_FLAG capture group + - [#598] IOS show running-config partition access list: Convert COMMENT to list + - [#598] IOS show running-config partition access list: Update PROTOCOL to include numbered protocols + - [#596] XR admin show environment power: New template + - [#594] Aruba os show arp: New template + - [#605] SG300 show version: New template + - [#604] NXOS show vlan: Added INTERFACES capture group, Require VLAN_ID + - [#600] IOS show mpls interfaces: New template + - [#599] IOS show etherchannel summary: New template + - [#611] NXOS show interface: Added MODE capture group + - [#612] NXOS show interfaces switchport: Added ACCESS_VLAN_NAME and NATIVE_VLAN_NAME capture groups + - [#609] HP Comware display ip interface: New template + - [#606] IOS show ip ospf database router: New template + ### Changed + - [#406] Helpers: Added development_helpers cli utility to replace existing helpers +- python3 package only, as ntc-templates is python3 only +- added patches + https://github.com/Juniper/py-junos-eznc/pull/1040 + + python-junos-eznc-no-unittest2.patch + +------------------------------------------------------------------- +Tue Dec 10 18:53:42 UTC 2019 - Martin Hauke + +- Update to version 2.3.1 + Bugfix release: + * Handled a check for pending Junos OS or package installation + * Fixed MetaPathLoader support only for jnpr.junos* modules + * Fixed huge tree XML support + * Fixed Junos sax parser issue for filter_xml broken + +------------------------------------------------------------------- +Mon Oct 7 08:24:05 UTC 2019 - Tomáš Chvátal + +- Update tests and dependencies to make the package work + +------------------------------------------------------------------- +Sun Sep 29 18:50:20 UTC 2019 - Martin Hauke + +- Use github source URL +- Add python-transitions to (Build)Requires +- Update to version 2.3.0 + Features Added + * TableView extended for vty/cli unstructured command + * Added junos SAX parser feature + * Added TableView Null Key support + * Added command tables + * Added reboot support for junos vmhost platform + * Added ElsEthernetSwitchingTable TableView + * Added callback functionality to ftp get + * Extended start shell support for Bourne shell + * Added at option support for sw.reboot() and sw.poweroff() + * Added generalized function for ssh-client + Bugs Fixed + * Updated fact collection for srx platform + * Supports new ssh private key format + * Handled exception in dev.close() + * Updated file transfers to use context manager to open files + * Fixed reboot and poweroff behavior + +------------------------------------------------------------------- +Thu Mar 7 13:40:54 UTC 2019 - Daniel Molkentin + +- Fix singlespec Requires + +------------------------------------------------------------------- +Wed Mar 6 13:34:51 UTC 2019 - Daniel Molkentin + +- Update to 2.2.0 + No changelog provided + +------------------------------------------------------------------- +Mon Aug 7 08:26:58 UTC 2017 - mardnh@gmx.de + +- Update to version 2.1.5 +- Convert to singlespec + +------------------------------------------------------------------- +Sat Sep 3 18:04:55 UTC 2016 - mardnh@gmx.de + +- initial package, version 2.0.0 + diff --git a/python-junos-eznc.spec b/python-junos-eznc.spec new file mode 100644 index 0000000..4bb6ed8 --- /dev/null +++ b/python-junos-eznc.spec @@ -0,0 +1,100 @@ +# +# spec file for package python-junos-eznc +# +# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2017-2020, Martin Hauke +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-junos-eznc +Version: 2.7.2 +Release: 0 +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 yamlordereddictloader by yamlloader +# https://github.com/Juniper/py-junos-eznc/pull/1078 +Patch0: python-junos-eznc-remove-yamlordereddictloader.patch +# PATCH-FIX-UPSTREAM gh#Juniper/py-junos-eznc#1307 Don't require six +Patch1: no-six.patch +# PATCH-FIX-UPSTREAM gh#Juniper/py-junos-eznc#1324 telnetlib not in py313 anymore +Patch2: get-telnetlib-from-netmiko.patch +BuildRequires: %{python_module Jinja2 >= 2.7.1} +BuildRequires: %{python_module PyYAML >= 5.1} +BuildRequires: %{python_module lxml >= 3.2.4} +BuildRequires: %{python_module ncclient >= 0.6.15} +BuildRequires: %{python_module netmiko >= 4.4.0} +BuildRequires: %{python_module nose2} +BuildRequires: %{python_module ntc-templates} +BuildRequires: %{python_module paramiko >= 1.15.2} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pyparsing} +BuildRequires: %{python_module pyserial} +BuildRequires: %{python_module scp >= 0.7.0} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module transitions} +BuildRequires: %{python_module wheel} +BuildRequires: %{python_module yamlloader} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-Jinja2 >= 2.7.1 +Requires: python-PyYAML >= 5.1 +Requires: python-lxml >= 3.2.4 +Requires: python-ncclient >= 0.6.15 +Requires: python-netmiko >= 4.4.0 +Requires: python-paramiko >= 1.15.2 +Requires: python-pyparsing +Requires: python-pyserial +Requires: python-scp >= 0.7.0 +Requires: python-transitions +BuildArch: noarch +%python_subpackages + +%description +Junos PyEZ is designed to provide the same capabilities as a user would have +on the Junos CLI, but in an environment built for automation tasks. +These capabilities include, but are not limited to: + + - Remote connectivity and management of Junos devices via NETCONF + - Provide "facts" about the device + - Retrieve "operational" or "run-state" information + - Retrieve configuration information + - Make configuration changes in unstructured and structured ways + - Provide common utilities for tasks such as secure copy of files and + software updates + +%prep +%autosetup -p1 -n py-junos-eznc-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%python_exec -B -m nose2 -vv tests.unit + +%files %{python_files} +%license COPYRIGHT LICENSE +%doc README.txt README.md +%dir %{python_sitelib}/jnpr +%{python_sitelib}/jnpr/junos +%{python_sitelib}/junos_eznc-%{version}.dist-info +%{python_sitelib}/junos_eznc-%{version}*-nspkg.pth + +%changelog