ominfra 0.0.0.dev174__tar.gz → 0.0.0.dev175__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. {ominfra-0.0.0.dev174/ominfra.egg-info → ominfra-0.0.0.dev175}/PKG-INFO +3 -3
  2. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/conf.py +12 -6
  3. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/paths/paths.py +2 -2
  4. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/specs.py +3 -9
  5. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/scripts/manage.py +16 -15
  6. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175/ominfra.egg-info}/PKG-INFO +3 -3
  7. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra.egg-info/requires.txt +2 -2
  8. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/pyproject.toml +3 -3
  9. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/LICENSE +0 -0
  10. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/MANIFEST.in +0 -0
  11. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/README.rst +0 -0
  12. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/.manifests.json +0 -0
  13. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/__about__.py +0 -0
  14. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/__init__.py +0 -0
  15. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/__init__.py +0 -0
  16. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/__init__.py +0 -0
  17. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/__main__.py +0 -0
  18. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/auth.py +0 -0
  19. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/cli.py +0 -0
  20. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/dataclasses.py +0 -0
  21. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
  22. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
  23. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
  24. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
  25. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/journald2aws/main.py +0 -0
  26. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
  27. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/logs.py +0 -0
  28. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/aws/metadata.py +0 -0
  29. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/gcp/__init__.py +0 -0
  30. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/clouds/gcp/auth.py +0 -0
  31. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/cmds.py +0 -0
  32. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/configs.py +0 -0
  33. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/journald/__init__.py +0 -0
  34. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/journald/fields.py +0 -0
  35. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/journald/genmessages.py +0 -0
  36. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/journald/messages.py +0 -0
  37. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/journald/tailer.py +0 -0
  38. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/__init__.py +0 -0
  39. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/__main__.py +0 -0
  40. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/bootstrap.py +0 -0
  41. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/bootstrap_.py +0 -0
  42. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/__init__.py +0 -0
  43. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/base.py +0 -0
  44. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/inject.py +0 -0
  45. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/local.py +0 -0
  46. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/marshal.py +0 -0
  47. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/ping.py +0 -0
  48. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/subprocess.py +0 -0
  49. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/commands/types.py +0 -0
  50. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/config.py +0 -0
  51. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/__init__.py +0 -0
  52. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/apps.py +0 -0
  53. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/commands.py +0 -0
  54. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/config.py +0 -0
  55. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/deploy.py +0 -0
  56. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/git.py +0 -0
  57. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/inject.py +0 -0
  58. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/interp.py +0 -0
  59. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/paths/__init__.py +0 -0
  60. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/paths/inject.py +0 -0
  61. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/paths/manager.py +0 -0
  62. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/paths/owners.py +0 -0
  63. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/paths/types.py +0 -0
  64. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/tags.py +0 -0
  65. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/tmp.py +0 -0
  66. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/types.py +0 -0
  67. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/deploy/venvs.py +0 -0
  68. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/inject.py +0 -0
  69. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/main.py +0 -0
  70. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/marshal.py +0 -0
  71. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/__init__.py +0 -0
  72. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/_main.py +0 -0
  73. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/channel.py +0 -0
  74. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/config.py +0 -0
  75. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/connection.py +0 -0
  76. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/execution.py +0 -0
  77. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/inject.py +0 -0
  78. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/payload.py +0 -0
  79. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/remote/spawning.py +0 -0
  80. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/system/__init__.py +0 -0
  81. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/system/commands.py +0 -0
  82. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/system/config.py +0 -0
  83. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/system/inject.py +0 -0
  84. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/system/packages.py +0 -0
  85. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/system/platforms.py +0 -0
  86. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/targets/__init__.py +0 -0
  87. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/targets/bestpython.py +0 -0
  88. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/targets/bestpython.sh +0 -0
  89. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/targets/connection.py +0 -0
  90. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/targets/inject.py +0 -0
  91. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/manage/targets/targets.py +0 -0
  92. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/pyremote.py +0 -0
  93. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/scripts/__init__.py +0 -0
  94. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/scripts/journald2aws.py +0 -0
  95. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/scripts/supervisor.py +0 -0
  96. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/ssh.py +0 -0
  97. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/LICENSE.txt +0 -0
  98. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/__init__.py +0 -0
  99. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/__main__.py +0 -0
  100. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/configs.py +0 -0
  101. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/dispatchers.py +0 -0
  102. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/dispatchersimpl.py +0 -0
  103. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/events.py +0 -0
  104. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/exceptions.py +0 -0
  105. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/groups.py +0 -0
  106. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/groupsimpl.py +0 -0
  107. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/http.py +0 -0
  108. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/inject.py +0 -0
  109. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/io.py +0 -0
  110. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/main.py +0 -0
  111. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/pipes.py +0 -0
  112. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/privileges.py +0 -0
  113. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/process.py +0 -0
  114. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/processimpl.py +0 -0
  115. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/setup.py +0 -0
  116. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/setupimpl.py +0 -0
  117. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/signals.py +0 -0
  118. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/spawning.py +0 -0
  119. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/spawningimpl.py +0 -0
  120. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/states.py +0 -0
  121. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/supervisor.py +0 -0
  122. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/types.py +0 -0
  123. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/__init__.py +0 -0
  124. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/collections.py +0 -0
  125. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/diag.py +0 -0
  126. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/fds.py +0 -0
  127. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/fs.py +0 -0
  128. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/os.py +0 -0
  129. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/ostypes.py +0 -0
  130. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/signals.py +0 -0
  131. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/strings.py +0 -0
  132. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/supervisor/utils/users.py +0 -0
  133. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/tailscale/__init__.py +0 -0
  134. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/tailscale/api.py +0 -0
  135. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/tailscale/cli.py +0 -0
  136. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/threadworkers.py +0 -0
  137. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/tools/__init__.py +0 -0
  138. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra/tools/listresources.py +0 -0
  139. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra.egg-info/SOURCES.txt +0 -0
  140. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra.egg-info/dependency_links.txt +0 -0
  141. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra.egg-info/entry_points.txt +0 -0
  142. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/ominfra.egg-info/top_level.txt +0 -0
  143. {ominfra-0.0.0.dev174 → ominfra-0.0.0.dev175}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev174
