Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-junos-eznc for 
openSUSE:Factory checked in at 2021-04-27 21:35:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-junos-eznc (Old)
 and      /work/SRC/openSUSE:Factory/.python-junos-eznc.new.12324 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-junos-eznc"

Tue Apr 27 21:35:04 2021 rev:10 rq:888644 version:2.6.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-junos-eznc/python-junos-eznc.changes      
2020-11-02 09:41:47.381690315 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-junos-eznc.new.12324/python-junos-eznc.changes
   2021-04-27 21:35:27.976063204 +0200
@@ -1,0 +2,10 @@
+Mon Apr 26 16:58:17 UTC 2021 - Ben Greiner <[email protected]>
+
+- 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
+
+-------------------------------------------------------------------

Old:
----
  python-junos-eznc-2.5.4.tar.gz

New:
----
  python-junos-eznc-2.6.0.tar.gz
  python-junos-eznc-py39xml.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-junos-eznc.spec ++++++
--- /var/tmp/diff_new_pack.rDyKnJ/_old  2021-04-27 21:35:28.476064027 +0200
+++ /var/tmp/diff_new_pack.rDyKnJ/_new  2021-04-27 21:35:28.480064035 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-junos-eznc
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 # Copyright (c) 2017-2020, Martin Hauke <[email protected]>
 #
 # All modifications and additions to the file contributed by third parties
@@ -20,7 +20,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-junos-eznc
-Version:        2.5.4
+Version:        2.6.0
 Release:        0
 Summary:        Junos 'EZ' automation for non-programmers
 License:        Apache-2.0
@@ -32,11 +32,13 @@
 # replace deprecated yamlordereddictloader by yamlloader
 # https://github.com/Juniper/py-junos-eznc/pull/1078
 Patch1:         python-junos-eznc-remove-yamlordereddictloader.patch
+# https://github.com/Juniper/py-junos-eznc/pull/1110
+Patch2:         python-junos-eznc-py39xml.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 ncclient >= 0.6.9}
 BuildRequires:  %{python_module netaddr}
 BuildRequires:  %{python_module ntc-templates}
 BuildRequires:  %{python_module paramiko >= 1.15.2}
@@ -55,7 +57,7 @@
 Requires:       python-Jinja2 >= 2.7.1
 Requires:       python-PyYAML >= 5.1
 Requires:       python-lxml >= 3.2.4
-Requires:       python-ncclient >= 0.6.3
+Requires:       python-ncclient >= 0.6.9
 Requires:       python-netaddr
 Requires:       python-ntc-templates
 Requires:       python-paramiko >= 1.15.2
@@ -81,9 +83,7 @@
    software updates
 
 %prep
-%setup -q -n py-junos-eznc-%{version}
-%patch0 -p1
-%patch1 -p1
+%autosetup -p1 -n py-junos-eznc-%{version}
 
 %build
 %python_build
@@ -93,11 +93,17 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%pytest -m "not functional" --forked
+donttest="nonemptydonttestprefix"
+# https://github.com/Juniper/py-junos-eznc/issues/1109
+python39_donttest=" or test_sw_put_ftp"
+%pytest -m "not functional" --forked -k "not ($donttest ${$python_donttest})"
 
 %files %{python_files}
 %license COPYRIGHT LICENSE
 %doc README.txt README.md
