Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-ncclient for openSUSE:Factory
checked in at 2022-06-19 21:11:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ncclient (Old)
and /work/SRC/openSUSE:Factory/.python-ncclient.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ncclient"
Sun Jun 19 21:11:32 2022 rev:19 rq:983726 version:0.6.13
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ncclient/python-ncclient.changes
2022-03-24 23:00:42.968407831 +0100
+++
/work/SRC/openSUSE:Factory/.python-ncclient.new.1548/python-ncclient.changes
2022-06-19 21:11:50.274213044 +0200
@@ -1,0 +2,11 @@
+Sun Jun 19 17:40:24 UTC 2022 - Dirk M??ller <[email protected]>
+
+- update to 0.6.13:
+ * Remove extraneous capability in default device
+ * Refactor deprecated unittest aliases for Python 3.11 compatibility
+ * Added support for environment variable
+ * Migrate from Travis to GitHub Actions
+ * Update Build Pill
+ * add netconf base namespace to edit-config config element if it is missing
+
+-------------------------------------------------------------------
Old:
----
ncclient-0.6.12.tar.gz
New:
----
ncclient-0.6.13.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ncclient.spec ++++++
--- /var/tmp/diff_new_pack.nPDfBF/_old 2022-06-19 21:11:50.714213699 +0200
+++ /var/tmp/diff_new_pack.nPDfBF/_new 2022-06-19 21:11:50.718213704 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-ncclient
-Version: 0.6.12
+Version: 0.6.13
Release: 0
Summary: Python library for NETCONF clients
License: Apache-2.0
++++++ ncclient-0.6.12.tar.gz -> ncclient-0.6.13.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/.github/workflows/check.yaml
new/ncclient-0.6.13/.github/workflows/check.yaml
--- old/ncclient-0.6.12/.github/workflows/check.yaml 1970-01-01
01:00:00.000000000 +0100
+++ new/ncclient-0.6.13/.github/workflows/check.yaml 2022-04-10
22:15:50.000000000 +0200
@@ -0,0 +1,47 @@
+name: Run Tests and Check Coverage
+
+on: [push, pull_request]
+
+jobs:
+ check:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9']
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: 'recursive'
+
+ - name: Setup Python 3.8
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install Dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install rednose coverage coveralls
+ pip install -r requirements.txt
+ pip install -r test-requirements.txt
+
+ - name: Run Check Scripts
+ run: |
+ nosetests test --rednose --verbosity=3 --with-coverage
--cover-package ncclient
+
+ - name: Upload Coverage
+ env:
+ COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
+ run: |
+ coveralls
+
+ # coveralls_finish:
+ # needs: check
+ # runs-on: ubuntu-latest
+ # steps:
+ # - name: Coveralls Finished
+ # uses: coverallsapp/github-action@master
+ # with:
+ # path-to-lcov: .coverage
+ # github-token: ${{ secrets.GITHUB_TOKEN }}
+
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/.travis.yml
new/ncclient-0.6.13/.travis.yml
--- old/ncclient-0.6.12/.travis.yml 2021-05-29 18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/.travis.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-language: python
-python:
-- '2.7'
-- '3.5'
-- '3.6'
-- '3.7'
-- '3.8'
-- '3.9'
-install:
-- pip install .
-- pip install -r requirements.txt
-- pip install rednose coverage coveralls
-script: nosetests test --rednose --verbosity=3 --with-coverage --cover-package
ncclient
-after_success: coveralls
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/README.md
new/ncclient-0.6.13/README.md
--- old/ncclient-0.6.12/README.md 2021-05-29 18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/README.md 2022-04-10 22:15:50.000000000 +0200
@@ -1,4 +1,4 @@
-[](https://travis-ci.org/ncclient/ncclient)
+
[](https://coveralls.io/github/ncclient/ncclient?branch=master)
[](https://readthedocs.org/projects/ncclient/?badge=latest)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/ncclient/_version.py
new/ncclient-0.6.13/ncclient/_version.py
--- old/ncclient-0.6.12/ncclient/_version.py 2021-05-29 18:32:33.000000000
+0200
+++ new/ncclient-0.6.13/ncclient/_version.py 2022-04-10 22:15:50.000000000
+0200
@@ -23,9 +23,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 = " (tag: v0.6.12)"
- git_full = "c52390d93151852d5827beaba80c62278222f5e1"
- git_date = "2021-05-29 17:32:33 +0100"
+ git_refnames = " (tag: v0.6.13)"
+ git_full = "e4dad6e6b1c3c0db5b47302030d24f4a03e00e36"
+ git_date = "2022-04-10 21:15:50 +0100"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/ncclient/devices/csr.py
new/ncclient-0.6.13/ncclient/devices/csr.py
--- old/ncclient-0.6.12/ncclient/devices/csr.py 2021-05-29 18:32:33.000000000
+0200
+++ new/ncclient-0.6.13/ncclient/devices/csr.py 2022-04-10 22:15:50.000000000
+0200
@@ -14,6 +14,7 @@
from .default import DefaultDeviceHandler
+from warnings import warn
def csr_unknown_host_cb(host, fingerprint):
#This will ignore the unknown host check when connecting to CSR devices
@@ -25,7 +26,15 @@
"""
def __init__(self, device_params):
+ warn(
+ 'CsrDeviceHandler is deprecated, please use IosxeDeviceHandler',
+ DeprecationWarning,
+ stacklevel=2)
super(CsrDeviceHandler, self).__init__(device_params)
def add_additional_ssh_connect_params(self, kwargs):
+ warn(
+ 'CsrDeviceHandler is deprecated, please use IosxeDeviceHandler',
+ DeprecationWarning,
+ stacklevel=2)
kwargs['unknown_host_cb'] = csr_unknown_host_cb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/ncclient/devices/default.py
new/ncclient-0.6.13/ncclient/devices/default.py
--- old/ncclient-0.6.12/ncclient/devices/default.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/ncclient/devices/default.py 2022-04-10
22:15:50.000000000 +0200
@@ -53,7 +53,6 @@
"urn:ietf:params:netconf:capability:validate:1.0",
"urn:ietf:params:netconf:capability:xpath:1.0",
"urn:ietf:params:netconf:capability:notification:1.0",
- "urn:liberouter:params:netconf:capability:power-control:1.0",
"urn:ietf:params:netconf:capability:interleave:1.0",
"urn:ietf:params:netconf:capability:with-defaults:1.0"
]
@@ -256,6 +255,19 @@
def transform_reply(self):
return False
+ def transform_edit_config(self, node):
+ """
+ Hook for working around bugs in devices that cannot deal with
+ standard config payloads for edits. This will be called
+ in EditConfig.request just before the request is submitted,
+ meaning it will get an XML tree rooted at edit-config.
+
+ :param node: the XML tree for edit-config
+
+ :return: either the original XML tree if no changes made or a modified
XML tree
+ """
+ return node
+
def get_xml_parser(self, session):
"""
vendor can chose which parser to use for RPC reply response.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/ncclient/devices/iosxe.py
new/ncclient-0.6.13/ncclient/devices/iosxe.py
--- old/ncclient-0.6.12/ncclient/devices/iosxe.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/ncclient/devices/iosxe.py 2022-04-10
22:15:50.000000000 +0200
@@ -12,13 +12,17 @@
"""
-
from .default import DefaultDeviceHandler
from ncclient.operations.third_party.iosxe.rpc import SaveConfig
+from ncclient.xml_ import BASE_NS_1_0
+
+import logging
+logger = logging.getLogger("ncclient.devices.iosxe")
+
def iosxe_unknown_host_cb(host, fingerprint):
- #This will ignore the unknown host check when connecting to CSR devices
+ # This will ignore the unknown host check when connecting to CSR
devices
return True
class IosxeDeviceHandler(DefaultDeviceHandler):
@@ -36,3 +40,11 @@
def add_additional_ssh_connect_params(self, kwargs):
kwargs['unknown_host_cb'] = iosxe_unknown_host_cb
+
+ def transform_edit_config(self, node):
+ # find the first node that has the tag "config" with no namespace
+ nodes = node.findall("./config")
+ if len(nodes) == 1:
+ logger.debug('IOS XE handler: patching namespace of config
element')
+ nodes[0].tag = '{%s}%s' % (BASE_NS_1_0, 'config')
+ return node
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/ncclient/operations/edit.py
new/ncclient-0.6.13/ncclient/operations/edit.py
--- old/ncclient-0.6.12/ncclient/operations/edit.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/ncclient/operations/edit.py 2022-04-10
22:15:50.000000000 +0200
@@ -72,6 +72,7 @@
sub_ele(node, "url").text = config
else:
raise OperationError("Invalid URL.")
+ node = self._device_handler.transform_edit_config(node)
return self._request(node)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/ncclient/transport/ssh.py
new/ncclient-0.6.13/ncclient/transport/ssh.py
--- old/ncclient-0.6.12/ncclient/transport/ssh.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/ncclient/transport/ssh.py 2022-04-10
22:15:50.000000000 +0200
@@ -178,7 +178,8 @@
sock_fd = None,
bind_addr = None,
sock = None,
- keepalive = None):
+ keepalive = None,
+ environment = None):
"""Connect via SSH and initialize the NETCONF session. First attempts
the publickey authentication method and then password authentication.
@@ -215,6 +216,8 @@
*sock* is an already open Python socket to be used for this connection.
*keepalive* Turn on/off keepalive packets (default is off). If this is
set, after interval seconds without sending any data over the connection, a
"keepalive" packet will be sent (and ignored by the remote host). This can be
useful to keep connections alive over a NAT.
+
+ *environment* a dictionary containing the name and respective values
to set
"""
if not (host or sock_fd or sock):
raise SSHError("Missing host, socket or socket fd")
@@ -373,6 +376,17 @@
self._channel_id = self._channel.get_id()
channel_name = "%s-subsystem-%s" % (subname, str(self._channel_id))
self._channel.set_name(channel_name)
+ if environment:
+ try:
+ self._channel.update_environment(environment)
+ except paramiko.SSHException as e:
+ self.logger.info("%s (environment update rejected)", e)
+ handle_exception =
self._device_handler.handle_connection_exceptions(self)
+ # Ignore the exception, since we continue to try the
different
+ # subsystem names until we find one that can connect.
+ # have to handle exception for each vendor here
+ if not handle_exception:
+ continue
try:
self._channel.invoke_subsystem(subname)
except paramiko.SSHException as e:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/devices/test_default.py
new/ncclient-0.6.13/test/unit/devices/test_default.py
--- old/ncclient-0.6.12/test/unit/devices/test_default.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/devices/test_default.py 2022-04-10
22:15:50.000000000 +0200
@@ -13,7 +13,6 @@
'urn:ietf:params:netconf:capability:validate:1.0',
'urn:ietf:params:netconf:capability:xpath:1.0',
'urn:ietf:params:netconf:capability:notification:1.0',
- 'urn:liberouter:params:netconf:capability:power-control:1.0',
'urn:ietf:params:netconf:capability:interleave:1.0',
'urn:ietf:params:netconf:capability:with-defaults:1.0']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/devices/test_h3c.py
new/ncclient-0.6.13/test/unit/devices/test_h3c.py
--- old/ncclient-0.6.12/test/unit/devices/test_h3c.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/devices/test_h3c.py 2022-04-10
22:15:50.000000000 +0200
@@ -13,7 +13,6 @@
'urn:ietf:params:netconf:capability:validate:1.0',
'urn:ietf:params:netconf:capability:xpath:1.0',
'urn:ietf:params:netconf:capability:notification:1.0',
- 'urn:liberouter:params:netconf:capability:power-control:1.0',
'urn:ietf:params:netconf:capability:interleave:1.0',
'urn:ietf:params:netconf:capability:with-defaults:1.0']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/devices/test_huawei.py
new/ncclient-0.6.13/test/unit/devices/test_huawei.py
--- old/ncclient-0.6.12/test/unit/devices/test_huawei.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/devices/test_huawei.py 2022-04-10
22:15:50.000000000 +0200
@@ -13,7 +13,6 @@
'urn:ietf:params:netconf:capability:validate:1.0',
'urn:ietf:params:netconf:capability:xpath:1.0',
'urn:ietf:params:netconf:capability:notification:1.0',
- 'urn:liberouter:params:netconf:capability:power-control:1.0',
'urn:ietf:params:netconf:capability:interleave:1.0',
'urn:ietf:params:netconf:capability:with-defaults:1.0',
'http://www.huawei.com/netconf/capability/execute-cli/1.0',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/devices/test_iosxe.py
new/ncclient-0.6.13/test/unit/devices/test_iosxe.py
--- old/ncclient-0.6.12/test/unit/devices/test_iosxe.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/devices/test_iosxe.py 2022-04-10
22:15:50.000000000 +0200
@@ -1,5 +1,17 @@
import unittest
from ncclient.devices.iosxe import *
+from ncclient.xml_ import new_ele
+from ncclient.xml_ import qualify
+from ncclient.xml_ import validated_element
+
+
+CFG_BROKEN = """
+<config>
+ <native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
+ <hostname>tl-einarnn-c8kv</hostname>
+ </native>
+</config>
+"""
class TestIosxeDevice(unittest.TestCase):
@@ -20,3 +32,10 @@
def test_csr_unknown_host_cb(self):
self.assertTrue(iosxe_unknown_host_cb('host', 'fingerprint'))
+
+ def test_iosxe_transform_edit_config(self):
+ node = new_ele("edit-config")
+ node.append(validated_element(CFG_BROKEN, ("config",
qualify("config"))))
+ node = self.obj.transform_edit_config(node)
+ config_nodes = node.findall('./config')
+ self.assertTrue(len(config_nodes) == 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/devices/test_nexus.py
new/ncclient-0.6.13/test/unit/devices/test_nexus.py
--- old/ncclient-0.6.12/test/unit/devices/test_nexus.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/devices/test_nexus.py 2022-04-10
22:15:50.000000000 +0200
@@ -13,7 +13,6 @@
'urn:ietf:params:netconf:capability:validate:1.0',
'urn:ietf:params:netconf:capability:xpath:1.0',
'urn:ietf:params:netconf:capability:notification:1.0',
- 'urn:liberouter:params:netconf:capability:power-control:1.0',
'urn:ietf:params:netconf:capability:interleave:1.0',
'urn:ietf:params:netconf:capability:with-defaults:1.0']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/devices/test_sros.py
new/ncclient-0.6.13/test/unit/devices/test_sros.py
--- old/ncclient-0.6.12/test/unit/devices/test_sros.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/devices/test_sros.py 2022-04-10
22:15:50.000000000 +0200
@@ -14,7 +14,6 @@
'urn:ietf:params:netconf:capability:validate:1.0',
'urn:ietf:params:netconf:capability:xpath:1.0',
'urn:ietf:params:netconf:capability:notification:1.0',
- 'urn:liberouter:params:netconf:capability:power-control:1.0',
'urn:ietf:params:netconf:capability:interleave:1.0',
'urn:ietf:params:netconf:capability:with-defaults:1.0',
'urn:ietf:params:xml:ns:netconf:base:1.0',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/ncclient-0.6.12/test/unit/operations/test_retrieve.py
new/ncclient-0.6.13/test/unit/operations/test_retrieve.py
--- old/ncclient-0.6.12/test/unit/operations/test_retrieve.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/operations/test_retrieve.py 2022-04-10
22:15:50.000000000 +0200
@@ -14,6 +14,7 @@
from xml.etree import ElementTree
from lxml import etree
import copy
+import six
class TestRetrieve(unittest.TestCase):
@@ -95,7 +96,8 @@
"Invalid 'with-defaults' mode 'report-all-tagged'; the server "
"only supports the following: explicit, report-all, trim"
)
- self.assertRaisesRegexp(
+ six.assertRaisesRegex(
+ self,
WithDefaultsError,
expected_error,
obj.request,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/test_manager.py
new/ncclient-0.6.13/test/unit/test_manager.py
--- old/ncclient-0.6.12/test/unit/test_manager.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/test_manager.py 2022-04-10
22:15:50.000000000 +0200
@@ -307,6 +307,27 @@
nc_params=nc_params)
return conn
+ @patch('socket.socket')
+ @patch('paramiko.Transport.start_client')
+ @patch('paramiko.Transport.get_remote_server_key')
+ @patch('ncclient.transport.ssh.hexlify')
+ @patch('ncclient.transport.SSHSession._auth')
+ @patch('paramiko.Transport.open_session')
+ @patch('ncclient.transport.ssh.Session._post_connect')
+ def test_manager_environment(
+ self, mock_session_post_connect, mock_transport_open_session,
+ mock_ssh_session_auth, mock_hex,
+ mock_transport_get_remote_server_key, mock_transport_start_client,
+ mock_socket):
+ m = MagicMock()
+ mock_transport_open_session.return_value = m
+ env={"VAR1":"VALUE1"}
+ conn = manager.connect(host='10.10.10.10',
+ hostkey_verify=False, allow_agent=False,
+ environment=env)
+ self.assertEqual(conn.connected, True)
+ m.update_environment.assert_called_once_with(env)
+
@patch('socket.fromfd')
@patch('paramiko.Transport')
@patch('ncclient.transport.ssh.hexlify')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ncclient-0.6.12/test/unit/transport/test_session.py
new/ncclient-0.6.13/test/unit/transport/test_session.py
--- old/ncclient-0.6.12/test/unit/transport/test_session.py 2021-05-29
18:32:33.000000000 +0200
+++ new/ncclient-0.6.13/test/unit/transport/test_session.py 2022-04-10
22:15:50.000000000 +0200
@@ -273,7 +273,7 @@
listener = NotificationHandler(q)
listener.callback(parse_root(notification), notification)
notif = q.get_nowait()
- self.assertEquals(notif.notification_xml, notification)
+ self.assertEqual(notif.notification_xml, notification)
self.assertRaises(Empty, q.get_nowait)
def test_notification_handler_non_notification(self):