gNMI provider documents the port argument as optional (http://ydk.cisco.com/py/docs/api/providers/gnmi_provider.html).
* port – (int) Port on which the gNMI interface can be accessed on the device. If not specified, the default value of 57400 is assigned.
However, it is treated as mandatory in ydk-py:
provider = gNMIServiceProvider(repo=repo,
address=address,
username=username,
password=password)
results in:
TypeError: __init__() missing 1 required positional argument: 'port'
The port argument can be set to None as a workaround:
provider = gNMIServiceProvider(repo=repo,
address=address,
port=None,
username=username,
password=password)
Verified with:
$ pip list | grep ydk
ydk 0.8.1.post1
ydk-models-cisco-ios-xr 6.5.1.post1
ydk-models-ietf 0.1.5.post2
ydk-models-openconfig 0.1.6.post1
ydk-service-gnmi 0.4.0.post1
$
gNMI provider documents the
portargument as optional (http://ydk.cisco.com/py/docs/api/providers/gnmi_provider.html).However, it is treated as mandatory in ydk-py:
results in:
The
portargument can be set toNoneas a workaround:Verified with: