Skip to content
Snippets Groups Projects
Commit 39c0213f authored by Robert Latta's avatar Robert Latta
Browse files

updated nokia ssh config for key based auth RE. DBOARD3-926

parent 8232baed
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,21 @@ CONFIG_SCHEMA = {
'type': 'object',
'properties': {
'username': {'type': 'string'},
'private-key': {'type': 'string'},
'known-hosts': {'type': 'string'},
'password': {'type': 'string'}
'password': {'type': 'string'},
'hostkey_verify': {'type': 'boolean'},
'key_filename': {'type': 'string'}
},
'one-of': [
{
'required': ['username', 'password']
},
{
'required': ['username', 'key_filename']
},
{
'required': ['ssh_config']
}
],
'additionalProperties': False
},
'ims': {
......
......@@ -91,11 +91,16 @@ STATE_FILTER = '''<filter>
</filter>'''
def load_docs(hostname, ssh_params, hostkey_verify=False):
def load_docs(hostname, ssh_params):
"""
Load the running and state docs for the given hostname
:param hostname: str
:param ssh_params: dict - parameters to pass to the ncclient manager.connect call, see https://github.com/ncclient/ncclient/blob/master/ncclient/transport/ssh.py#L156 # noqa
:return: tuple of xml.etree.ElementTree.Element - running configuration, state data
"""
logger.info(f'capturing netconf data for "{hostname}"')
params = {
'host': hostname,
'hostkey_verify': hostkey_verify,
'device_params': {'name': 'sros'},
'nc_params': {'capabilities': ['urn:nokia.com:nc:pysros:pc']},
'timeout': 60
......
......@@ -56,8 +56,7 @@ def data_config_filename():
},
"nokia-ssh": {
"username": "uSeR-NaMe",
"password": "dummy-password",
"known-hosts": "known-hosts=filename"
"password": "dummy-password"
},
"redis": {
"hostname": "xxxxxx",
......
......@@ -19,8 +19,7 @@ def config():
},
"nokia-ssh": {
"username": "uSeR-NaMe",
"password": "dummy-password",
"known-hosts": "known-hosts=filename"
"password": "dummy-password"
},
'redis-databases': [0, 1, 2],
'ims': {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment