ominfra 0.0.0.dev224__py3-none-any.whl → 0.0.0.dev226__py3-none-any.whl
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.
- ominfra/clouds/aws/journald2aws/driver.py +1 -1
- ominfra/journald/tailer.py +2 -2
- ominfra/manage/commands/subprocess.py +3 -3
- ominfra/manage/remote/spawning.py +2 -2
- ominfra/scripts/journald2aws.py +114 -487
- ominfra/scripts/manage.py +3152 -2851
- ominfra/scripts/supervisor.py +5 -139
- {ominfra-0.0.0.dev224.dist-info → ominfra-0.0.0.dev226.dist-info}/METADATA +3 -3
- {ominfra-0.0.0.dev224.dist-info → ominfra-0.0.0.dev226.dist-info}/RECORD +13 -13
- {ominfra-0.0.0.dev224.dist-info → ominfra-0.0.0.dev226.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev224.dist-info → ominfra-0.0.0.dev226.dist-info}/WHEEL +0 -0
- {ominfra-0.0.0.dev224.dist-info → ominfra-0.0.0.dev226.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev224.dist-info → ominfra-0.0.0.dev226.dist-info}/top_level.txt +0 -0
ominfra/scripts/supervisor.py
CHANGED
@@ -150,9 +150,6 @@ InjectorProviderFn = ta.Callable[['Injector'], ta.Any]
|
|
150
150
|
InjectorProviderFnMap = ta.Mapping['InjectorKey', 'InjectorProviderFn']
|
151
151
|
InjectorBindingOrBindings = ta.Union['InjectorBinding', 'InjectorBindings']
|
152
152
|
|
153
|
-
# ../../omlish/sockets/handlers.py
|
154
|
-
SocketHandler = ta.Callable[[SocketAddress, 'SocketIoPair'], None] # ta.TypeAlias
|
155
|
-
|
156
153
|
# ../../omlish/http/handlers.py
|
157
154
|
HttpHandler = ta.Callable[['HttpHandlerRequest'], 'HttpHandlerResponse'] # ta.TypeAlias
|
158
155
|
HttpHandlerResponseData = ta.Union[bytes, 'HttpHandlerResponseStreamedData'] # ta.TypeAlias # noqa
|
@@ -2876,74 +2873,6 @@ class SocketAndAddress(ta.NamedTuple):
|
|
2876
2873
|
return inner
|
2877
2874
|
|
2878
2875
|
|
2879
|
-
########################################
|
2880
|
-
# ../../../omlish/sockets/io.py
|
2881
|
-
|
2882
|
-
|
2883
|
-
##
|
2884
|
-
|
2885
|
-
|
2886
|
-
class SocketWriter(io.BufferedIOBase):
|
2887
|
-
"""
|
2888
|
-
Simple writable BufferedIOBase implementation for a socket
|
2889
|
-
|
2890
|
-
Does not hold data in a buffer, avoiding any need to call flush().
|
2891
|
-
"""
|
2892
|
-
|
2893
|
-
def __init__(self, sock):
|
2894
|
-
super().__init__()
|
2895
|
-
|
2896
|
-
self._sock = sock
|
2897
|
-
|
2898
|
-
def writable(self):
|
2899
|
-
return True
|
2900
|
-
|
2901
|
-
def write(self, b):
|
2902
|
-
self._sock.sendall(b)
|
2903
|
-
with memoryview(b) as view:
|
2904
|
-
return view.nbytes
|
2905
|
-
|
2906
|
-
def fileno(self):
|
2907
|
-
return self._sock.fileno()
|
2908
|
-
|
2909
|
-
|
2910
|
-
class SocketIoPair(ta.NamedTuple):
|
2911
|
-
r: ta.BinaryIO
|
2912
|
-
w: ta.BinaryIO
|
2913
|
-
|
2914
|
-
@classmethod
|
2915
|
-
def from_socket(
|
2916
|
-
cls,
|
2917
|
-
sock: socket.socket,
|
2918
|
-
*,
|
2919
|
-
r_buf_size: int = -1,
|
2920
|
-
w_buf_size: int = 0,
|
2921
|
-
) -> 'SocketIoPair':
|
2922
|
-
rf: ta.Any = sock.makefile('rb', r_buf_size)
|
2923
|
-
|
2924
|
-
if w_buf_size:
|
2925
|
-
wf: ta.Any = SocketWriter(sock)
|
2926
|
-
else:
|
2927
|
-
wf = sock.makefile('wb', w_buf_size)
|
2928
|
-
|
2929
|
-
return cls(rf, wf)
|
2930
|
-
|
2931
|
-
|
2932
|
-
##
|
2933
|
-
|
2934
|
-
|
2935
|
-
def close_socket_immediately(sock: socket.socket) -> None:
|
2936
|
-
try:
|
2937
|
-
# Explicitly shutdown. socket.close() merely releases the socket and waits for GC to perform the actual close.
|
2938
|
-
sock.shutdown(socket.SHUT_WR)
|
2939
|
-
|
2940
|
-
except OSError:
|
2941
|
-
# Some platforms may raise ENOTCONN here
|
2942
|
-
pass
|
2943
|
-
|
2944
|
-
sock.close()
|
2945
|
-
|
2946
|
-
|
2947
2876
|
########################################
|
2948
2877
|
# ../events.py
|
2949
2878
|
|
@@ -6426,19 +6355,6 @@ def journald_log_handler_factory(
|
|
6426
6355
|
return logging.StreamHandler()
|
6427
6356
|
|
6428
6357
|
|
6429
|
-
########################################
|
6430
|
-
# ../../../omlish/sockets/handlers.py
|
6431
|
-
|
6432
|
-
|
6433
|
-
##
|
6434
|
-
|
6435
|
-
|
6436
|
-
class SocketHandler_(abc.ABC): # noqa
|
6437
|
-
@abc.abstractmethod
|
6438
|
-
def __call__(self, addr: SocketAddress, f: SocketIoPair) -> None:
|
6439
|
-
raise NotImplementedError
|
6440
|
-
|
6441
|
-
|
6442
6358
|
########################################
|
6443
6359
|
# ../configs.py
|
6444
6360
|
|
@@ -7130,9 +7046,6 @@ def configure_standard_logging(
|
|
7130
7046
|
# ../types.py
|
7131
7047
|
|
7132
7048
|
|
7133
|
-
##
|
7134
|
-
|
7135
|
-
|
7136
7049
|
class ExitNow(Exception): # noqa
|
7137
7050
|
pass
|
7138
7051
|
|
@@ -7702,6 +7615,9 @@ class CoroHttpServer:
|
|
7702
7615
|
def coro_handle(self) -> ta.Generator[Io, ta.Optional[bytes], None]:
|
7703
7616
|
return self._coro_run_handler(self._coro_handle_one())
|
7704
7617
|
|
7618
|
+
class Close(Exception): # noqa
|
7619
|
+
pass
|
7620
|
+
|
7705
7621
|
def _coro_run_handler(
|
7706
7622
|
self,
|
7707
7623
|
gen: ta.Generator[
|
@@ -7741,7 +7657,7 @@ class CoroHttpServer:
|
|
7741
7657
|
|
7742
7658
|
try:
|
7743
7659
|
o = gen.send(i)
|
7744
|
-
except
|
7660
|
+
except self.Close:
|
7745
7661
|
return
|
7746
7662
|
except StopIteration:
|
7747
7663
|
break
|
@@ -7770,7 +7686,7 @@ class CoroHttpServer:
|
|
7770
7686
|
break
|
7771
7687
|
|
7772
7688
|
if isinstance(parsed, EmptyParsedHttpResult):
|
7773
|
-
raise
|
7689
|
+
raise self.Close
|
7774
7690
|
|
7775
7691
|
if isinstance(parsed, ParseHttpRequestError):
|
7776
7692
|
err = self._build_error(
|
@@ -7862,56 +7778,6 @@ class CoroHttpServer:
|
|
7862
7778
|
raise
|
7863
7779
|
|
7864
7780
|
|
7865
|
-
##
|
7866
|
-
|
7867
|
-
|
7868
|
-
class CoroHttpServerSocketHandler(SocketHandler_):
|
7869
|
-
def __init__(
|
7870
|
-
self,
|
7871
|
-
server_factory: CoroHttpServerFactory,
|
7872
|
-
*,
|
7873
|
-
log_handler: ta.Optional[ta.Callable[[CoroHttpServer, CoroHttpServer.AnyLogIo], None]] = None,
|
7874
|
-
) -> None:
|
7875
|
-
super().__init__()
|
7876
|
-
|
7877
|
-
self._server_factory = server_factory
|
7878
|
-
self._log_handler = log_handler
|
7879
|
-
|
7880
|
-
def __call__(self, client_address: SocketAddress, fp: SocketIoPair) -> None:
|
7881
|
-
server = self._server_factory(client_address)
|
7882
|
-
|
7883
|
-
gen = server.coro_handle()
|
7884
|
-
|
7885
|
-
o = next(gen)
|
7886
|
-
while True:
|
7887
|
-
if isinstance(o, CoroHttpServer.AnyLogIo):
|
7888
|
-
i = None
|
7889
|
-
if self._log_handler is not None:
|
7890
|
-
self._log_handler(server, o)
|
7891
|
-
|
7892
|
-
elif isinstance(o, CoroHttpServer.ReadIo):
|
7893
|
-
i = fp.r.read(o.sz)
|
7894
|
-
|
7895
|
-
elif isinstance(o, CoroHttpServer.ReadLineIo):
|
7896
|
-
i = fp.r.readline(o.sz)
|
7897
|
-
|
7898
|
-
elif isinstance(o, CoroHttpServer.WriteIo):
|
7899
|
-
i = None
|
7900
|
-
fp.w.write(o.data)
|
7901
|
-
fp.w.flush()
|
7902
|
-
|
7903
|
-
else:
|
7904
|
-
raise TypeError(o)
|
7905
|
-
|
7906
|
-
try:
|
7907
|
-
if i is not None:
|
7908
|
-
o = gen.send(i)
|
7909
|
-
else:
|
7910
|
-
o = next(gen)
|
7911
|
-
except StopIteration:
|
7912
|
-
break
|
7913
|
-
|
7914
|
-
|
7915
7781
|
########################################
|
7916
7782
|
# ../dispatchers.py
|
7917
7783
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev226
|
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.
|
16
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omdev==0.0.0.dev226
|
16
|
+
Requires-Dist: omlish==0.0.0.dev226
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -20,7 +20,7 @@ ominfra/clouds/aws/instancetypes/cli.py,sha256=HcfOchROLGFsxmEIuXtXVywFJWjHOk4yv
|
|
20
20
|
ominfra/clouds/aws/journald2aws/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
21
21
|
ominfra/clouds/aws/journald2aws/__main__.py,sha256=d23loR_cKfTYZwYiqpt_CmKI7dd5WcYFgIYzqMep75E,68
|
22
22
|
ominfra/clouds/aws/journald2aws/cursor.py,sha256=tQ7O6BHlEdaalbiI_Rqagj0aHfdtTQ_ZJwdOSRUjNvQ,1173
|
23
|
-
ominfra/clouds/aws/journald2aws/driver.py,sha256=
|
23
|
+
ominfra/clouds/aws/journald2aws/driver.py,sha256=eXz32NbU_1rEB0tOnNg0KLIJ3tpRQcFKgA63lmpmZOc,6120
|
24
24
|
ominfra/clouds/aws/journald2aws/main.py,sha256=sqs_IoLzadv0EJoWHnYdgg3bkDDSFshCvyRWByTm8Sg,2179
|
25
25
|
ominfra/clouds/aws/journald2aws/poster.py,sha256=hz1XuctW8GtLmfjhRvCFY6py52D4BzXHYny5XKFpHSA,2833
|
26
26
|
ominfra/clouds/aws/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -45,7 +45,7 @@ ominfra/journald/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
45
45
|
ominfra/journald/fields.py,sha256=NjjVn7GW4jkcGdyiiizVjEfQqSFnolXYk3kDcSQcMmc,12278
|
46
46
|
ominfra/journald/genmessages.py,sha256=rLTS-K2v7otNOtTz4RoOEVYCm0fQuuBzf47e0T61tA8,1857
|
47
47
|
ominfra/journald/messages.py,sha256=zhAQswhpSBybaBPWONCt0quenYK91HMHRkuOz38mq1E,2184
|
48
|
-
ominfra/journald/tailer.py,sha256=
|
48
|
+
ominfra/journald/tailer.py,sha256=PBdttWM0NRGqgxSpbPueyz39KuICFf_KUrgnsWxmLaI,33517
|
49
49
|
ominfra/manage/__init__.py,sha256=aykrEASTHEtJ-o97jUHRIv8oea41tO7RDHB56cQfmis,265
|
50
50
|
ominfra/manage/__main__.py,sha256=5IeIERm-371fSI5ZvPv8eldAJBwgKwpR0R49pTsILNM,76
|
51
51
|
ominfra/manage/bootstrap.py,sha256=1RIRhVkUZjxZcZerHMg8U6xgWhhemGgPN5cDye8dQ68,446
|
@@ -61,7 +61,7 @@ ominfra/manage/commands/injection.py,sha256=lhiSzcGM-lLDsvuxakyc_8XViCzF7JPuAicQ
|
|
61
61
|
ominfra/manage/commands/local.py,sha256=DyHIsQ03_YS6kAA8WLeMyXyGgyizkd1WZUZdATkSsZE,532
|
62
62
|
ominfra/manage/commands/marshal.py,sha256=Xl_yRgCD94yDmAx6e2uKVRjkmhV5EOr-Akqo3C0DGXw,689
|
63
63
|
ominfra/manage/commands/ping.py,sha256=DVZFzL1Z_f-Bq53vxMrL3xOi0iK_nMonJE4KvQf9wsI,546
|
64
|
-
ominfra/manage/commands/subprocess.py,sha256=
|
64
|
+
ominfra/manage/commands/subprocess.py,sha256=9JKg3opViTjIrXfgeMkPjlHWCWsJEhLhyZxXS5xJpxc,2455
|
65
65
|
ominfra/manage/commands/types.py,sha256=XFZPeqeIBAaIIQF3pdPbGxLlb-LCrz6WtlDWO2q_vz0,210
|
66
66
|
ominfra/manage/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
67
67
|
ominfra/manage/deploy/apps.py,sha256=T0eU0Jw-h33_ZPIs0zy9DOx_fgs3YSAAGzu-H0pvt2U,4865
|
@@ -98,7 +98,7 @@ ominfra/manage/remote/connection.py,sha256=T4fL-GXXAfnbCbkZ3_28t8LAwwki4Td3j41eY
|
|
98
98
|
ominfra/manage/remote/execution.py,sha256=_bygZi_0Uel615uIg43S14CTdmv1unEIu9TPz2mVRJ4,11738
|
99
99
|
ominfra/manage/remote/inject.py,sha256=nSNP_VInCCZOWVrUIRHBvLmnM45geFoYmMh-zqc__as,1080
|
100
100
|
ominfra/manage/remote/payload.py,sha256=Rn-Yo26POpHEOOfUHX3jWkqcQVEAvkJ_5Bu13jwoob4,944
|
101
|
-
ominfra/manage/remote/spawning.py,sha256=
|
101
|
+
ominfra/manage/remote/spawning.py,sha256=cElA7SesWYVWzZ_M2JtShYwO7mdvemmsN8foFy1hnhk,3306
|
102
102
|
ominfra/manage/system/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
103
103
|
ominfra/manage/system/commands.py,sha256=XrYvsxiwTJh17buIWmoFGH8zTUIXmrXvYkLy1INtmkU,1173
|
104
104
|
ominfra/manage/system/config.py,sha256=mEVBL1cy4twO6F0bdnCI01Sm0xuLe1Z5eiAzCvbmoAc,196
|
@@ -112,9 +112,9 @@ ominfra/manage/targets/connection.py,sha256=rVI1YJxFClcF-sdttqWyIz9_XjPI01GUdwxY
|
|
112
112
|
ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhhMcE,1561
|
113
113
|
ominfra/manage/targets/targets.py,sha256=7GP6UAZyJFEhpkJN6UQdpr_WN3p7C76v-s445y-WB6U,1885
|
114
114
|
ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
115
|
-
ominfra/scripts/journald2aws.py,sha256=
|
116
|
-
ominfra/scripts/manage.py,sha256=
|
117
|
-
ominfra/scripts/supervisor.py,sha256=
|
115
|
+
ominfra/scripts/journald2aws.py,sha256=kFXWznbHrlDS8NPnYMXMdB8KY2TC0NR-7TCEBtVCr6s,164314
|
116
|
+
ominfra/scripts/manage.py,sha256=zwqZl0SrFkGIuPNPLUxNXho8Ol6vV6XELLMnO0Ifrec,373794
|
117
|
+
ominfra/scripts/supervisor.py,sha256=8vVoR8kq7Qh2z_NdOrDXXnNCu9N5TnOM2M5om4D-ZmA,296097
|
118
118
|
ominfra/supervisor/LICENSE.txt,sha256=ZrHY15PVR98y26Yg6iQfa-SXnUaYTDhrUsPVcEO5OKM,1874
|
119
119
|
ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
120
120
|
ominfra/supervisor/__main__.py,sha256=I0yFw-C08OOiZ3BF6lF1Oiv789EQXu-_j6whDhQUTEA,66
|
@@ -156,9 +156,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
|
|
156
156
|
ominfra/tailscale/cli.py,sha256=3FnJbgpLw6gInTfhERd1mDy9ijjMUGxkdYVo43Tnxx4,3555
|
157
157
|
ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
158
158
|
ominfra/tools/listresources.py,sha256=BxFoxtyF2aVEcW67ZD9QujoBkJBtvIxGmKqXvLwnEHo,6180
|
159
|
-
ominfra-0.0.0.
|
160
|
-
ominfra-0.0.0.
|
161
|
-
ominfra-0.0.0.
|
162
|
-
ominfra-0.0.0.
|
163
|
-
ominfra-0.0.0.
|
164
|
-
ominfra-0.0.0.
|
159
|
+
ominfra-0.0.0.dev226.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
160
|
+
ominfra-0.0.0.dev226.dist-info/METADATA,sha256=u7LicSxDxCEWpRchillvpD48AC7WKv4628Qqvea947Y,731
|
161
|
+
ominfra-0.0.0.dev226.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
162
|
+
ominfra-0.0.0.dev226.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
163
|
+
ominfra-0.0.0.dev226.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
164
|
+
ominfra-0.0.0.dev226.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|