Skip to content

gNMI provider requires port argument #880

@111pontes

Description

@111pontes

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
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions