change to python3 instead of explicit 3.6
This commit is contained in:
33
net/devices/actiontec/ActionTec/__init__.py
Executable file
33
net/devices/actiontec/ActionTec/__init__.py
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python3.6
|
||||
|
||||
import .Cmd as Cmd
|
||||
import .Connector as Connector
|
||||
|
||||
class Router(object):
|
||||
def __init__(self, host, port, user, password, ssl = False):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.user = user
|
||||
self.password = password
|
||||
self.ssl = ssl
|
||||
self.ctx = None
|
||||
# Convenient shorthand. See "help.all.txt".
|
||||
self.cmds = {'reboot': 'system reboot',
|
||||
'wipe': 'conf factory restore',
|
||||
# this will... require an interactive session
|
||||
'shell': 'system shell'}
|
||||
|
||||
def connect(self):
|
||||
# We don't need to define an except, really.
|
||||
# The function handles that for us.
|
||||
Connector.CheckConnection(self.host, self.port)
|
||||
self.ctx = Connector.Login(self.host, self.port, self.ssl, self.user,
|
||||
self.password)
|
||||
return()
|
||||
|
||||
def execute(self):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
if self.ctx:
|
||||
self.ctx.close()
|
||||
Reference in New Issue
Block a user