Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
handle look_for_keys parameter when establishing an ssh connection (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikosGkotsis authored and vkosuri committed Apr 25, 2017
1 parent e03485d commit be9f71b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/NcclientLibrary/NcclientKeywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,21 @@ def __init__(self):
def connect(self, *args, **kwds):
"""
Initialize a Manager over the SSH transport.
``host`` the host to connect to
``port`` the SSH port
``username`` the username to use for SSH authentication
``password`` the password to be used for password authentication
``look_for_keys`` set to ``false`` to avoid searching for ssh keys
``key_filename`` a filename where a private key can be found
"""

try:
logger.info('Creating session %s, %s' % (args, kwds))
alias = kwds.get('alias')
Expand All @@ -73,6 +87,7 @@ def connect(self, *args, **kwds):
username=str(kwds.get('username')),
password=str(kwds.get('password')),
hostkey_verify=False,
look_for_keys= False if str(kwds.get('look_for_keys')).lower() == 'false' else True,
key_filename=str(kwds.get('key_filename')),
)
self._cache.register(session, alias=alias)
Expand Down

0 comments on commit be9f71b

Please sign in to comment.