Skip to content

Commit

Permalink
added palo alto support
Browse files Browse the repository at this point in the history
  • Loading branch information
ctomkow committed May 6, 2019
1 parent 9001d3b commit f0f1305
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 17 additions & 1 deletion device_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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):

Expand Down

0 comments on commit f0f1305

Please sign in to comment.