Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from QualiSystems/dev
Rewrite Enable\Disable SNMP actions. Added OS Version determination
- Loading branch information
Showing
11 changed files
with
160 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
package/cloudshell/firewall/cisco/asa/sessions/asa_ssh_session.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
from cloudshell.cli.session.ssh_session import SSHSession | ||
|
||
|
||
class ASASSHSession(SSHSession): | ||
def __init__(self, host, username, password, port=None, on_session_start=None, *args, **kwargs): | ||
super(ASASSHSession, self).__init__(host, username, password, port, on_session_start, *args, **kwargs) | ||
|
||
def connect(self, prompt, logger): | ||
"""Connect to device through ssh | ||
:param prompt: expected string in output | ||
:param logger: logger | ||
""" | ||
try: | ||
super(ASASSHSession, self).connect(prompt, logger) | ||
except Exception: | ||
self.disconnect() | ||
raise | ||
|
||
def get_local_address(self): | ||
""" Determine local device (device that initiate connection) IP address """ | ||
|
||
return self._handler._transport.sock.getsockname()[0] |
14 changes: 14 additions & 0 deletions
14
package/cloudshell/firewall/cisco/asa/sessions/asa_telnet_session.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
from cloudshell.cli.session.telnet_session import TelnetSession | ||
|
||
|
||
class ASATelnetSession(TelnetSession): | ||
def __init__(self, host, username, password, port=None, on_session_start=None, *args, **kwargs): | ||
super(ASATelnetSession, self).__init__(host, username, password, port, on_session_start, *args, **kwargs) | ||
|
||
def get_local_address(self): | ||
""" Determine local device (device that initiate connection) IP address """ | ||
|
||
return self._handler.sock.getsockname()[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0.1 | ||
3.0.5 |