Skip to content
This repository has been archived by the owner on Feb 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #160 from mirceaulinic/opt-args
Browse files Browse the repository at this point in the history
Preparing napalm-junos 0.10: Opt args
  • Loading branch information
mirceaulinic authored Jun 4, 2017
2 parents 849d4bb + 6023f2b commit d15dc47
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions napalm_junos/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,24 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None)
if optional_args is None:
optional_args = {}

self.config_lock = optional_args.get('config_lock', True)
self.config_lock = optional_args.get('config_lock', False)
self.port = optional_args.get('port', 22)
self.key_file = optional_args.get('key_file', None)
self.keepalive = optional_args.get('keepalive', 30)
self.ssh_config_file = optional_args.get('ssh_config_file', None)

if self.key_file:
self.device = Device(hostname,
user=username,
ssh_private_key_file=self.key_file,
ssh_config=self.ssh_config_file,
port=self.port)
else:
self.device = Device(hostname, user=username, password=password, port=self.port)
self.device = Device(hostname,
user=username,
password=password,
port=self.port,
ssh_config=self.ssh_config_file)

self.profile = ["junos"]

Expand Down

0 comments on commit d15dc47

Please sign in to comment.