From d6880d5956acf54101384c15f258a986f39aa07f Mon Sep 17 00:00:00 2001 From: Federico Luzzi Date: Fri, 1 Dec 2023 13:40:49 -0300 Subject: [PATCH] bug fixes --- README.md | 2 +- connpy/__init__.py | 2 +- connpy/_version.py | 2 +- connpy/connapp.py | 4 ++-- connpy/core.py | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 17d4430..1f5678b 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ print(result) ### Usage: ``` usage: conn [-h] [--add | --del | --mod | --show | --debug] [node|folder] [--sftp] - conn {profile,move,mv,copy,cp,list,ls,bulk,config} ... + conn {profile,move,copy,list,bulk,export,import,run,config,api,ai} ... positional arguments: node|folder node[@subfolder][@folder] diff --git a/connpy/__init__.py b/connpy/__init__.py index f80fa9d..4c60c97 100644 --- a/connpy/__init__.py +++ b/connpy/__init__.py @@ -17,7 +17,7 @@ Connpy is a connection manager that allows you to store nodes to connect them fa ### Usage ``` usage: conn [-h] [--add | --del | --mod | --show | --debug] [node|folder] [--sftp] - conn {profile,move,mv,copy,cp,list,ls,bulk,config} ... + conn {profile,move,copy,list,bulk,export,import,run,config,api,ai} ... positional arguments: node|folder node[@subfolder][@folder] diff --git a/connpy/_version.py b/connpy/_version.py index c6165f2..5065167 100644 --- a/connpy/_version.py +++ b/connpy/_version.py @@ -1,2 +1,2 @@ -__version__ = "3.6.3" +__version__ = "3.6.4" diff --git a/connpy/connapp.py b/connpy/connapp.py index 068ffbb..035a722 100755 --- a/connpy/connapp.py +++ b/connpy/connapp.py @@ -1213,9 +1213,9 @@ class connapp: def _help(self, type): #Store text for help and other commands if type == "node": - return "node[@subfolder][@folder]\nConnect to specific node or show all matching nodes\n[@subfolder][@folder]\nShow all available connections globaly or in specified path" + return "node[@subfolder][@folder]\nConnect to specific node or show all matching nodes\n[@subfolder][@folder]\nShow all available connections globally or in specified path" if type == "usage": - return "conn [-h] [--add | --del | --mod | --show | --debug] [node|folder] [--sftp]\n conn {profile,move,mv,copy,cp,list,ls,bulk,config} ..." + return "conn [-h] [--add | --del | --mod | --show | --debug] [node|folder] [--sftp]\n conn {profile,move,copy,list,bulk,export,import,run,config,api,ai} ..." if type == "end": return "Commands:\n profile Manage profiles\n move (mv) Move node\n copy (cp) Copy node\n list (ls) List profiles, nodes or folders\n bulk Add nodes in bulk\n export Export connection folder to Yaml file\n import Import connection folder to config from Yaml file\n run Run scripts or commands on nodes\n config Manage app config\n api Start and stop connpy api\n ai Make request to an AI" if type == "bashcompletion": diff --git a/connpy/core.py b/connpy/core.py index 318663b..e54a716 100755 --- a/connpy/core.py +++ b/connpy/core.py @@ -203,8 +203,8 @@ class node: ''' connect = self._connect(debug = debug) if connect == True: - size = re.search('columns=([0-9]+).*lines=([0-9]+)',str(os.get_terminal_size())) - self.child.setwinsize(int(size.group(2)),int(size.group(1))) + # size = re.search('columns=([0-9]+).*lines=([0-9]+)',str(os.get_terminal_size())) + # self.child.setwinsize(int(size.group(2)),int(size.group(1))) print("Connected to " + self.unique + " at " + self.host + (":" if self.port != '' else '') + self.port + " via: " + self.protocol) if 'logfile' in dir(self): # Initialize self.mylog @@ -439,7 +439,7 @@ class node: cmd = cmd + " {}".format(self.host) else: cmd = cmd + " {}".format("@".join([self.user,self.host])) - expects = ['yes/no', 'refused', 'supported', 'Invalid|[u|U]sage:', 'ssh-keygen.*\"', 'timeout|timed.out', 'unavailable', 'closed', '[p|P]assword:|[u|U]sername:', r'>$|#$|\$$|>.$|#.$|\$.$', 'suspend', pexpect.EOF, pexpect.TIMEOUT, "No route to host", "resolve hostname", "no matching"] + expects = ['yes/no', 'refused', 'supported', 'Invalid|[u|U]sage:', 'ssh-keygen.*\"', 'timeout|timed.out', 'unavailable', 'closed', '[p|P]assword:|[u|U]sername:', r'>$|#$|\$$|>.$|#.$|\$.$', 'suspend', pexpect.EOF, pexpect.TIMEOUT, "No route to host", "resolve hostname", "no matching", "bad permissions"] elif self.protocol == "telnet": cmd = "telnet " + self.host if self.port != '': @@ -452,7 +452,7 @@ class node: passwords = self._passtx(self.password) else: passwords = [] - expects = ['[u|U]sername:', 'refused', 'supported', 'cipher', 'ssh-keygen.*\"', 'timeout|timed.out', 'unavailable', 'closed', '[p|P]assword:', r'>$|#$|\$$|>.$|#.$|\$.$', 'suspend', pexpect.EOF, pexpect.TIMEOUT, "No route to host", "resolve hostname", "no matching"] + expects = ['[u|U]sername:', 'refused', 'supported', 'cipher', 'ssh-keygen.*\"', 'timeout|timed.out', 'unavailable', 'closed', '[p|P]assword:', r'>$|#$|\$$|>.$|#.$|\$.$', 'suspend', pexpect.EOF, pexpect.TIMEOUT, "No route to host", "resolve hostname", "no matching", "bad permissions"] else: raise ValueError("Invalid protocol: " + self.protocol) attempts = 1 @@ -479,7 +479,7 @@ class node: else: self.missingtext = True break - if results in [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15]: + if results in [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16]: child.terminate() if results == 12 and attempts != max_attempts: attempts += 1