Skip to content

NETCONF Session constructor doesn't allow port to be None #846

@111pontes

Description

@111pontes

Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.

Expected Behavior

It should be possible to create a new NETCONF session with port set to None as in:

ydk_.path.NetconfSession(address='198.18.1.11', username='admin', password='admin', port=None)

Somewhat related to #557

Current Behavior

Port is rejected as invalid instead of converting None to default (830). Functionality worked fine before YDK 0.8.0

    self.provider = NetconfSession(**self.provider_params)
  File "/home/saalvare/.virtualenvs/netconf-client/lib/python3.6/site-packages/ydk/path/sessions/netconf_session.py", line 37, in __init__
    common_cache, timeout)
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. ydk_.path.NetconfSession(repo: ydk::path::Repository, address: str, username: str, password: str, port: int=830, protocol: str='ssh', on_demand: bool=True, timeout: int=-1)
    2. ydk_.path.NetconfSession(address: str, username: str, password: str, port: int=830, protocol: str='ssh', on_demand: bool=True, common_cache: bool=False, timeout: int=-1)
    3. ydk_.path.NetconfSession(repo: ydk::path::Repository, address: str, username: str, private_key_path: str, public_key_path: str, port: int=830, on_demand: bool=True, timeout: int=-1)
    4. ydk_.path.NetconfSession(address: str, username: str, private_key_path: str, public_key_path: str, port: int=830, on_demand: bool=True, common_cache: bool=False, timeout: int=-1)

Invoked with: '198.18.1.11', 'admin', 'admin', None, 'ssh', True, False, -1

Steps to Reproduce

Your Script

ydk_.path.NetconfSession(address='198.18.1.11', username='admin', password='admin', port=None)

Logs

Enable logging and post the logs below

    self.provider = NetconfSession(**self.provider_params)
  File "/home/saalvare/.virtualenvs/netconf-client/lib/python3.6/site-packages/ydk/path/sessions/netconf_session.py", line 37, in __init__
    common_cache, timeout)
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. ydk_.path.NetconfSession(repo: ydk::path::Repository, address: str, username: str, password: str, port: int=830, protocol: str='ssh', on_demand: bool=True, timeout: int=-1)
    2. ydk_.path.NetconfSession(address: str, username: str, password: str, port: int=830, protocol: str='ssh', on_demand: bool=True, common_cache: bool=False, timeout: int=-1)
    3. ydk_.path.NetconfSession(repo: ydk::path::Repository, address: str, username: str, private_key_path: str, public_key_path: str, port: int=830, on_demand: bool=True, timeout: int=-1)
    4. ydk_.path.NetconfSession(address: str, username: str, private_key_path: str, public_key_path: str, port: int=830, on_demand: bool=True, common_cache: bool=False, timeout: int=-1)

Invoked with: '198.18.1.11', 'admin', 'admin', None, 'ssh', True, False, -1

System Information

Ubuntu bionic
YDK 0.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions