Skip to content

Commit 7564398

Browse files
committed
Resolved conflicts
1 parent 4e6a1bd commit 7564398

File tree

13 files changed

+17
-149
lines changed

13 files changed

+17
-149
lines changed

connector/Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ PYTHON = python3
3232
TESTCMD = cd tests; runAll
3333
DISTDIR = $(BUILDDIR)/dist
3434

35-
DEPENDENCIES = "paramiko >= 1.15.1" "lxml >= 3.3.0" \
36-
"ncclient >= 0.6.6" grpcio protobuf
37-
38-
3935
.PHONY: clean package distribute distribute_staging distribute_staging_external\
4036
develop undevelop populate_dist_dir help docs distribute_docs test
4137

@@ -89,8 +85,7 @@ develop:
8985
@echo ""
9086

9187
@pip3 uninstall -y yang.connector || true
92-
@pip install $(DEPENDENCIES)
93-
@pip install -e . --no-deps
88+
@$(PYTHON) setup.py develop -q
9489

9590
@echo "Completed building and installing: $@"
9691
@echo ""
@@ -103,7 +98,7 @@ undevelop:
10398
@echo "Uninstalling $(PKG_NAME) development distributable: $@"
10499
@echo ""
105100

106-
@pip uninstall $(PKG_NAME) -y
101+
@$(PYTHON) setup.py develop -q --uninstall
107102

108103
@echo "Completed uninstalling: $@"
109104
@echo ""

connector/docs/changelog/2024/november.rst

Lines changed: 0 additions & 25 deletions
This file was deleted.

connector/docs/changelog/2025/january.rst

Lines changed: 0 additions & 51 deletions
This file was deleted.

connector/docs/changelog/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ Changelog
44
.. toctree::
55
:maxdepth: 2
66

7-
2025/january
8-
2024/november
97
2024/october
108
2024/September
119
2024/august