3
+ Version: 0.0.0.dev175
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Operating System :: POSIX
13
13
  Requires-Python: >=3.12
14
14
  License-File: LICENSE
15
- Requires-Dist: omdev==0.0.0.dev174
16
- Requires-Dist: omlish==0.0.0.dev174
15
+ Requires-Dist: omdev==0.0.0.dev175
16
+ Requires-Dist: omlish==0.0.0.dev175
17
17
  Provides-Extra: all
18
18
  Requires-Dist: paramiko~=3.5; extra == "all"
19
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -24,13 +24,12 @@ from omlish.os.paths import is_path_in_dir
24
24
  from omlish.os.paths import relative_symlink
25
25
 
26
26
  from .paths.paths import DeployPath
27
- from .specs import AllActiveDeployAppConfLink
28
- from .specs import CurrentOnlyDeployAppConfLink
29
27
  from .specs import DeployAppConfFile
30
28
  from .specs import DeployAppConfLink
31
29
  from .specs import DeployAppConfSpec
32
30
  from .tags import DEPLOY_TAG_SEPARATOR
33
31
  from .tags import DeployApp
32
+ from .tags import DeployConf
34
33
  from .tags import DeployTagMap
35
34
  from .types import DeployHome
36
35
 
@@ -63,6 +62,7 @@ class DeployConfManager:
63
62
  #
64
63
 
65
64
  class _ComputedConfLink(ta.NamedTuple):
65
+ conf: DeployConf
66
66
  is_dir: bool
67
67
  link_src: str
68
68
  link_dst: str
@@ -70,8 +70,9 @@ class DeployConfManager:
70
70
  _UNIQUE_LINK_NAME_STR = '@app--@time--@app-key'
