Skip to content

Commit

Permalink
Merge pull request #64 from HPENetworking/connect_extend
Browse files Browse the repository at this point in the history
chg: dev: Extending connection and disconnection arguments.
  • Loading branch information
carlos-jenkins authored Sep 1, 2017
2 parents 5e1572b + ddb73aa commit b123ec7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/topology/platforms/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ def _log_response(self, response, shell):
"""
print(response.encode(self._shells[shell]._encoding))


__all__ = [
'HighLevelShellAPI',
'LowLevelShellAPI',
Expand Down
12 changes: 6 additions & 6 deletions lib/topology/platforms/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def is_connected(self, connection=None):
"""

@abstractmethod
def connect(self, connection=None):
def connect(self, connection=None, *args, **kwargs):
"""
Creates a connection to the shell.
Expand All @@ -248,7 +248,7 @@ def connect(self, connection=None):
"""

@abstractmethod
def disconnect(self, connection=None):
def disconnect(self, connection=None, *args, **kwargs):
"""
Terminates a connection to the shell.
Expand Down Expand Up @@ -281,7 +281,7 @@ def execute(self, command, connection=None):
def __call__(self, command, connection=None):
return self.execute(command, connection=connection)

def _setup_shell(self, connection=None):
def _setup_shell(self, connection=None, *args, **kwargs):
"""
Method called by subclasses that will be triggered after matching the
initial prompt.
Expand Down Expand Up @@ -561,7 +561,7 @@ def is_connected(self, connection=None):
spawn = self._get_connection(connection)
return spawn.isalive()

def connect(self, connection=None):
def connect(self, connection=None, *args, **kwargs):
"""
See :meth:`BaseShell.connect` for more information.
"""
Expand Down Expand Up @@ -641,7 +641,7 @@ def expect_sendline(prompt, command):
if self.default_connection is None:
self.default_connection = connection

def disconnect(self, connection=None):
def disconnect(self, connection=None, *args, **kwargs):
"""
See :meth:`BaseShell.disconnect` for more information.
"""
Expand Down Expand Up @@ -709,7 +709,7 @@ def __init__(
**kwargs
)

def _setup_shell(self, connection=None):
def _setup_shell(self, connection=None, *args, **kwargs):
"""
Overriden setup function that will disable the echo on the device on
the shell and set a pexpect-safe prompt.
Expand Down

0 comments on commit b123ec7

Please sign in to comment.