shelltastic 0.3.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {shelltastic-0.3.0 → shelltastic-0.3.1}/PKG-INFO +1 -1
- {shelltastic-0.3.0 → shelltastic-0.3.1}/pyproject.toml +1 -1
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/backend/__init__.py +1 -14
- shelltastic-0.3.1/src/shelltastic/exception.py +12 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/host.py +2 -2
- {shelltastic-0.3.0 → shelltastic-0.3.1}/LICENSE +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/README.md +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/__init__.py +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/backend/base.py +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/enum.py +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/frontend/__init__.py +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/frontend/common.py +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/frontend/git.py +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/frontend/scp.py +0 -0
- {shelltastic-0.3.0 → shelltastic-0.3.1}/src/shelltastic/frontend/shell.py +0 -0
|
@@ -8,6 +8,7 @@ import sys
|
|
|
8
8
|
|
|
9
9
|
from shelltastic.backend.base import RemoteShellBackend, ShellBackend
|
|
10
10
|
from shelltastic.enum import OutputMode
|
|
11
|
+
from shelltastic.exception import SSHConnectionError
|
|
11
12
|
from shelltastic.host import Host
|
|
12
13
|
|
|
13
14
|
LOGGER = logging.getLogger(__name__)
|
|
@@ -66,20 +67,6 @@ class LocalShellBackend(ShellBackend):
|
|
|
66
67
|
return subprocess.run(**cmd_to_run)
|
|
67
68
|
|
|
68
69
|
|
|
69
|
-
class SSHConnectionError(Exception):
|
|
70
|
-
def __init__(
|
|
71
|
-
self, hostname: str, returncode: int, stdout: bytes | None, stderr: bytes | None
|
|
72
|
-
) -> None:
|
|
73
|
-
if stderr:
|
|
74
|
-
super().__init__(f"{stderr.decode()}")
|
|
75
|
-
else:
|
|
76
|
-
super().__init__(f"Could not connect to {hostname}")
|
|
77
|
-
self.hostname = hostname
|
|
78
|
-
self.returncode = returncode
|
|
79
|
-
self.stdout = stdout
|
|
80
|
-
self.stderr = stderr
|
|
81
|
-
|
|
82
|
-
|
|
83
70
|
class SSHShellBackend(LocalShellBackend, RemoteShellBackend):
|
|
84
71
|
def __init__(self, host: Host) -> None:
|
|
85
72
|
super().__init__()
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class SSHConnectionError(Exception):
|
|
2
|
+
def __init__(
|
|
3
|
+
self, hostname: str, returncode: int, stdout: bytes | None, stderr: bytes | None
|
|
4
|
+
) -> None:
|
|
5
|
+
if stderr:
|
|
6
|
+
super().__init__(f"{stderr.decode()}")
|
|
7
|
+
else:
|
|
8
|
+
super().__init__(f"Could not connect to {hostname}")
|
|
9
|
+
self.hostname = hostname
|
|
10
|
+
self.returncode = returncode
|
|
11
|
+
self.stdout = stdout
|
|
12
|
+
self.stderr = stderr
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|