-%{python_sitelib}/*
+%dir %{python_sitelib}/jnpr
+%{python_sitelib}/jnpr/junos
+%{python_sitelib}/junos_eznc-%{version}*-info
+%{python_sitelib}/junos_eznc-%{version}*-nspkg.pth
 
 %changelog

++++++ python-junos-eznc-2.5.4.tar.gz -> python-junos-eznc-2.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-junos-eznc-2.5.4/.travis.yml 
new/py-junos-eznc-2.6.0/.travis.yml
--- old/py-junos-eznc-2.5.4/.travis.yml 2020-10-28 17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/.travis.yml 2021-04-22 14:54:35.000000000 +0200
@@ -1,12 +1,6 @@
 language: python
 matrix:
     include:
-        - python: 2.7
-          dist: trusty
-        - python: 3.5
-          dist: trusty
-        - python: 3.6
-          dist: trusty
         - python: 3.7
           dist: xenial
         - python: 3.8
@@ -21,6 +15,7 @@
           env:
             - PATH=/c/Python37:/c/Python37/Scripts:$PATH
             - TRAVIS_PYTHON_VERSION=3.7
+            - CRYPTOGRAPHY_DONT_BUILD_RUST=1
 addons:
   apt:
     packages:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-junos-eznc-2.5.4/development.txt 
new/py-junos-eznc-2.6.0/development.txt
--- old/py-junos-eznc-2.5.4/development.txt     2020-10-28 17:16:20.000000000 
+0100
+++ new/py-junos-eznc-2.6.0/development.txt     2021-04-22 14:54:35.000000000 
+0200
@@ -6,4 +6,5 @@
 pep8        # https://github.com/jcrocholl/pep8
 pyflakes        # https://launchpad.net/pyflakes
 coveralls       # https://coveralls.io/
-ntc_templates # user needs to explicitly install this
\ No newline at end of file
+ntc_templates # user needs to explicitly install this
+cryptography==3.2
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-junos-eznc-2.5.4/lib/jnpr/junos/_version.py 
new/py-junos-eznc-2.6.0/lib/jnpr/junos/_version.py
--- old/py-junos-eznc-2.5.4/lib/jnpr/junos/_version.py  2020-10-28 
17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/lib/jnpr/junos/_version.py  2021-04-22 
14:54:35.000000000 +0200
@@ -22,9 +22,9 @@
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (HEAD -> master, tag: 2.5.4)"
-    git_full = "5095bf7dcbb92edae9bb640de2d5c21a870f3d1f"
-    git_date = "2020-10-28 21:46:20 +0530"
+    git_refnames = " (HEAD -> master, tag: 2.6.0)"
+    git_full = "216f611d25349e9c17503f0267b4a5c8d6f91d81"
+    git_date = "2021-04-22 18:24:35 +0530"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-junos-eznc-2.5.4/lib/jnpr/junos/factcache.py 
new/py-junos-eznc-2.6.0/lib/jnpr/junos/factcache.py
--- old/py-junos-eznc-2.5.4/lib/jnpr/junos/factcache.py 2020-10-28 
17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/lib/jnpr/junos/factcache.py 2021-04-22 
14:54:35.000000000 +0200
@@ -1,13 +1,17 @@
-import collections
 import warnings
 from pprint import pformat
 
+try:
+    from collections.abc import MutableMapping
+except ImportError:
+    from collections import MutableMapping
+
 import jnpr.junos.facts
 from jnpr.junos.facts import __doc__ as facts_doc
 import jnpr.junos.exception
 
 
-class _FactCache(collections.MutableMapping):
+class _FactCache(MutableMapping):
     """
     A dictionary-like object which performs on-demand fact gathering.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/py-junos-eznc-2.5.4/lib/jnpr/junos/factory/to_json.py 
new/py-junos-eznc-2.6.0/lib/jnpr/junos/factory/to_json.py
--- old/py-junos-eznc-2.5.4/lib/jnpr/junos/factory/to_json.py   2020-10-28 
17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/lib/jnpr/junos/factory/to_json.py   2021-04-22 
14:54:35.000000000 +0200
@@ -2,7 +2,11 @@
 import json
 from lxml import etree
 from copy import deepcopy
-import collections
+
+try:
+    from collections.abc import MutableMapping
+except ImportError:
+    from collections import MutableMapping
 
 
 class TableJSONEncoder(json.JSONEncoder):
@@ -68,7 +72,7 @@
             # JSON does not support comments - strip them
             obj = strip_comments_transform(deepcopy(obj)).getroot()
             _, obj = recursive_dict(obj)
-        elif isinstance(obj, collections.MutableMapping):
+        elif isinstance(obj, MutableMapping):
             obj = {k: v for k, v in obj.items()}
         else:
             obj = super(PyEzJSONEncoder, self).default(obj)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-junos-eznc-2.5.4/lib/jnpr/junos/transport/tty.py 
new/py-junos-eznc-2.6.0/lib/jnpr/junos/transport/tty.py
--- old/py-junos-eznc-2.5.4/lib/jnpr/junos/transport/tty.py     2020-10-28 
17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/lib/jnpr/junos/transport/tty.py     2021-04-22 
14:54:35.000000000 +0200
@@ -115,6 +115,8 @@
         # now start NETCONF XML
         logger.info("TTY: OK.....starting NETCONF")
         self.nc.open(at_shell=self.at_shell)
+        self.session_id = self.nc._session_id
+
         return True
 
     def logout(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/py-junos-eznc-2.5.4/lib/jnpr/junos/transport/tty_netconf.py 
new/py-junos-eznc-2.6.0/lib/jnpr/junos/transport/tty_netconf.py
--- old/py-junos-eznc-2.5.4/lib/jnpr/junos/transport/tty_netconf.py     
2020-10-28 17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/lib/jnpr/junos/transport/tty_netconf.py     
2021-04-22 14:54:35.000000000 +0200
@@ -12,6 +12,7 @@
 from ncclient.operations.rpc import RPCReply, RPCError
 from ncclient.xml_ import to_ele
 import six
+from ncclient.transport.session import HelloHandler
 
 
 class PY6:
@@ -45,6 +46,7 @@
     def __init__(self, tty):
         self._tty = tty
         self.hello = None
+        self._session_id = -1
 
     # -------------------------------------------------------------------------
     # NETCONF session open and close
@@ -67,6 +69,7 @@
             raise RuntimeError("Error: netconf not responding")
 
         self.hello = self._receive()
+        self._session_id, _ = HelloHandler.parse(self.hello.decode("utf-8"))
 
     def close(self, force=False):
         """ issue the XML API to close the session """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-junos-eznc-2.5.4/requirements.txt 
new/py-junos-eznc-2.6.0/requirements.txt
--- old/py-junos-eznc-2.5.4/requirements.txt    2020-10-28 17:16:20.000000000 
+0100
+++ new/py-junos-eznc-2.6.0/requirements.txt    2021-04-22 14:54:35.000000000 
+0200
@@ -1,5 +1,6 @@
 lxml>=3.2.4
-ncclient>=0.6.3
+# ncclient version 0.6.10 has issues with PyEZ(junos-eznc) and needs to be 
avoided
+ncclient==0.6.9
 paramiko>=1.15.2
 scp>=0.7.0
 jinja2>=2.7.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-junos-eznc-2.5.4/setup.py 
new/py-junos-eznc-2.6.0/setup.py
--- old/py-junos-eznc-2.5.4/setup.py    2020-10-28 17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/setup.py    2021-04-22 14:54:35.000000000 +0200
@@ -24,7 +24,7 @@
         "jnpr.junos.cfgro": ["*.yml"],
         "jnpr.junos.resources": ["*.yml"],
     },
-    python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
+    python_requires=">=3.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
     install_requires=install_reqs,
     classifiers=[
         "Development Status :: 5 - Production/Stable",
@@ -36,11 +36,7 @@
         "License :: OSI Approved :: Apache Software License",
         "Operating System :: OS Independent",
         "Programming Language :: Python",
-        "Programming Language :: Python :: 2",
-        "Programming Language :: Python :: 2.7",
         "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.5",
-        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Topic :: Software Development :: Libraries",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/py-junos-eznc-2.5.4/tests/unit/transport/test_tty_netconf.py 
new/py-junos-eznc-2.6.0/tests/unit/transport/test_tty_netconf.py
--- old/py-junos-eznc-2.5.4/tests/unit/transport/test_tty_netconf.py    
2020-10-28 17:16:20.000000000 +0100
+++ new/py-junos-eznc-2.6.0/tests/unit/transport/test_tty_netconf.py    
2021-04-22 14:54:35.000000000 +0200
@@ -20,7 +20,21 @@
 
     @patch("jnpr.junos.transport.tty_netconf.tty_netconf._receive")
     def test_open_at_shell_true(self, mock_rcv):
-        mock_rcv.return_value = "]]>]]>"
+        mock_rcv.return_value = (
+            b""
+            b"<!-- user lab, class j-superuser -->"
+            b'<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">'
+            b"<capabilities>"
+            b"<capability>urn:ietf:params:netconf:base:1.0</capability>"
+            
b"<capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability>"
+            
b"<capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?scheme=http,ftp,file</capability>"
+            
b"<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring</capability>"
+            
b"<capability>http://xml.juniper.net/netconf/junos/1.0</capability>"
+            b"<capability>http://xml.juniper.net/dmi/system/1.0</capability>"
+            b"</capabilities>"
+            b"<session-id>82697</session-id>"
+            b"</hello>"
+        )
         self.tty_net.open(True)
         self.tty_net._tty.write.assert_called_with("xml-mode netconf 
need-trailer")
 

++++++ python-junos-eznc-py39xml.patch ++++++
Index: py-junos-eznc-2.6.0/lib/jnpr/junos/factory/cfgtable.py
===================================================================
--- py-junos-eznc-2.6.0.orig/lib/jnpr/junos/factory/cfgtable.py
+++ py-junos-eznc-2.6.0/lib/jnpr/junos/factory/cfgtable.py
@@ -158,7 +158,7 @@ class CfgTable(Table):
             add_field = self._grindfield(lxpath[-1], field_value)
             for _add in add_field:
                 if len(_add.attrib) > 0:
-                    for i in dot.getiterator():
+                    for i in dot.iter():
                         if i.tag == _add.tag:
                             i.attrib.update(_add.attrib)
                             break
Index: py-junos-eznc-2.6.0/lib/jnpr/junos/jxml.py
===================================================================
--- py-junos-eznc-2.6.0.orig/lib/jnpr/junos/jxml.py
+++ py-junos-eznc-2.6.0/lib/jnpr/junos/jxml.py
@@ -161,7 +161,7 @@ strip_rpc_error_transform = etree.XSLT(s
 
 
 def remove_namespaces(xml):
-    for elem in xml.getiterator():
+    for elem in xml.iter():
         if elem.tag is etree.Comment:
             continue
         i = elem.tag.find("}")
@@ -171,7 +171,7 @@ def remove_namespaces(xml):
 
 
 def remove_namespaces_and_spaces(xml):
-    for elem in xml.getiterator():
+    for elem in xml.iter():
         if elem.tag is etree.Comment:
             continue
         # Remove namespace from attributes
Index: py-junos-eznc-2.6.0/tests/unit/test_jxml.py
===================================================================
--- py-junos-eznc-2.6.0.orig/tests/unit/test_jxml.py
+++ py-junos-eznc-2.6.0/tests/unit/test_jxml.py
@@ -40,7 +40,7 @@ class Test_JXML(unittest.TestCase):
         parser = ET.XMLParser()
         root = ET.parse(StringIO(xmldata), parser)
         test = remove_namespaces(root)
-        for elem in test.getiterator():
+        for elem in test.iter():
             i = elem.tag.find("}")
             if i > 0:
                 i = i + 1

Reply via email to