diff --git a/README.md b/README.md index 0ddb795..92fc198 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,12 @@ Implements netmiko's SCP file transfer for Cisco devices. Use -f to transfer fil ### DEVICE SUPPORT -* Currently Cisco, HP, and Sentry PDUs. +* Currently Cisco, HP, Sentry PDUs, and Juniper junos. * What to append at the end of each IP address * `,cisco_ios` * `,hp_procurve` * `,sentry_pdu` + * `,juniper_junos` ### FUTURE DEVELOPMENT diff --git a/device_connector.py b/device_connector.py index 1790821..62ec2f5 100644 --- a/device_connector.py +++ b/device_connector.py @@ -45,6 +45,11 @@ def __init__(self, raw_ip, username, password, enable_password=''): self.sentry_pdu_normalize() self.sentry_pdu = SentryPdu(self.netmiko_device_details) self.device_connection = self.sentry_pdu.connect() + elif self.raw_ip.find('juniper') is not -1: + self.ip = self.raw_ip.rstrip('juniper_junos').replace(',', '') + self.device_type = 'juniper_junos' + self.juniper_junos_normalize() + self.device_connection = self.connect() else: # Unsupported device or missing device type, raise exception raise ValueError() @@ -81,6 +86,17 @@ def sentry_pdu_normalize(self): 'password': self.password, 'verbose': False, } + + def juniper_junos_normalize(self): + + # device list: https://github.com/ktbyers/netmiko/blob/develop/netmiko/ssh_dispatcher.py + self.netmiko_device_details = { + 'device_type': self.device_type, + 'ip': self.ip, + 'username': self.username, + 'password': self.password, + 'verbose': False, + } def connect(self):