ominfra 0.0.0.dev217__py3-none-any.whl → 0.0.0.dev219__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/instancetypes/cli.py +1 -1
- ominfra/scripts/supervisor.py +163 -166
- ominfra/supervisor/http.py +1 -2
- ominfra/tools/listresources.py +1 -1
- {ominfra-0.0.0.dev217.dist-info → ominfra-0.0.0.dev219.dist-info}/METADATA +3 -3
- {ominfra-0.0.0.dev217.dist-info → ominfra-0.0.0.dev219.dist-info}/RECORD +10 -10
- {ominfra-0.0.0.dev217.dist-info → ominfra-0.0.0.dev219.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev217.dist-info → ominfra-0.0.0.dev219.dist-info}/WHEEL +0 -0
- {ominfra-0.0.0.dev217.dist-info → ominfra-0.0.0.dev219.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev217.dist-info → ominfra-0.0.0.dev219.dist-info}/top_level.txt +0 -0
@@ -5,9 +5,9 @@ import typing as ta
|
|
5
5
|
|
6
6
|
from omdev.secrets import load_secrets
|
7
7
|
from omlish import lang
|
8
|
-
from omlish import secrets as sec
|
9
8
|
from omlish.argparse import all as ap
|
10
9
|
from omlish.formats import json
|
10
|
+
from omlish.secrets import all as sec
|
11
11
|
|
12
12
|
from .cache import load_instance_types
|
13
13
|
|
ominfra/scripts/supervisor.py
CHANGED
@@ -71,6 +71,7 @@ import select
|
|
71
71
|
import shlex
|
72
72
|
import signal
|
73
73
|
import socket
|
74
|
+
import socket as socket_
|
74
75
|
import stat
|
75
76
|
import string
|
76
77
|
import sys
|
@@ -142,10 +143,6 @@ ConfigDataT = ta.TypeVar('ConfigDataT', bound='ConfigData')
|
|
142
143
|
# ../../omlish/http/parsing.py
|
143
144
|
HttpHeaders = http.client.HTTPMessage # ta.TypeAlias
|
144
145
|
|
145
|
-
# ../../omlish/lite/contextmanagers.py
|
146
|
-
ExitStackedT = ta.TypeVar('ExitStackedT', bound='ExitStacked')
|
147
|
-
AsyncExitStackedT = ta.TypeVar('AsyncExitStackedT', bound='AsyncExitStacked')
|
148
|
-
|
149
146
|
# ../../omlish/lite/inject.py
|
150
147
|
U = ta.TypeVar('U')
|
151
148
|
InjectorKeyCls = ta.Union[type, ta.NewType]
|
@@ -154,10 +151,11 @@ InjectorProviderFnMap = ta.Mapping['InjectorKey', 'InjectorProviderFn']
|
|
154
151
|
InjectorBindingOrBindings = ta.Union['InjectorBinding', 'InjectorBindings']
|
155
152
|
|
156
153
|
# ../../omlish/sockets/handlers.py
|
157
|
-
|
154
|
+
SocketHandler = ta.Callable[[SocketAddress, 'SocketIoPair'], None] # ta.TypeAlias
|
158
155
|
|
159
156
|
# ../../omlish/http/handlers.py
|
160
157
|
HttpHandler = ta.Callable[['HttpHandlerRequest'], 'HttpHandlerResponse'] # ta.TypeAlias
|
158
|
+
HttpHandlerResponseData = ta.Union[bytes, 'HttpHandlerResponseStreamedData'] # ta.TypeAlias # noqa
|
161
159
|
|
162
160
|
# ../../omlish/http/coro/server.py
|
163
161
|
CoroHttpServerFactory = ta.Callable[[SocketAddress], 'CoroHttpServer']
|
@@ -2812,8 +2810,7 @@ class ProxyLogHandler(ProxyLogFilterer, logging.Handler):
|
|
2812
2810
|
# ../../../omlish/sockets/addresses.py
|
2813
2811
|
"""
|
2814
2812
|
TODO:
|
2815
|
-
-
|
2816
|
-
+ codification of https://docs.python.org/3/library/socket.html#socket-families
|
2813
|
+
- codification of https://docs.python.org/3/library/socket.html#socket-families
|
2817
2814
|
"""
|
2818
2815
|
|
2819
2816
|
|
@@ -2824,37 +2821,127 @@ TODO:
|
|
2824
2821
|
class SocketAddressInfoArgs:
|
2825
2822
|
host: ta.Optional[str]
|
2826
2823
|
port: ta.Union[str, int, None]
|
2827
|
-
family:
|
2824
|
+
family: socket_.AddressFamily = socket_.AddressFamily.AF_UNSPEC
|
2828
2825
|
type: int = 0
|
2829
2826
|
proto: int = 0
|
2830
|
-
flags:
|
2827
|
+
flags: socket_.AddressInfo = socket_.AddressInfo(0)
|
2831
2828
|
|
2832
2829
|
|
2833
2830
|
@dc.dataclass(frozen=True)
|
2834
2831
|
class SocketAddressInfo:
|
2835
|
-
family:
|
2832
|
+
family: socket_.AddressFamily
|
2836
2833
|
type: int
|
2837
2834
|
proto: int
|
2838
2835
|
canonname: ta.Optional[str]
|
2839
2836
|
sockaddr: SocketAddress
|
2840
2837
|
|
2841
2838
|
|
2839
|
+
class SocketFamilyAndAddress(ta.NamedTuple):
|
2840
|
+
family: socket_.AddressFamily
|
2841
|
+
address: SocketAddress
|
2842
|
+
|
2843
|
+
|
2842
2844
|
def get_best_socket_family(
|
2843
2845
|
host: ta.Optional[str],
|
2844
2846
|
port: ta.Union[str, int, None],
|
2845
|
-
family: ta.Union[int,
|
2846
|
-
) ->
|
2847
|
+
family: ta.Union[int, socket_.AddressFamily] = socket_.AddressFamily.AF_UNSPEC,
|
2848
|
+
) -> SocketFamilyAndAddress:
|
2847
2849
|
"""https://github.com/python/cpython/commit/f289084c83190cc72db4a70c58f007ec62e75247"""
|
2848
2850
|
|
2849
|
-
infos =
|
2851
|
+
infos = socket_.getaddrinfo(
|
2850
2852
|
host,
|
2851
2853
|
port,
|
2852
2854
|
family,
|
2853
|
-
type=
|
2854
|
-
flags=
|
2855
|
+
type=socket_.SOCK_STREAM,
|
2856
|
+
flags=socket_.AI_PASSIVE,
|
2855
2857
|
)
|
2856
2858
|
ai = SocketAddressInfo(*next(iter(infos)))
|
2857
|
-
return ai.family, ai.sockaddr
|
2859
|
+
return SocketFamilyAndAddress(ai.family, ai.sockaddr)
|
2860
|
+
|
2861
|
+
|
2862
|
+
class SocketAndAddress(ta.NamedTuple):
|
2863
|
+
socket: socket_.socket
|
2864
|
+
address: SocketAddress
|
2865
|
+
|
2866
|
+
def wrap_socket(self, fn: ta.Callable[[socket_.socket], socket_.socket]):
|
2867
|
+
return self._replace(socket=fn(self.socket))
|
2868
|
+
|
2869
|
+
@classmethod
|
2870
|
+
def socket_wrapper(
|
2871
|
+
cls,
|
2872
|
+
fn: ta.Callable[[socket_.socket], socket_.socket],
|
2873
|
+
) -> ta.Callable[['SocketAndAddress'], 'SocketAndAddress']:
|
2874
|
+
def inner(conn):
|
2875
|
+
return conn.wrap_socket(fn)
|
2876
|
+
return inner
|
2877
|
+
|
2878
|
+
|
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()
|
2858
2945
|
|
2859
2946
|
|
2860
2947
|
########################################
|
@@ -4426,116 +4513,6 @@ else:
|
|
4426
4513
|
KqueueFdioPoller = None
|
4427
4514
|
|
4428
4515
|
|
4429
|
-
########################################
|
4430
|
-
# ../../../omlish/lite/contextmanagers.py
|
4431
|
-
|
4432
|
-
|
4433
|
-
##
|
4434
|
-
|
4435
|
-
|
4436
|
-
class ExitStacked:
|
4437
|
-
_exit_stack: ta.Optional[contextlib.ExitStack] = None
|
4438
|
-
|
4439
|
-
def __enter__(self: ExitStackedT) -> ExitStackedT:
|
4440
|
-
check.state(self._exit_stack is None)
|
4441
|
-
es = self._exit_stack = contextlib.ExitStack()
|
4442
|
-
es.__enter__()
|
4443
|
-
return self
|
4444
|
-
|
4445
|
-
def __exit__(self, exc_type, exc_val, exc_tb):
|
4446
|
-
if (es := self._exit_stack) is None:
|
4447
|
-
return None
|
4448
|
-
self._exit_contexts()
|
4449
|
-
return es.__exit__(exc_type, exc_val, exc_tb)
|
4450
|
-
|
4451
|
-
def _exit_contexts(self) -> None:
|
4452
|
-
pass
|
4453
|
-
|
4454
|
-
def _enter_context(self, cm: ta.ContextManager[T]) -> T:
|
4455
|
-
es = check.not_none(self._exit_stack)
|
4456
|
-
return es.enter_context(cm)
|
4457
|
-
|
4458
|
-
|
4459
|
-
class AsyncExitStacked:
|
4460
|
-
_exit_stack: ta.Optional[contextlib.AsyncExitStack] = None
|
4461
|
-
|
4462
|
-
async def __aenter__(self: AsyncExitStackedT) -> AsyncExitStackedT:
|
4463
|
-
check.state(self._exit_stack is None)
|
4464
|
-
es = self._exit_stack = contextlib.AsyncExitStack()
|
4465
|
-
await es.__aenter__()
|
4466
|
-
return self
|
4467
|
-
|
4468
|
-
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
4469
|
-
if (es := self._exit_stack) is None:
|
4470
|
-
return None
|
4471
|
-
await self._async_exit_contexts()
|
4472
|
-
return await es.__aexit__(exc_type, exc_val, exc_tb)
|
4473
|
-
|
4474
|
-
async def _async_exit_contexts(self) -> None:
|
4475
|
-
pass
|
4476
|
-
|
4477
|
-
def _enter_context(self, cm: ta.ContextManager[T]) -> T:
|
4478
|
-
es = check.not_none(self._exit_stack)
|
4479
|
-
return es.enter_context(cm)
|
4480
|
-
|
4481
|
-
async def _enter_async_context(self, cm: ta.AsyncContextManager[T]) -> T:
|
4482
|
-
es = check.not_none(self._exit_stack)
|
4483
|
-
return await es.enter_async_context(cm)
|
4484
|
-
|
4485
|
-
|
4486
|
-
##
|
4487
|
-
|
4488
|
-
|
4489
|
-
@contextlib.contextmanager
|
4490
|
-
def defer(fn: ta.Callable) -> ta.Generator[ta.Callable, None, None]:
|
4491
|
-
try:
|
4492
|
-
yield fn
|
4493
|
-
finally:
|
4494
|
-
fn()
|
4495
|
-
|
4496
|
-
|
4497
|
-
@contextlib.asynccontextmanager
|
4498
|
-
async def adefer(fn: ta.Callable) -> ta.AsyncGenerator[ta.Callable, None]:
|
4499
|
-
try:
|
4500
|
-
yield fn
|
4501
|
-
finally:
|
4502
|
-
await fn()
|
4503
|
-
|
4504
|
-
|
4505
|
-
##
|
4506
|
-
|
4507
|
-
|
4508
|
-
@contextlib.contextmanager
|
4509
|
-
def attr_setting(obj, attr, val, *, default=None): # noqa
|
4510
|
-
not_set = object()
|
4511
|
-
orig = getattr(obj, attr, not_set)
|
4512
|
-
try:
|
4513
|
-
setattr(obj, attr, val)
|
4514
|
-
if orig is not not_set:
|
4515
|
-
yield orig
|
4516
|
-
else:
|
4517
|
-
yield default
|
4518
|
-
finally:
|
4519
|
-
if orig is not_set:
|
4520
|
-
delattr(obj, attr)
|
4521
|
-
else:
|
4522
|
-
setattr(obj, attr, orig)
|
4523
|
-
|
4524
|
-
|
4525
|
-
##
|
4526
|
-
|
4527
|
-
|
4528
|
-
class aclosing(contextlib.AbstractAsyncContextManager): # noqa
|
4529
|
-
def __init__(self, thing):
|
4530
|
-
self.thing = thing
|
4531
|
-
|
4532
|
-
async def __aenter__(self):
|
4533
|
-
return self.thing
|
4534
|
-
|
4535
|
-
async def __aexit__(self, *exc_info):
|
4536
|
-
await self.thing.aclose()
|
4537
|
-
|
4538
|
-
|
4539
4516
|
########################################
|
4540
4517
|
# ../../../omlish/lite/inject.py
|
4541
4518
|
|
@@ -6427,21 +6404,9 @@ def journald_log_handler_factory(
|
|
6427
6404
|
##
|
6428
6405
|
|
6429
6406
|
|
6430
|
-
class
|
6431
|
-
def __init__(
|
6432
|
-
self,
|
6433
|
-
client_address: SocketAddress,
|
6434
|
-
rfile: ta.BinaryIO,
|
6435
|
-
wfile: ta.BinaryIO,
|
6436
|
-
) -> None:
|
6437
|
-
super().__init__()
|
6438
|
-
|
6439
|
-
self._client_address = client_address
|
6440
|
-
self._rfile = rfile
|
6441
|
-
self._wfile = wfile
|
6442
|
-
|
6407
|
+
class SocketHandler_(abc.ABC): # noqa
|
6443
6408
|
@abc.abstractmethod
|
6444
|
-
def
|
6409
|
+
def __call__(self, addr: SocketAddress, f: SocketIoPair) -> None:
|
6445
6410
|
raise NotImplementedError
|
6446
6411
|
|
6447
6412
|
|
@@ -6865,6 +6830,9 @@ class SupervisorSetup(abc.ABC):
|
|
6865
6830
|
# ../../../omlish/http/handlers.py
|
6866
6831
|
|
6867
6832
|
|
6833
|
+
##
|
6834
|
+
|
6835
|
+
|
6868
6836
|
@dc.dataclass(frozen=True)
|
6869
6837
|
class HttpHandlerRequest:
|
6870
6838
|
client_address: SocketAddress
|
@@ -6879,10 +6847,16 @@ class HttpHandlerResponse:
|
|
6879
6847
|
status: ta.Union[http.HTTPStatus, int]
|
6880
6848
|
|
6881
6849
|
headers: ta.Optional[ta.Mapping[str, str]] = None
|
6882
|
-
data: ta.Optional[
|
6850
|
+
data: ta.Optional[HttpHandlerResponseData] = None
|
6883
6851
|
close_connection: ta.Optional[bool] = None
|
6884
6852
|
|
6885
6853
|
|
6854
|
+
@dc.dataclass(frozen=True)
|
6855
|
+
class HttpHandlerResponseStreamedData:
|
6856
|
+
iter: ta.Iterable[bytes]
|
6857
|
+
length: ta.Optional[int] = None
|
6858
|
+
|
6859
|
+
|
6886
6860
|
class HttpHandlerError(Exception):
|
6887
6861
|
pass
|
6888
6862
|
|
@@ -6891,6 +6865,12 @@ class UnsupportedMethodHttpHandlerError(Exception):
|
|
6891
6865
|
pass
|
6892
6866
|
|
6893
6867
|
|
6868
|
+
class HttpHandler_(abc.ABC): # noqa
|
6869
|
+
@abc.abstractmethod
|
6870
|
+
def __call__(self, req: HttpHandlerRequest) -> HttpHandlerResponse:
|
6871
|
+
raise NotImplementedError
|
6872
|
+
|
6873
|
+
|
6894
6874
|
########################################
|
6895
6875
|
# ../../../omlish/lite/configs.py
|
6896
6876
|
|
@@ -7394,7 +7374,7 @@ class CoroHttpServer:
|
|
7394
7374
|
|
7395
7375
|
message: ta.Optional[str] = None
|
7396
7376
|
headers: ta.Optional[ta.Sequence['CoroHttpServer._Header']] = None
|
7397
|
-
data: ta.Optional[
|
7377
|
+
data: ta.Optional[HttpHandlerResponseData] = None
|
7398
7378
|
close_connection: ta.Optional[bool] = False
|
7399
7379
|
|
7400
7380
|
def get_header(self, key: str) -> ta.Optional['CoroHttpServer._Header']:
|
@@ -7405,7 +7385,7 @@ class CoroHttpServer:
|
|
7405
7385
|
|
7406
7386
|
#
|
7407
7387
|
|
7408
|
-
def
|
7388
|
+
def _build_response_head_bytes(self, a: _Response) -> bytes:
|
7409
7389
|
out = io.BytesIO()
|
7410
7390
|
|
7411
7391
|
if a.version >= HttpProtocolVersions.HTTP_1_0:
|
@@ -7420,11 +7400,22 @@ class CoroHttpServer:
|
|
7420
7400
|
|
7421
7401
|
out.write(b'\r\n')
|
7422
7402
|
|
7423
|
-
if a.data is not None:
|
7424
|
-
out.write(a.data)
|
7425
|
-
|
7426
7403
|
return out.getvalue()
|
7427
7404
|
|
7405
|
+
def _yield_response_data(self, a: _Response) -> ta.Iterator[bytes]:
|
7406
|
+
if a.data is None:
|
7407
|
+
return
|
7408
|
+
|
7409
|
+
elif isinstance(a.data, bytes):
|
7410
|
+
yield a.data
|
7411
|
+
return
|
7412
|
+
|
7413
|
+
elif isinstance(a.data, HttpHandlerResponseStreamedData):
|
7414
|
+
yield from a.data.iter
|
7415
|
+
|
7416
|
+
else:
|
7417
|
+
raise TypeError(a.data)
|
7418
|
+
|
7428
7419
|
#
|
7429
7420
|
|
7430
7421
|
DEFAULT_CONTENT_TYPE = 'text/plain'
|
@@ -7435,8 +7426,17 @@ class CoroHttpServer:
|
|
7435
7426
|
|
7436
7427
|
if resp.get_header('Content-Type') is None:
|
7437
7428
|
nh.append(self._Header('Content-Type', self._default_content_type))
|
7429
|
+
|
7438
7430
|
if resp.data is not None and resp.get_header('Content-Length') is None:
|
7439
|
-
|
7431
|
+
cl: ta.Optional[int]
|
7432
|
+
if isinstance(resp.data, bytes):
|
7433
|
+
cl = len(resp.data)
|
7434
|
+
elif isinstance(resp.data, HttpHandlerResponseStreamedData):
|
7435
|
+
cl = resp.data.length
|
7436
|
+
else:
|
7437
|
+
raise TypeError(resp.data)
|
7438
|
+
if cl is not None:
|
7439
|
+
nh.append(self._Header('Content-Length', str(cl)))
|
7440
7440
|
|
7441
7441
|
if nh:
|
7442
7442
|
kw.update(headers=[*(resp.headers or []), *nh])
|
@@ -7610,9 +7610,13 @@ class CoroHttpServer:
|
|
7610
7610
|
|
7611
7611
|
elif isinstance(o, self._Response):
|
7612
7612
|
i = None
|
7613
|
+
|
7613
7614
|
r = self._preprocess_response(o)
|
7614
|
-
|
7615
|
-
check.none((yield self.WriteIo(
|
7615
|
+
hb = self._build_response_head_bytes(r)
|
7616
|
+
check.none((yield self.WriteIo(hb)))
|
7617
|
+
|
7618
|
+
for b in self._yield_response_data(r):
|
7619
|
+
yield self.WriteIo(b)
|
7616
7620
|
|
7617
7621
|
else:
|
7618
7622
|
raise TypeError(o)
|
@@ -7731,27 +7735,20 @@ class CoroHttpServer:
|
|
7731
7735
|
##
|
7732
7736
|
|
7733
7737
|
|
7734
|
-
class CoroHttpServerSocketHandler(
|
7738
|
+
class CoroHttpServerSocketHandler(SocketHandler_):
|
7735
7739
|
def __init__(
|
7736
7740
|
self,
|
7737
|
-
client_address: SocketAddress,
|
7738
|
-
rfile: ta.BinaryIO,
|
7739
|
-
wfile: ta.BinaryIO,
|
7740
|
-
*,
|
7741
7741
|
server_factory: CoroHttpServerFactory,
|
7742
|
+
*,
|
7742
7743
|
log_handler: ta.Optional[ta.Callable[[CoroHttpServer, CoroHttpServer.AnyLogIo], None]] = None,
|
7743
7744
|
) -> None:
|
7744
|
-
super().__init__(
|
7745
|
-
client_address,
|
7746
|
-
rfile,
|
7747
|
-
wfile,
|
7748
|
-
)
|
7745
|
+
super().__init__()
|
7749
7746
|
|
7750
7747
|
self._server_factory = server_factory
|
7751
7748
|
self._log_handler = log_handler
|
7752
7749
|
|
7753
|
-
def
|
7754
|
-
server = self._server_factory(
|
7750
|
+
def __call__(self, client_address: SocketAddress, fp: SocketIoPair) -> None:
|
7751
|
+
server = self._server_factory(client_address)
|
7755
7752
|
|
7756
7753
|
gen = server.coro_handle()
|
7757
7754
|
|
@@ -7763,15 +7760,15 @@ class CoroHttpServerSocketHandler(SocketHandler):
|
|
7763
7760
|
self._log_handler(server, o)
|
7764
7761
|
|
7765
7762
|
elif isinstance(o, CoroHttpServer.ReadIo):
|
7766
|
-
i =
|
7763
|
+
i = fp.r.read(o.sz)
|
7767
7764
|
|
7768
7765
|
elif isinstance(o, CoroHttpServer.ReadLineIo):
|
7769
|
-
i =
|
7766
|
+
i = fp.r.readline(o.sz)
|
7770
7767
|
|
7771
7768
|
elif isinstance(o, CoroHttpServer.WriteIo):
|
7772
7769
|
i = None
|
7773
|
-
|
7774
|
-
|
7770
|
+
fp.w.write(o.data)
|
7771
|
+
fp.w.flush()
|
7775
7772
|
|
7776
7773
|
else:
|
7777
7774
|
raise TypeError(o)
|
@@ -8877,7 +8874,7 @@ class HttpServer(HasDispatchers):
|
|
8877
8874
|
|
8878
8875
|
self._conns: ta.List[CoroHttpServerConnectionFdioHandler] = []
|
8879
8876
|
|
8880
|
-
exit_stack.
|
8877
|
+
exit_stack.callback(self._server.close)
|
8881
8878
|
|
8882
8879
|
def get_dispatchers(self) -> Dispatchers:
|
8883
8880
|
l = []
|
ominfra/supervisor/http.py
CHANGED
@@ -10,7 +10,6 @@ from omlish.http.handlers import HttpHandlerRequest
|
|
10
10
|
from omlish.http.handlers import HttpHandlerResponse
|
11
11
|
from omlish.io.fdio.handlers import SocketFdioHandler
|
12
12
|
from omlish.lite.check import check
|
13
|
-
from omlish.lite.contextmanagers import defer
|
14
13
|
from omlish.lite.json import JSON_PRETTY_KWARGS
|
15
14
|
from omlish.sockets.addresses import SocketAddress
|
16
15
|
|
@@ -73,7 +72,7 @@ class HttpServer(HasDispatchers):
|
|
73
72
|
|
74
73
|
self._conns: ta.List[CoroHttpServerConnectionFdioHandler] = []
|
75
74
|
|
76
|
-
exit_stack.
|
75
|
+
exit_stack.callback(self._server.close)
|
77
76
|
|
78
77
|
def get_dispatchers(self) -> Dispatchers:
|
79
78
|
l = []
|
ominfra/tools/listresources.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev219
|
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.dev219
|
16
|
+
Requires-Dist: omlish==0.0.0.dev219
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -16,7 +16,7 @@ ominfra/clouds/aws/instancetypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
|
|
16
16
|
ominfra/clouds/aws/instancetypes/__main__.py,sha256=Jsrv3P7LX2Cg08W7ByZfZ1JQT4lgLDPW1qNAmShFuMk,75
|
17
17
|
ominfra/clouds/aws/instancetypes/cache.json.gz,sha256=JGgZlMGh2nLPsFmn3PwtV5gO5UMWrjFSFnhniGZKbJc,26375
|
18
18
|
ominfra/clouds/aws/instancetypes/cache.py,sha256=CrfBzOb0DqQhf3ahQS6qQHHH1kVgZyniYOl22RTvjwo,333
|
19
|
-
ominfra/clouds/aws/instancetypes/cli.py,sha256=
|
19
|
+
ominfra/clouds/aws/instancetypes/cli.py,sha256=HcfOchROLGFsxmEIuXtXVywFJWjHOk4yvCKrbZFWVGQ,2195
|
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
|
@@ -114,7 +114,7 @@ ominfra/manage/targets/targets.py,sha256=7GP6UAZyJFEhpkJN6UQdpr_WN3p7C76v-s445y-
|
|
114
114
|
ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
115
115
|
ominfra/scripts/journald2aws.py,sha256=CM1nZMpecXJpcg7icJUCJ-_DX-7CduQurxZQ7EmhQmA,171450
|
116
116
|
ominfra/scripts/manage.py,sha256=MaUur1_dDdMHt5YnE6Waxa_v70kydHzKCBHXAuTmKd0,362827
|
117
|
-
ominfra/scripts/supervisor.py,sha256=
|
117
|
+
ominfra/scripts/supervisor.py,sha256=W_8YHq0Cf5AF88_MBwnZVodxXdQ5AE0zAeafvYMRYFg,295380
|
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
|
@@ -125,7 +125,7 @@ ominfra/supervisor/events.py,sha256=XGrtzHr1xm0dwjz329fn9eR0_Ap-LQL6Sk8LJ8eVDEo,
|
|
125
125
|
ominfra/supervisor/exceptions.py,sha256=Qbu211H3CLlSmi9LsSikOwrcL5HgJP9ugvcKWlGTAoI,750
|
126
126
|
ominfra/supervisor/groups.py,sha256=MBbsbt8Zh_WEYkGOr1KXa82gnPVw9wPB2lAnqhugXSc,2457
|
127
127
|
ominfra/supervisor/groupsimpl.py,sha256=PCDyc_Wc-pnvIj56_aEyiA5exCpK6n9iErqnJzO2rZk,2281
|
128
|
-
ominfra/supervisor/http.py,sha256=
|
128
|
+
ominfra/supervisor/http.py,sha256=P7afN223jeR_g36bPK-cWulnJo1wAeFUBWAaMKPycmw,3387
|
129
129
|
ominfra/supervisor/inject.py,sha256=IeR-WKvK1sGNxMe6G2OBT5kSP7EUP5ipkDgcUFmDPCA,4838
|
130
130
|
ominfra/supervisor/io.py,sha256=moaGNaPuYXEAUzLg8Qjo05DEIcOUNYUj8SSr8eT0d24,3198
|
131
131
|
ominfra/supervisor/main.py,sha256=zCVuHZG2kGIPHwTLH4EUr5xpN4vJYessmKO2P0NE5RU,4381
|
@@ -155,10 +155,10 @@ ominfra/tailscale/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
155
155
|
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
|
-
ominfra/tools/listresources.py,sha256=
|
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.
|
158
|
+
ominfra/tools/listresources.py,sha256=BxFoxtyF2aVEcW67ZD9QujoBkJBtvIxGmKqXvLwnEHo,6180
|
159
|
+
ominfra-0.0.0.dev219.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
160
|
+
ominfra-0.0.0.dev219.dist-info/METADATA,sha256=E0e_wKkjHZleJ28wnBhOjkR8ooXakDMT7XoBxkebkto,731
|
161
|
+
ominfra-0.0.0.dev219.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
162
|
+
ominfra-0.0.0.dev219.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
163
|
+
ominfra-0.0.0.dev219.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
164
|
+
ominfra-0.0.0.dev219.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|