Skip to content

Commit 43cae2d

Browse files
removed unsused classes and calls attributes
1 parent af046f7 commit 43cae2d

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

ssh_proxy_server/interfaces/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def check_port_forward_request(self, address: Text, port: int) -> int:
285285
OS will tell us which port).
286286
If it can't be opened, we just return false.
287287
"""
288-
logging.info(
288+
logging.debug(
289289
"check_port_forward_request: address=%s, port=%s",
290290
address, port
291291
)

ssh_proxy_server/plugins/sftp/replace_file.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@ def lstat(self, path: Text) -> Union[SFTPAttributes, int]:
3838
def stat(self, path: Text) -> Union[SFTPAttributes, int]:
3939
return self.lstat(path)
4040

41-
class SFTPHandle(SFTPBaseHandle):
42-
43-
@typechecked
44-
def close(self) -> None:
45-
if not self.plugin.data_handled:
46-
args, _ = SFTPProxyReplaceHandler.parser().parse_known_args()
47-
with open(args.sftp_replacement_file, "rb") as r:
48-
if self.writefile is not None:
49-
self.writefile.write(r.read())
50-
super().close()
51-
5241
@classmethod
5342
@typechecked
5443
def get_interface(cls) -> Optional[Type[BaseSFTPServerInterface]]:

ssh_proxy_server/plugins/tunnel/injectclienttunnel.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ def parser_arguments(cls) -> None:
6969
help='network on which to serve the client tunnel injector'
7070
)
7171

72-
session: Optional['ssh_proxy_server.session.Session'] = None
73-
args: Optional[argparse.Namespace] = None
7472
tcpservers: List[TCPServerThread] = []
7573

7674
# Setup should occur after master channel establishment
@@ -80,19 +78,17 @@ def parser_arguments(cls) -> None:
8078
def setup(cls, session: 'ssh_proxy_server.session.Session') -> None:
8179
parser_retval = cls.parser().parse_known_args(None, None)
8280
args, _ = parser_retval
83-
cls.session = session
84-
cls.args = args
8581
form = re.compile('.*:\d{1,5}')
8682

87-
for target in cls.args.client_tunnel_dest:
83+
for target in args.client_tunnel_dest:
8884
if not form.match(target):
8985
logging.warning("--tunnel-client-dest %s does not match format host:port (e.g. google.com:80)", target)
9086
break
9187
destnet, destport = target.split(":")
9288
t = TCPServerThread(
9389
ClientTunnelHandler(session, (destnet, int(destport))).handle_request,
94-
run_status=cls.session.running,
95-
network=cls.args.client_tunnel_net
90+
run_status=session.running,
91+
network=args.client_tunnel_net
9692
)
9793
t.start()
9894
cls.tcpservers.append(t)

0 commit comments

Comments
 (0)