71
71
  _UNIQUE_LINK_NAME = DeployPath.parse(_UNIQUE_LINK_NAME_STR)
72
72
 
73
+ @classmethod
73
74
  def _compute_app_conf_link_dst(
74
- self,
75
+ cls,
75
76
  link: DeployAppConfLink,
76
77
  tags: DeployTagMap,
77
78
  app_conf_dir: str,
@@ -85,6 +86,7 @@ class DeployConfManager:
85
86
  if (is_dir := link.src.endswith('/')):
86
87
  # @conf/ - links a directory in root of app conf dir to conf/@conf/@dst/
87
88
  check.arg(link.src.count('/') == 1)
89
+ conf = DeployConf(link.src.split('/')[0])
88
90
  link_dst_pfx = link.src
89
91
  link_dst_sfx = ''
90
92
 
@@ -92,6 +94,7 @@ class DeployConfManager:
92
94
  # @conf/file - links a single file in a single subdir to conf/@conf/@dst--file
93
95
  d, f = os.path.split(link.src)
94
96
  # TODO: check filename :|
97
+ conf = DeployConf(d)
95
98
  link_dst_pfx = d + '/'
96
99
  link_dst_sfx = DEPLOY_TAG_SEPARATOR + f
97
100
 
@@ -99,18 +102,20 @@ class DeployConfManager:
99
102
  # @conf(.ext)* - links a single file in root of app conf dir to conf/@conf/@dst(.ext)*
100
103
  if '.' in link.src:
101
104
  l, _, r = link.src.partition('.')
105
+ conf = DeployConf(l)
102
106
  link_dst_pfx = l + '/'
103
107
  link_dst_sfx = '.' + r
104
108
  else:
109
+ conf = DeployConf(link.src)
105
110
  link_dst_pfx = link.src + '/'
106
111
  link_dst_sfx = ''
107
112
 
108
113
  #
109
114
 
110
- if isinstance(link, CurrentOnlyDeployAppConfLink):
115
+ if link.kind == 'current_only':
111
116
  link_dst_mid = str(tags[DeployApp].s)
112
- elif isinstance(link, AllActiveDeployAppConfLink):
113
- link_dst_mid = self._UNIQUE_LINK_NAME.render(tags)
117
+ elif link.kind == 'all_active':
118
+ link_dst_mid = cls._UNIQUE_LINK_NAME.render(tags)
114
119
  else:
115
120
  raise TypeError(link)
116
121
 
@@ -124,6 +129,7 @@ class DeployConfManager:
124
129
  link_dst = os.path.join(conf_link_dir, link_dst_name)
125
130
 
126
131
  return DeployConfManager._ComputedConfLink(
132
+ conf=conf,
127
133
  is_dir=is_dir,
128
134
  link_src=link_src,
129
135
  link_dst=link_dst,
@@ -170,7 +170,7 @@ class FileDeployPathPart(DeployPathPart):
170
170
  return 'file'
171
171
 
172
172
 
173
- #
173
+ ##
174
174
 
175
175
 
176
176
  @dc.dataclass(frozen=True)
@@ -197,7 +197,7 @@ class DeployPath:
197
197
  return pd
198
198
 
199
199
  @property
200
- def kind(self) -> ta.Literal['file', 'dir']:
200
+ def kind(self) -> DeployPathKind:
201
201
  return self.parts[-1].kind
202
202
 
203
203
  def render(self, tags: ta.Optional[DeployTagMap] = None) -> str:
@@ -95,7 +95,7 @@ class DeployAppConfFile:
95
95
 
96
96
 
97
97
  @dc.dataclass(frozen=True)
98
- class DeployAppConfLink(abc.ABC): # noqa
98
+ class DeployAppConfLink: # noqa
99
99
  """
100
100
  May be either:
101
101
  - @conf(.ext)* - links a single file in root of app conf dir to conf/@conf/@dst(.ext)*
@@ -105,20 +105,14 @@ class DeployAppConfLink(abc.ABC): # noqa
105
105
 
106
106
  src: str
107
107
 
108
+ kind: ta.Literal['current_only', 'all_active'] = 'current_only'
109
+
108
110
  def __post_init__(self) -> None:
109
111
  check_valid_deploy_spec_path(self.src)
110
112
  if '/' in self.src:
111
113
  check.equal(self.src.count('/'), 1)
112
114
 
113
115
 
114
- class CurrentOnlyDeployAppConfLink(DeployAppConfLink):
115
- pass
116
-
117
-
118
- class AllActiveDeployAppConfLink(DeployAppConfLink):
119
- pass
120
-
121
-
122
116
  #
123
117
 
124
118
 
@@ -7084,7 +7084,7 @@ class FileDeployPathPart(DeployPathPart):
7084
7084
  return 'file'
7085
7085
 
7086
7086
 
7087
- #
7087
+ ##
7088
7088
 
7089
7089
 
7090
7090
  @dc.dataclass(frozen=True)
@@ -7111,7 +7111,7 @@ class DeployPath:
7111
7111
  return pd
7112
7112
 
7113
7113
  @property
7114
- def kind(self) -> ta.Literal['file', 'dir']:
7114
+ def kind(self) -> DeployPathKind:
7115
7115
  return self.parts[-1].kind
7116
7116
 
7117
7117
  def render(self, tags: ta.Optional[DeployTagMap] = None) -> str:
@@ -7206,7 +7206,7 @@ class DeployAppConfFile:
7206
7206
 
7207
7207
 
7208
7208
  @dc.dataclass(frozen=True)
7209
- class DeployAppConfLink(abc.ABC): # noqa
7209
+ class DeployAppConfLink: # noqa
7210
7210
  """
7211
7211
  May be either:
7212
7212
  - @conf(.ext)* - links a single file in root of app conf dir to conf/@conf/@dst(.ext)*
@@ -7216,20 +7216,14 @@ class DeployAppConfLink(abc.ABC): # noqa
7216
7216
 
7217
7217
  src: str
7218
7218
 
7219
+ kind: ta.Literal['current_only', 'all_active'] = 'current_only'
7220
+
7219
7221
  def __post_init__(self) -> None:
7220
7222
  check_valid_deploy_spec_path(self.src)
7221
7223
  if '/' in self.src:
7222
7224
  check.equal(self.src.count('/'), 1)
7223
7225
 
7224
7226
 
7225
- class CurrentOnlyDeployAppConfLink(DeployAppConfLink):
7226
- pass
7227
-
7228
-
7229
- class AllActiveDeployAppConfLink(DeployAppConfLink):
7230
- pass
7231
-
7232
-
7233
7227
  #
7234
7228
 
7235
7229
 
@@ -7917,6 +7911,7 @@ class DeployConfManager:
7917
7911
  #
7918
7912
 
7919
7913
  class _ComputedConfLink(ta.NamedTuple):
7914
+ conf: DeployConf
7920
7915
  is_dir: bool
7921
7916
  link_src: str
7922
7917
  link_dst: str
@@ -7924,8 +7919,9 @@ class DeployConfManager:
7924
7919
  _UNIQUE_LINK_NAME_STR = '@app--@time--@app-key'
7925
7920
  _UNIQUE_LINK_NAME = DeployPath.parse(_UNIQUE_LINK_NAME_STR)
7926
7921
 
7922
+ @classmethod
7927
7923
  def _compute_app_conf_link_dst(
7928
- self,
7924
+ cls,
7929
7925
  link: DeployAppConfLink,
7930
7926
  tags: DeployTagMap,
7931
7927
  app_conf_dir: str,
@@ -7939,6 +7935,7 @@ class DeployConfManager:
7939
7935
  if (is_dir := link.src.endswith('/')):
7940
7936
  # @conf/ - links a directory in root of app conf dir to conf/@conf/@dst/
7941
7937
  check.arg(link.src.count('/') == 1)
7938
+ conf = DeployConf(link.src.split('/')[0])
7942
7939
  link_dst_pfx = link.src
7943
7940
  link_dst_sfx = ''
7944
7941
 
@@ -7946,6 +7943,7 @@ class DeployConfManager:
7946
7943
  # @conf/file - links a single file in a single subdir to conf/@conf/@dst--file
7947
7944
  d, f = os.path.split(link.src)
7948
7945
  # TODO: check filename :|
7946
+ conf = DeployConf(d)
7949
7947
  link_dst_pfx = d + '/'
7950
7948
  link_dst_sfx = DEPLOY_TAG_SEPARATOR + f
7951
7949
 
@@ -7953,18 +7951,20 @@ class DeployConfManager:
7953
7951
  # @conf(.ext)* - links a single file in root of app conf dir to conf/@conf/@dst(.ext)*
7954
7952
  if '.' in link.src:
7955
7953
  l, _, r = link.src.partition('.')
7954
+ conf = DeployConf(l)
7956
7955
  link_dst_pfx = l + '/'
7957
7956
  link_dst_sfx = '.' + r
7958
7957
  else:
7958
+ conf = DeployConf(link.src)
7959
7959
  link_dst_pfx = link.src + '/'
7960
7960
  link_dst_sfx = ''
7961
7961
 
7962
7962
  #
7963
7963
 
7964
- if isinstance(link, CurrentOnlyDeployAppConfLink):
7964
+ if link.kind == 'current_only':
7965
7965
  link_dst_mid = str(tags[DeployApp].s)
7966
- elif isinstance(link, AllActiveDeployAppConfLink):
7967
- link_dst_mid = self._UNIQUE_LINK_NAME.render(tags)
7966
+ elif link.kind == 'all_active':
7967
+ link_dst_mid = cls._UNIQUE_LINK_NAME.render(tags)
7968
7968
  else:
7969
7969
  raise TypeError(link)
7970
7970
 
@@ -7978,6 +7978,7 @@ class DeployConfManager:
7978
7978
  link_dst = os.path.join(conf_link_dir, link_dst_name)
7979
7979
 
7980
7980
  return DeployConfManager._ComputedConfLink(
7981
+ conf=conf,
7981
7982
  is_dir=is_dir,
7982
7983
  link_src=link_src,
7983
7984
  link_dst=link_dst,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev174
3
+ Version: 0.0.0.dev175
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Operating System :: POSIX
13
13
  Requires-Python: >=3.12
14
14
  License-File: LICENSE
15
- Requires-Dist: omdev==0.0.0.dev174
16
- Requires-Dist: omlish==0.0.0.dev174
15
+ Requires-Dist: omdev==0.0.0.dev175
16
+ Requires-Dist: omlish==0.0.0.dev175
17
17
  Provides-Extra: all
18
18
  Requires-Dist: paramiko~=3.5; extra == "all"
19
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -1,5 +1,5 @@
1
- omdev==0.0.0.dev174
2
- omlish==0.0.0.dev174
1
+ omdev==0.0.0.dev175
2
+ omlish==0.0.0.dev175
3
3
 
4
4
  [all]
5
5
  paramiko~=3.5
@@ -12,7 +12,7 @@ authors = [
12
12
  urls = {source = 'https://github.com/wrmsr/omlish'}
13
13
  license = {text = 'BSD-3-Clause'}
14
14
  requires-python = '>=3.12'
15
- version = '0.0.0.dev174'
15
+ version = '0.0.0.dev175'
16
16
  classifiers = [
17
17
  'License :: OSI Approved :: BSD License',
18
18
  'Development Status :: 2 - Pre-Alpha',
@@ -22,8 +22,8 @@ classifiers = [
22
22
  ]
23
23
  description = 'ominfra'
24
24
  dependencies = [
25
- 'omdev == 0.0.0.dev174',
26
- 'omlish == 0.0.0.dev174',
25
+ 'omdev == 0.0.0.dev175',
26
+ 'omlish == 0.0.0.dev175',
27
27
  ]
28
28
 
29
29
  [project.optional-dependencies]
File without changes
File without changes