ssm-cli 0.0.9__tar.gz → 0.1.0.dev0__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.
Files changed (39) hide show
  1. {ssm_cli-0.0.9/ssm_cli.egg-info → ssm_cli-0.1.0.dev0}/PKG-INFO +1 -1
  2. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/pyproject.toml +7 -4
  3. ssm_cli-0.1.0.dev0/ssm_cli/__init__.py +0 -0
  4. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/shell.py +11 -2
  5. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/xdg.py +12 -3
  6. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0/ssm_cli.egg-info}/PKG-INFO +1 -1
  7. ssm_cli-0.0.9/ssm_cli/__init__.py +0 -1
  8. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/LICENCE +0 -0
  9. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/README.md +0 -0
  10. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/setup.cfg +0 -0
  11. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/__main__.py +0 -0
  12. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/aws.py +0 -0
  13. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/cli.py +0 -0
  14. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/cli_args.py +0 -0
  15. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/__init__.py +0 -0
  16. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/base.py +0 -0
  17. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/list.py +0 -0
  18. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/setup/__init__.py +0 -0
  19. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/setup/actions/base.py +0 -0
  20. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/setup/actions/ssh.py +0 -0
  21. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/setup/definition.py +0 -0
  22. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/ssh_proxy/__init__.py +0 -0
  23. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/ssh_proxy/channels.py +0 -0
  24. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/ssh_proxy/forward.py +0 -0
  25. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/ssh_proxy/server.py +0 -0
  26. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/ssh_proxy/shell.py +0 -0
  27. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/commands/ssh_proxy/transport.py +0 -0
  28. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/config.py +0 -0
  29. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/instances.py +0 -0
  30. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/selectors/__init__.py +0 -0
  31. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/selectors/first.py +0 -0
  32. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/selectors/tui/__init__.py +0 -0
  33. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/selectors/tui/posix.py +0 -0
  34. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli/selectors/tui/win.py +0 -0
  35. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli.egg-info/SOURCES.txt +0 -0
  36. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli.egg-info/dependency_links.txt +0 -0
  37. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli.egg-info/entry_points.txt +0 -0
  38. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli.egg-info/requires.txt +0 -0
  39. {ssm_cli-0.0.9 → ssm_cli-0.1.0.dev0}/ssm_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssm-cli
3
- Version: 0.0.9
3
+ Version: 0.1.0.dev0
4
4
  Summary: CLI tool to help with SSM functionality, aimed at adminstrators
5
5
  Author-email: Simon Fletcher <simon.fletcher@lexisnexisrisk.com>
6
6
  License: MIT License
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools >= 61.0"]
2
+ requires = ["setuptools >= 61.0", "setuptools-git-versioning>=2.1"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
 
@@ -39,6 +39,9 @@ file = "LICENCE"
39
39
  Homepage = "https://github.com/simonfletcher-ln/ssm-cli"
40
40
  Issues = "https://github.com/simonfletcher-ln/ssm-cli/issues"
41
41
 
42
-
43
- [tool.setuptools.dynamic]
44
- version = { attr = "ssm_cli.__version__" }
42
+ [tool.setuptools-git-versioning]
43
+ enabled = true
44
+ version_file = "VERSION"
45
+ count_commits_from_version_file = true
46
+ dev_template = "{tag}.dev{ccount}"
47
+ dirty_template = "{tag}.dev{ccount}"
File without changes
@@ -5,6 +5,9 @@ from ssm_cli.cli_args import ARGS
5
5
  import logging
6
6
  logger = logging.getLogger(__name__)
7
7
 
8
+ from rich.console import Console
9
+
10
+ console = Console()
8
11
 
9
12
  class ShellCommand(BaseCommand):
10
13
  HELP = "Connects to instances"
@@ -16,11 +19,17 @@ class ShellCommand(BaseCommand):
16
19
  logger.info("running shell action")
17
20
 
18
21
  instances = Instances()
19
- instance = instances.select_instance(ARGS.group, "tui")
22
+ try:
23
+ instance = instances.select_instance(ARGS.group, "tui")
24
+ except KeyboardInterrupt:
25
+ logger.error("user cancelled")
26
+ console.print(f":x: [bold red]user cancelled[/bold red]")
27
+ return
20
28
 
21
29
  if instance is None:
22
30
  logger.error("failed to select host")
23
- raise RuntimeError("failed to select host")
31
+ console.print(f":x: [bold red]failed to select host[/bold red]")
32
+ return
24
33
 
25
34
  logger.info(f"connecting to {repr(instance)}")
26
35
 
@@ -1,7 +1,10 @@
1
1
  from pathlib import Path
2
- from xdg_base_dirs import xdg_config_home
2
+ from xdg_base_dirs import xdg_config_home, xdg_state_home
3
3
 
4
- # We just put everything in the same directory as there is so little
4
+ # Default locations for ssm-cli files
5
+ # ~/.config/ssm-cli/ssm.yaml
6
+ # ~/.config/ssm-cli/hostkey.pem
7
+ # ~/.local/state/ssm-cli/ssm.log
5
8
 
6
9
  def get_conf_root(check=True) -> Path:
7
10
  root = xdg_config_home() / 'ssm-cli'
@@ -10,6 +13,12 @@ def get_conf_root(check=True) -> Path:
10
13
  create_conf_dir()
11
14
  return root
12
15
 
16
+ def get_state_root() -> Path:
17
+ path = xdg_state_home() / 'ssm-cli'
18
+ if not path.exists():
19
+ path.mkdir(parents=True)
20
+ return path
21
+
13
22
  def get_conf_file(check=True) -> Path:
14
23
  path = get_conf_root(check) / 'ssm.yaml'
15
24
  if check and not path.exists():
@@ -17,7 +26,7 @@ def get_conf_file(check=True) -> Path:
17
26
  return path
18
27
 
19
28
  def get_log_file(check=False) -> Path:
20
- path = get_conf_root(True) / 'ssm.log'
29
+ path = get_state_root() / 'run.log'
21
30
  if check and not path.exists():
22
31
  raise EnvironmentError(f"{path} missing, run `ssm setup` to create")
23
32
  return path
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssm-cli
3
- Version: 0.0.9
3
+ Version: 0.1.0.dev0
4
4
  Summary: CLI tool to help with SSM functionality, aimed at adminstrators
5
5
  Author-email: Simon Fletcher <simon.fletcher@lexisnexisrisk.com>
6
6
  License: MIT License
@@ -1 +0,0 @@
1
- __version__ = "0.0.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes