diff --git a/README.md b/README.md index c3ef19d..754c26e 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ Implements netmiko's SCP file transfer for Cisco devices. Use -f to transfer fil ### DEVICE SUPPORT -* 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` + * `,paloalto_panos` ### FUTURE DEVELOPMENT diff --git a/device_connector.py b/device_connector.py index 637dfa6..bb090b0 100644 --- a/device_connector.py +++ b/device_connector.py @@ -45,11 +45,16 @@ 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: + elif self.raw_ip.find('juniper_junos') 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() + elif self.raw_ip.find('paloalto_panos') is not -1: + self.ip = self.raw_ip.rstrip('paloalto_panos').replace(',', '') + self.device_type = 'paloalto_panos' + self.paloalto_panos_normalize() + self.device_connection = self.connect() else: # Unsupported device or missing device type, raise exception raise ValueError() @@ -97,6 +102,17 @@ def juniper_junos_normalize(self): 'password': self.password, 'verbose': False, } + + def paloalto_panos_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):