ssm-cli 1.1.0.dev4__tar.gz → 1.1.0.dev5__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.
- {ssm_cli-1.1.0.dev4/ssm_cli.egg-info → ssm_cli-1.1.0.dev5}/PKG-INFO +1 -1
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/app.py +6 -2
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/instances.py +2 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/ssh_proxy/forwarding.py +9 -11
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/ssh_proxy/server.py +2 -1
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5/ssm_cli.egg-info}/PKG-INFO +1 -1
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/LICENCE +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/README.md +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/pyproject.toml +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/setup.cfg +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/__init__.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/__main__.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/aws.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/cli.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/click.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/config.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/logging.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/selectors/__init__.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/selectors/first.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/selectors/tui.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/ssh_proxy/__init__.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/ssh_proxy/channels.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/ssh_proxy/shell.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/ssh_proxy/socket.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/ui.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli/xdg.py +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli.egg-info/SOURCES.txt +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli.egg-info/dependency_links.txt +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli.egg-info/entry_points.txt +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli.egg-info/requires.txt +0 -0
- {ssm_cli-1.1.0.dev4 → ssm_cli-1.1.0.dev5}/ssm_cli.egg-info/top_level.txt +0 -0
|
@@ -109,8 +109,12 @@ def sshproxy(group):
|
|
|
109
109
|
|
|
110
110
|
logger.info(f"connecting to {repr(instance)}")
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
try:
|
|
113
|
+
server = ssm_cli.ssh_proxy.server.SshServer(instance)
|
|
114
|
+
server.start()
|
|
115
|
+
except Exception as e:
|
|
116
|
+
logger.info(f"hiding exceptions in sshproxy {e}")
|
|
117
|
+
server.event.set()
|
|
114
118
|
|
|
115
119
|
@app.command(help="setups up ssm-cli, can be rerun safely")
|
|
116
120
|
@click.option("--replace-config", is_flag=True, help="if we should replace existing config file")
|
|
@@ -153,8 +153,10 @@ class Instances:
|
|
|
153
153
|
instances = sorted(self.list_instances(group_tag_value), key=lambda x: ip_as_int(x.ip))
|
|
154
154
|
count = len(instances)
|
|
155
155
|
if count == 1:
|
|
156
|
+
logger.info("only one instance found, selecting it automatically")
|
|
156
157
|
return instances[0]
|
|
157
158
|
if count < 1:
|
|
159
|
+
logger.error("no instances found")
|
|
158
160
|
return
|
|
159
161
|
|
|
160
162
|
if selector not in SELECTORS:
|
|
@@ -244,14 +244,14 @@ class PortForwardingManagerProcess(multiprocessing.Process):
|
|
|
244
244
|
|
|
245
245
|
# detaching from parent
|
|
246
246
|
try:
|
|
247
|
-
self.
|
|
247
|
+
self.detatch_from_parent()
|
|
248
248
|
except Exception as e:
|
|
249
|
-
logger.error(f"failed to detatch from
|
|
249
|
+
logger.error(f"failed to detatch from parent: {e}")
|
|
250
250
|
|
|
251
251
|
# cleanup handlers
|
|
252
252
|
import atexit
|
|
253
253
|
self.cleanup_called = False
|
|
254
|
-
atexit.register(self.
|
|
254
|
+
atexit.register(self.cleanup)
|
|
255
255
|
|
|
256
256
|
self.sessions = []
|
|
257
257
|
self.pipe.send("ready")
|
|
@@ -263,17 +263,15 @@ class PortForwardingManagerProcess(multiprocessing.Process):
|
|
|
263
263
|
logger.info("proxy pipe closed, exiting manager process")
|
|
264
264
|
break
|
|
265
265
|
|
|
266
|
-
self.
|
|
266
|
+
self.cleanup()
|
|
267
267
|
|
|
268
|
-
def
|
|
269
|
-
"""
|
|
268
|
+
def cleanup(self):
|
|
269
|
+
""" Any cleanup tasks go here """
|
|
270
|
+
# ensure clean up only called once
|
|
270
271
|
if self.cleanup_called:
|
|
271
272
|
return
|
|
272
273
|
self.cleanup_called = True
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
def cleanup(self):
|
|
276
|
-
""" Any cleanup tasks go here """
|
|
274
|
+
|
|
277
275
|
logger.info("cleaning up")
|
|
278
276
|
self.close_all_sessions()
|
|
279
277
|
|
|
@@ -338,7 +336,7 @@ class PortForwardingManagerProcess(multiprocessing.Process):
|
|
|
338
336
|
break
|
|
339
337
|
return False
|
|
340
338
|
|
|
341
|
-
def
|
|
339
|
+
def detatch_from_parent(self):
|
|
342
340
|
"""Detach from the parent process to avoid zombies on unix like systems, this will need refining after more testing"""
|
|
343
341
|
if os.name != 'nt':
|
|
344
342
|
os.setsid()
|
|
@@ -44,7 +44,8 @@ class SshServer(paramiko.ServerInterface):
|
|
|
44
44
|
|
|
45
45
|
self.port_forwarding_manager.start()
|
|
46
46
|
self.transport.start_server(server=self)
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
logger.info("Handshake complete, entering main loop")
|
|
48
49
|
self.event.wait()
|
|
49
50
|
|
|
50
51
|
# Auth handlers, just allow anything. The only use of this code is ProxyCommand and auth is not needed
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|