connector/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def find_version(*paths):
180180
# package dependencies
181181
install_requires = [
182182
'paramiko >= 1.15.1',
183-
'lxml >= 3.3.0',
183+
'lxml >= 3.3.0, <5.0.0',
184184
'ncclient >= 0.6.6',
185185
'grpcio',
186186
'protobuf'

connector/src/yang/connector/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
# metadata
10-
__version__ = '25.1'
10+
__version__ = '24.10'
1111
__author__ = (
1212
'Jonathan Yang <[email protected]>',
1313
'Siming Yuan <[email protected]',

connector/src/yang/connector/gnmi.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def banner(string):
3131
def to_plaintext(string):
3232
return string
3333

34-
from .settings import Settings
3534

3635
# create a logger for this module
3736
log = logging.getLogger(__name__)
@@ -240,9 +239,6 @@ def __init__(self, *args, **kwargs):
240239
self.results = deque()
241240
self.metadata = None
242241

243-
# connection_info is set by BaseConnection class
244-
self.settings = self.connection_info.pop('settings', Settings())
245-
246242
@property
247243
def connected(self):
248244
"""Return True if session is connected."""
@@ -308,12 +304,7 @@ def connect(self):
308304
port = str(dev_args.get('port'))
309305
target = '{0}:{1}'.format(host, port)
310306

311-
max_receive_message_length = self.settings.get('GRPC_MAX_RECEIVE_MESSAGE_LENGTH')
312-
max_send_message_length = self.settings.get('GRPC_MAX_SEND_MESSAGE_LENGTH')
313-
314-
options = [('grpc.max_receive_message_length', max_receive_message_length),
315-
('grpc.max_send_message_length', max_send_message_length)]
316-
307+
options = [('grpc.max_receive_message_length', 1000000000)]
317308
# Gather certificate settings
318309
root = dev_args.get('root_certificate')
319310
if not root:
@@ -360,7 +351,6 @@ def connect(self):
360351
)
361352
else:
362353
self.channel = grpc.insecure_channel(target)
363-
self.channel = grpc.insecure_channel(target, options)
364354
self.metadata = [
365355
("username", username),
366356
("password", password),

connector/src/yang/connector/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ def __init__(self, *args, **kwargs):
88
self.NETCONF_SCREEN_LOGGING_MAX_LINES = 40
99
# Enable XML formatting by default
1010
self.NETCONF_LOGGING_FORMAT_XML = True
11-
# Default receive message length
12-
self.GRPC_MAX_RECEIVE_MESSAGE_LENGTH = 1000000000
13-
# Default send message length
14-
self.GRPC_MAX_SEND_MESSAGE_LENGTH = 1000000000

connector/src/yang/connector/tests/test_gnmi.py

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ def test_connect(self):
2525
' ip : "1.2.3.4"\n' \
2626
' port: 830\n' \
2727
' username: admin\n' \
28-
' password: admin\n' \
28+
' password: admin\n'
2929

3030
testbed = loader.load(yaml)
3131
device = testbed.devices['dummy']
3232
with patch('yang.connector.gnmi.grpc.insecure_channel') as mock_grpc:
3333
device.connect(alias='gnmi', via='Gnmi')
34-
mock_grpc.assert_called_with('1.2.3.4:830', [('grpc.max_receive_message_length', 1000000000), ('grpc.max_send_message_length', 1000000000)])
34+
mock_grpc.assert_called_with('1.2.3.4:830')
3535

3636
def test_re_connect(self):
3737

@@ -46,16 +46,16 @@ def test_re_connect(self):
4646
' ip : "1.2.3.4"\n' \
4747
' port: 830\n' \
4848
' username: admin\n' \
49-
' password: admin\n' \
49+
' password: admin\n'
5050

5151
testbed = loader.load(yaml)
5252
device = testbed.devices['dummy']
5353
with patch('yang.connector.gnmi.grpc.insecure_channel') as mock_grpc:
5454
device.connect()
55-
mock_grpc.assert_called_with('1.2.3.4:830', [('grpc.max_receive_message_length', 1000000000), ('grpc.max_send_message_length', 1000000000)])
55+
mock_grpc.assert_called_with('1.2.3.4:830')
5656
device.disconnect()
5757
device.connect(alias='gnmi', via='Gnmi')
58-
mock_grpc.assert_called_with('1.2.3.4:830', [('grpc.max_receive_message_length', 1000000000), ('grpc.max_send_message_length', 1000000000)])
58+
mock_grpc.assert_called_with('1.2.3.4:830')
5959

6060
def test_connect_proxy(self):
6161
yaml = \
@@ -91,7 +91,7 @@ def test_connect_proxy(self):
9191
mock_tunnel.side_effect = ['830']
9292
device.connections['Gnmi'].sshtunnel = AttrDict({'tunnel_ip': '4.3.2.1'})
9393
device.connect(alias='gnmi', via='Gnmi')
94-
mock_grpc.assert_called_with('4.3.2.1:830', [('grpc.max_receive_message_length', 1000000000), ('grpc.max_send_message_length', 1000000000)])
94+
mock_grpc.assert_called_with('4.3.2.1:830')
9595
request = {
9696
"namespace": {"oc-acl": "http://openconfig.net/yang/acl"},
9797
"nodes": [
@@ -159,29 +159,6 @@ def test_get_prefix(self):
159159
path = xpath_util.get_prefix('rfc7951')
160160
self.assertIsInstance(path, proto.gnmi_pb2.Path)
161161

162-
def test_connect_grcp_length(self):
163-
yaml = \
164-
'devices:\n' \
165-
' dummy:\n' \
166-
' type: dummy_device\n' \
167-
' connections:\n' \
168-
' Gnmi:\n' \
169-
' class: yang.connector.Gnmi\n' \
170-
' protocol: gnmi\n' \
171-
' ip : "1.2.3.4"\n' \
172-
' port: 830\n' \
173-
' username: admin\n' \
174-
' password: admin\n' \
175-
' settings:\n' \
176-
' GRPC_MAX_RECEIVE_MESSAGE_LENGTH: 100\n' \
177-
' GRPC_MAX_SEND_MESSAGE_LENGTH: 100\n' \
178-
179-
testbed = loader.load(yaml)
180-
device = testbed.devices['dummy']
181-
with patch('yang.connector.gnmi.grpc.insecure_channel') as mock_grpc:
182-
device.connect(alias='gnmi', via='Gnmi')
183-
mock_grpc.assert_called_with('1.2.3.4:830', [('grpc.max_receive_message_length', 100), ('grpc.max_send_message_length', 100)])
184-
185162

186163
if __name__ == '__main__':
187164
unittest.main()

ncdiff/Makefile

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ PYTHON = python3
3232
TESTCMD = cd tests; runAll
3333
DISTDIR = $(BUILDDIR)/dist
3434

35-
DEPENDENCIES = "pyang >= 1.7.3" "ncclient >= 0.6.3" \
36-
"requests >= 2.18.4" "xmljson >= 0.1.9" \
37-
"yang.connector >= 3.0.0"
38-
3935
.PHONY: clean package distribute distribute_staging distribute_staging_external\
4036
develop undevelop populate_dist_dir help docs distribute_docs test
4137

@@ -88,12 +84,7 @@ develop:
8884
@echo ""
8985

9086
@pip3 uninstall -y yang.ncdiff || true
91-
<<<<<<< HEAD
92-
@pip install $(DEPENDENCIES)
93-
@pip install -e . --no-deps
94-
=======
95-
@pip3 install -e .
96-
>>>>>>> f4865ef (Made changes to support 3.13)
87+
@$(PYTHON) setup.py develop -q
9788

9889
@echo "Completed building and installing: $@"
9990
@echo ""
@@ -106,7 +97,7 @@ undevelop:
10697
@echo "Uninstalling $(PKG_NAME) development distributable: $@"
10798
@echo ""
10899

109-
@pip uninstall $(PKG_NAME) -y
100+
@$(PYTHON) setup.py develop -q --uninstall
110101

111102
@echo "Completed uninstalling: $@"
112103
@echo ""
@@ -166,4 +157,4 @@ changelogs:
166157
@echo "yang.ncdiff changelog created..."
167158
@echo ""
168159
@echo "Done."
169-
@echo ""
160+
@echo ""

0 commit comments

Comments
 (0)