ominfra 0.0.0.dev315__py3-none-any.whl → 0.0.0.dev316__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/models/services/ec2.py +1 -0
- ominfra/scripts/journald2aws.py +14 -1
- ominfra/scripts/manage.py +176 -19
- ominfra/scripts/supervisor.py +177 -19
- {ominfra-0.0.0.dev315.dist-info → ominfra-0.0.0.dev316.dist-info}/METADATA +3 -3
- {ominfra-0.0.0.dev315.dist-info → ominfra-0.0.0.dev316.dist-info}/RECORD +10 -10
- {ominfra-0.0.0.dev315.dist-info → ominfra-0.0.0.dev316.dist-info}/WHEEL +0 -0
- {ominfra-0.0.0.dev315.dist-info → ominfra-0.0.0.dev316.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev315.dist-info → ominfra-0.0.0.dev316.dist-info}/licenses/LICENSE +0 -0
- {ominfra-0.0.0.dev315.dist-info → ominfra-0.0.0.dev316.dist-info}/top_level.txt +0 -0
@@ -1498,6 +1498,7 @@ class ResourceType(_enum.Enum):
|
|
1498
1498
|
INSTANCE_CONNECT_ENDPOINT = 'instance-connect-endpoint'
|
1499
1499
|
VERIFIED_ACCESS_ENDPOINT_TARGET = 'verified-access-endpoint-target'
|
1500
1500
|
IPAM_EXTERNAL_RESOURCE_VERIFICATION_TOKEN = 'ipam-external-resource-verification-token'
|
1501
|
+
MAC_MODIFICATION_TASK = 'mac-modification-task'
|
1501
1502
|
|
1502
1503
|
|
1503
1504
|
class RootDeviceType(_enum.Enum):
|
ominfra/scripts/journald2aws.py
CHANGED
@@ -1955,9 +1955,16 @@ def format_num_bytes(num_bytes: int) -> str:
|
|
1955
1955
|
# ../../../../../omlish/logs/filters.py
|
1956
1956
|
|
1957
1957
|
|
1958
|
+
##
|
1959
|
+
|
1960
|
+
|
1958
1961
|
class TidLogFilter(logging.Filter):
|
1959
1962
|
def filter(self, record):
|
1960
|
-
|
1963
|
+
# FIXME: handle better - missing from wasm and cosmos
|
1964
|
+
if hasattr(threading, 'get_native_id'):
|
1965
|
+
record.tid = threading.get_native_id()
|
1966
|
+
else:
|
1967
|
+
record.tid = '?'
|
1961
1968
|
return True
|
1962
1969
|
|
1963
1970
|
|
@@ -1965,6 +1972,9 @@ class TidLogFilter(logging.Filter):
|
|
1965
1972
|
# ../../../../../omlish/logs/proxy.py
|
1966
1973
|
|
1967
1974
|
|
1975
|
+
##
|
1976
|
+
|
1977
|
+
|
1968
1978
|
class ProxyLogFilterer(logging.Filterer):
|
1969
1979
|
def __init__(self, underlying: logging.Filterer) -> None: # noqa
|
1970
1980
|
self._underlying = underlying
|
@@ -4022,6 +4032,9 @@ TODO:
|
|
4022
4032
|
"""
|
4023
4033
|
|
4024
4034
|
|
4035
|
+
##
|
4036
|
+
|
4037
|
+
|
4025
4038
|
class JsonLogFormatter(logging.Formatter):
|
4026
4039
|
KEYS: ta.Mapping[str, bool] = {
|
4027
4040
|
'name': False,
|
ominfra/scripts/manage.py
CHANGED
@@ -102,6 +102,9 @@ CheckOnRaiseFn = ta.Callable[[Exception], None] # ta.TypeAlias
|
|
102
102
|
CheckExceptionFactory = ta.Callable[..., Exception] # ta.TypeAlias
|
103
103
|
CheckArgsRenderer = ta.Callable[..., ta.Optional[str]] # ta.TypeAlias
|
104
104
|
|
105
|
+
# ../../omlish/lite/maybes.py
|
106
|
+
U = ta.TypeVar('U')
|
107
|
+
|
105
108
|
# ../../omlish/lite/timeouts.py
|
106
109
|
TimeoutLike = ta.Union['Timeout', ta.Type['Timeout.DEFAULT'], ta.Iterable['TimeoutLike'], float, None] # ta.TypeAlias
|
107
110
|
|
@@ -133,7 +136,6 @@ ExitStackedT = ta.TypeVar('ExitStackedT', bound='ExitStacked')
|
|
133
136
|
AsyncExitStackedT = ta.TypeVar('AsyncExitStackedT', bound='AsyncExitStacked')
|
134
137
|
|
135
138
|
# ../../omlish/lite/inject.py
|
136
|
-
U = ta.TypeVar('U')
|
137
139
|
InjectorKeyCls = ta.Union[type, ta.NewType]
|
138
140
|
InjectorProviderFn = ta.Callable[['Injector'], ta.Any]
|
139
141
|
InjectorProviderFnMap = ta.Mapping['InjectorKey', 'InjectorProviderFn']
|
@@ -3011,7 +3013,13 @@ log = logging.getLogger(__name__)
|
|
3011
3013
|
##
|
3012
3014
|
|
3013
3015
|
|
3016
|
+
@functools.total_ordering
|
3014
3017
|
class Maybe(ta.Generic[T]):
|
3018
|
+
class ValueNotPresentError(BaseException):
|
3019
|
+
pass
|
3020
|
+
|
3021
|
+
#
|
3022
|
+
|
3015
3023
|
@property
|
3016
3024
|
@abc.abstractmethod
|
3017
3025
|
def present(self) -> bool:
|
@@ -3021,9 +3029,102 @@ class Maybe(ta.Generic[T]):
|
|
3021
3029
|
def must(self) -> T:
|
3022
3030
|
raise NotImplementedError
|
3023
3031
|
|
3032
|
+
#
|
3033
|
+
|
3034
|
+
@abc.abstractmethod
|
3035
|
+
def __repr__(self) -> str:
|
3036
|
+
raise NotImplementedError
|
3037
|
+
|
3038
|
+
@abc.abstractmethod
|
3039
|
+
def __hash__(self) -> int:
|
3040
|
+
raise NotImplementedError
|
3041
|
+
|
3042
|
+
@abc.abstractmethod
|
3043
|
+
def __eq__(self, other) -> bool:
|
3044
|
+
raise NotImplementedError
|
3045
|
+
|
3046
|
+
@abc.abstractmethod
|
3047
|
+
def __lt__(self, other) -> bool:
|
3048
|
+
raise NotImplementedError
|
3049
|
+
|
3050
|
+
#
|
3051
|
+
|
3052
|
+
@ta.final
|
3053
|
+
def __ne__(self, other):
|
3054
|
+
return not (self == other)
|
3055
|
+
|
3056
|
+
@ta.final
|
3057
|
+
def __iter__(self) -> ta.Iterator[T]:
|
3058
|
+
if self.present:
|
3059
|
+
yield self.must()
|
3060
|
+
|
3061
|
+
@ta.final
|
3062
|
+
def __bool__(self) -> ta.NoReturn:
|
3063
|
+
raise TypeError
|
3064
|
+
|
3065
|
+
#
|
3066
|
+
|
3067
|
+
@ta.final
|
3068
|
+
def if_present(self, consumer: ta.Callable[[T], None]) -> None:
|
3069
|
+
if self.present:
|
3070
|
+
consumer(self.must())
|
3071
|
+
|
3072
|
+
@ta.final
|
3073
|
+
def filter(self, predicate: ta.Callable[[T], bool]) -> 'Maybe[T]':
|
3074
|
+
if self.present and predicate(self.must()):
|
3075
|
+
return self
|
3076
|
+
else:
|
3077
|
+
return Maybe.empty()
|
3078
|
+
|
3079
|
+
@ta.final
|
3080
|
+
def map(self, mapper: ta.Callable[[T], U]) -> 'Maybe[U]':
|
3081
|
+
if self.present:
|
3082
|
+
return Maybe.just(mapper(self.must()))
|
3083
|
+
else:
|
3084
|
+
return Maybe.empty()
|
3085
|
+
|
3086
|
+
@ta.final
|
3087
|
+
def flat_map(self, mapper: ta.Callable[[T], 'Maybe[U]']) -> 'Maybe[U]':
|
3088
|
+
if self.present:
|
3089
|
+
if not isinstance(v := mapper(self.must()), Maybe):
|
3090
|
+
raise TypeError(v)
|
3091
|
+
return v
|
3092
|
+
else:
|
3093
|
+
return Maybe.empty()
|
3094
|
+
|
3095
|
+
@ta.final
|
3096
|
+
def or_else(self, other: ta.Union[T, U]) -> ta.Union[T, U]:
|
3097
|
+
if self.present:
|
3098
|
+
return self.must()
|
3099
|
+
else:
|
3100
|
+
return other
|
3101
|
+
|
3102
|
+
@ta.final
|
3103
|
+
def or_else_get(self, supplier: ta.Callable[[], ta.Union[T, U]]) -> ta.Union[T, U]:
|
3104
|
+
if self.present:
|
3105
|
+
return self.must()
|
3106
|
+
else:
|
3107
|
+
return supplier()
|
3108
|
+
|
3109
|
+
@ta.final
|
3110
|
+
def or_else_raise(self, exception_supplier: ta.Callable[[], Exception]) -> T:
|
3111
|
+
if self.present:
|
3112
|
+
return self.must()
|
3113
|
+
else:
|
3114
|
+
raise exception_supplier()
|
3115
|
+
|
3116
|
+
#
|
3117
|
+
|
3118
|
+
@classmethod
|
3119
|
+
def of_optional(cls, v: ta.Optional[T]) -> 'Maybe[T]':
|
3120
|
+
if v is not None:
|
3121
|
+
return cls.just(v)
|
3122
|
+
else:
|
3123
|
+
return cls.empty()
|
3124
|
+
|
3024
3125
|
@classmethod
|
3025
3126
|
def just(cls, v: T) -> 'Maybe[T]':
|
3026
|
-
return
|
3127
|
+
return _JustMaybe(v)
|
3027
3128
|
|
3028
3129
|
_empty: ta.ClassVar['Maybe']
|
3029
3130
|
|
@@ -3032,36 +3133,79 @@ class Maybe(ta.Generic[T]):
|
|
3032
3133
|
return Maybe._empty
|
3033
3134
|
|
3034
3135
|
|
3035
|
-
|
3036
|
-
__slots__ = ()
|
3136
|
+
##
|
3037
3137
|
|
3038
|
-
|
3039
|
-
|
3138
|
+
|
3139
|
+
class _Maybe(Maybe[T], abc.ABC):
|
3140
|
+
def __lt__(self, other):
|
3141
|
+
if not isinstance(other, _Maybe):
|
3142
|
+
return NotImplemented
|
3143
|
+
sp = self.present
|
3144
|
+
op = other.present
|
3145
|
+
if self.present and other.present:
|
3146
|
+
return self.must() < other.must()
|
3147
|
+
else:
|
3148
|
+
return op and not sp
|
3149
|
+
|
3150
|
+
|
3151
|
+
class _JustMaybe(_Maybe[T]):
|
3152
|
+
__slots__ = ('_v', '_hash')
|
3153
|
+
|
3154
|
+
def __init__(self, v: T) -> None:
|
3155
|
+
super().__init__()
|
3156
|
+
|
3157
|
+
self._v = v
|
3040
3158
|
|
3041
3159
|
@property
|
3042
3160
|
def present(self) -> bool:
|
3043
|
-
return
|
3161
|
+
return True
|
3044
3162
|
|
3045
3163
|
def must(self) -> T:
|
3046
|
-
|
3047
|
-
raise ValueError
|
3048
|
-
return self[0]
|
3164
|
+
return self._v
|
3049
3165
|
|
3166
|
+
#
|
3050
3167
|
|
3051
|
-
|
3168
|
+
def __repr__(self) -> str:
|
3169
|
+
return f'just({self._v!r})'
|
3052
3170
|
|
3171
|
+
def __hash__(self) -> int:
|
3172
|
+
try:
|
3173
|
+
return self._hash # type: ignore[has-type]
|
3174
|
+
except AttributeError:
|
3175
|
+
pass
|
3176
|
+
h = self._hash = hash((_JustMaybe, self._v))
|
3177
|
+
return h
|
3053
3178
|
|
3054
|
-
|
3179
|
+
def __eq__(self, other):
|
3180
|
+
return (
|
3181
|
+
self.__class__ is other.__class__ and
|
3182
|
+
self._v == other._v # noqa
|
3183
|
+
)
|
3184
|
+
|
3185
|
+
|
3186
|
+
class _EmptyMaybe(_Maybe[T]):
|
3187
|
+
__slots__ = ()
|
3188
|
+
|
3189
|
+
@property
|
3190
|
+
def present(self) -> bool:
|
3191
|
+
return False
|
3055
3192
|
|
3193
|
+
def must(self) -> T:
|
3194
|
+
raise Maybe.ValueNotPresentError
|
3056
3195
|
|
3057
|
-
|
3058
|
-
def as_maybe(obj: ta.Any) -> Maybe:
|
3059
|
-
raise TypeError(obj)
|
3196
|
+
#
|
3060
3197
|
|
3198
|
+
def __repr__(self) -> str:
|
3199
|
+
return 'empty()'
|
3061
3200
|
|
3062
|
-
|
3063
|
-
|
3064
|
-
|
3201
|
+
def __hash__(self) -> int:
|
3202
|
+
return hash(_EmptyMaybe)
|
3203
|
+
|
3204
|
+
def __eq__(self, other):
|
3205
|
+
return self.__class__ is other.__class__
|
3206
|
+
|
3207
|
+
|
3208
|
+
Maybe._empty = _EmptyMaybe() # noqa
|
3065
3209
|
|
3066
3210
|
|
3067
3211
|
########################################
|
@@ -3563,9 +3707,16 @@ class Func3(ta.Generic[A0, A1, A2, T]):
|
|
3563
3707
|
# ../../../omlish/logs/filters.py
|
3564
3708
|
|
3565
3709
|
|
3710
|
+
##
|
3711
|
+
|
3712
|
+
|
3566
3713
|
class TidLogFilter(logging.Filter):
|
3567
3714
|
def filter(self, record):
|
3568
|
-
|
3715
|
+
# FIXME: handle better - missing from wasm and cosmos
|
3716
|
+
if hasattr(threading, 'get_native_id'):
|
3717
|
+
record.tid = threading.get_native_id()
|
3718
|
+
else:
|
3719
|
+
record.tid = '?'
|
3569
3720
|
return True
|
3570
3721
|
|
3571
3722
|
|
@@ -3573,6 +3724,9 @@ class TidLogFilter(logging.Filter):
|
|
3573
3724
|
# ../../../omlish/logs/proxy.py
|
3574
3725
|
|
3575
3726
|
|
3727
|
+
##
|
3728
|
+
|
3729
|
+
|
3576
3730
|
class ProxyLogFilterer(logging.Filterer):
|
3577
3731
|
def __init__(self, underlying: logging.Filterer) -> None: # noqa
|
3578
3732
|
self._underlying = underlying
|
@@ -7612,6 +7766,9 @@ TODO:
|
|
7612
7766
|
"""
|
7613
7767
|
|
7614
7768
|
|
7769
|
+
##
|
7770
|
+
|
7771
|
+
|
7615
7772
|
class JsonLogFormatter(logging.Formatter):
|
7616
7773
|
KEYS: ta.Mapping[str, bool] = {
|
7617
7774
|
'name': False,
|
ominfra/scripts/supervisor.py
CHANGED
@@ -57,6 +57,7 @@ import fractions
|
|
57
57
|
import functools
|
58
58
|
import grp
|
59
59
|
import html
|
60
|
+
import http
|
60
61
|
import http.client
|
61
62
|
import http.server
|
62
63
|
import inspect
|
@@ -127,6 +128,9 @@ CheckOnRaiseFn = ta.Callable[[Exception], None] # ta.TypeAlias
|
|
127
128
|
CheckExceptionFactory = ta.Callable[..., Exception] # ta.TypeAlias
|
128
129
|
CheckArgsRenderer = ta.Callable[..., ta.Optional[str]] # ta.TypeAlias
|
129
130
|
|
131
|
+
# ../../omlish/lite/maybes.py
|
132
|
+
U = ta.TypeVar('U')
|
133
|
+
|
130
134
|
# ../../omlish/lite/typing.py
|
131
135
|
A0 = ta.TypeVar('A0')
|
132
136
|
A1 = ta.TypeVar('A1')
|
@@ -146,7 +150,6 @@ ConfigDataT = ta.TypeVar('ConfigDataT', bound='ConfigData')
|
|
146
150
|
HttpHeaders = http.client.HTTPMessage # ta.TypeAlias
|
147
151
|
|
148
152
|
# ../../omlish/lite/inject.py
|
149
|
-
U = ta.TypeVar('U')
|
150
153
|
InjectorKeyCls = ta.Union[type, ta.NewType]
|
151
154
|
InjectorProviderFn = ta.Callable[['Injector'], ta.Any]
|
152
155
|
InjectorProviderFnMap = ta.Mapping['InjectorKey', 'InjectorProviderFn']
|
@@ -2541,7 +2544,13 @@ log = logging.getLogger(__name__)
|
|
2541
2544
|
##
|
2542
2545
|
|
2543
2546
|
|
2547
|
+
@functools.total_ordering
|
2544
2548
|
class Maybe(ta.Generic[T]):
|
2549
|
+
class ValueNotPresentError(BaseException):
|
2550
|
+
pass
|
2551
|
+
|
2552
|
+
#
|
2553
|
+
|
2545
2554
|
@property
|
2546
2555
|
@abc.abstractmethod
|
2547
2556
|
def present(self) -> bool:
|
@@ -2551,9 +2560,102 @@ class Maybe(ta.Generic[T]):
|
|
2551
2560
|
def must(self) -> T:
|
2552
2561
|
raise NotImplementedError
|
2553
2562
|
|
2563
|
+
#
|
2564
|
+
|
2565
|
+
@abc.abstractmethod
|
2566
|
+
def __repr__(self) -> str:
|
2567
|
+
raise NotImplementedError
|
2568
|
+
|
2569
|
+
@abc.abstractmethod
|
2570
|
+
def __hash__(self) -> int:
|
2571
|
+
raise NotImplementedError
|
2572
|
+
|
2573
|
+
@abc.abstractmethod
|
2574
|
+
def __eq__(self, other) -> bool:
|
2575
|
+
raise NotImplementedError
|
2576
|
+
|
2577
|
+
@abc.abstractmethod
|
2578
|
+
def __lt__(self, other) -> bool:
|
2579
|
+
raise NotImplementedError
|
2580
|
+
|
2581
|
+
#
|
2582
|
+
|
2583
|
+
@ta.final
|
2584
|
+
def __ne__(self, other):
|
2585
|
+
return not (self == other)
|
2586
|
+
|
2587
|
+
@ta.final
|
2588
|
+
def __iter__(self) -> ta.Iterator[T]:
|
2589
|
+
if self.present:
|
2590
|
+
yield self.must()
|
2591
|
+
|
2592
|
+
@ta.final
|
2593
|
+
def __bool__(self) -> ta.NoReturn:
|
2594
|
+
raise TypeError
|
2595
|
+
|
2596
|
+
#
|
2597
|
+
|
2598
|
+
@ta.final
|
2599
|
+
def if_present(self, consumer: ta.Callable[[T], None]) -> None:
|
2600
|
+
if self.present:
|
2601
|
+
consumer(self.must())
|
2602
|
+
|
2603
|
+
@ta.final
|
2604
|
+
def filter(self, predicate: ta.Callable[[T], bool]) -> 'Maybe[T]':
|
2605
|
+
if self.present and predicate(self.must()):
|
2606
|
+
return self
|
2607
|
+
else:
|
2608
|
+
return Maybe.empty()
|
2609
|
+
|
2610
|
+
@ta.final
|
2611
|
+
def map(self, mapper: ta.Callable[[T], U]) -> 'Maybe[U]':
|
2612
|
+
if self.present:
|
2613
|
+
return Maybe.just(mapper(self.must()))
|
2614
|
+
else:
|
2615
|
+
return Maybe.empty()
|
2616
|
+
|
2617
|
+
@ta.final
|
2618
|
+
def flat_map(self, mapper: ta.Callable[[T], 'Maybe[U]']) -> 'Maybe[U]':
|
2619
|
+
if self.present:
|
2620
|
+
if not isinstance(v := mapper(self.must()), Maybe):
|
2621
|
+
raise TypeError(v)
|
2622
|
+
return v
|
2623
|
+
else:
|
2624
|
+
return Maybe.empty()
|
2625
|
+
|
2626
|
+
@ta.final
|
2627
|
+
def or_else(self, other: ta.Union[T, U]) -> ta.Union[T, U]:
|
2628
|
+
if self.present:
|
2629
|
+
return self.must()
|
2630
|
+
else:
|
2631
|
+
return other
|
2632
|
+
|
2633
|
+
@ta.final
|
2634
|
+
def or_else_get(self, supplier: ta.Callable[[], ta.Union[T, U]]) -> ta.Union[T, U]:
|
2635
|
+
if self.present:
|
2636
|
+
return self.must()
|
2637
|
+
else:
|
2638
|
+
return supplier()
|
2639
|
+
|
2640
|
+
@ta.final
|
2641
|
+
def or_else_raise(self, exception_supplier: ta.Callable[[], Exception]) -> T:
|
2642
|
+
if self.present:
|
2643
|
+
return self.must()
|
2644
|
+
else:
|
2645
|
+
raise exception_supplier()
|
2646
|
+
|
2647
|
+
#
|
2648
|
+
|
2649
|
+
@classmethod
|
2650
|
+
def of_optional(cls, v: ta.Optional[T]) -> 'Maybe[T]':
|
2651
|
+
if v is not None:
|
2652
|
+
return cls.just(v)
|
2653
|
+
else:
|
2654
|
+
return cls.empty()
|
2655
|
+
|
2554
2656
|
@classmethod
|
2555
2657
|
def just(cls, v: T) -> 'Maybe[T]':
|
2556
|
-
return
|
2658
|
+
return _JustMaybe(v)
|
2557
2659
|
|
2558
2660
|
_empty: ta.ClassVar['Maybe']
|
2559
2661
|
|
@@ -2562,36 +2664,79 @@ class Maybe(ta.Generic[T]):
|
|
2562
2664
|
return Maybe._empty
|
2563
2665
|
|
2564
2666
|
|
2565
|
-
|
2566
|
-
__slots__ = ()
|
2667
|
+
##
|
2567
2668
|
|
2568
|
-
|
2569
|
-
|
2669
|
+
|
2670
|
+
class _Maybe(Maybe[T], abc.ABC):
|
2671
|
+
def __lt__(self, other):
|
2672
|
+
if not isinstance(other, _Maybe):
|
2673
|
+
return NotImplemented
|
2674
|
+
sp = self.present
|
2675
|
+
op = other.present
|
2676
|
+
if self.present and other.present:
|
2677
|
+
return self.must() < other.must()
|
2678
|
+
else:
|
2679
|
+
return op and not sp
|
2680
|
+
|
2681
|
+
|
2682
|
+
class _JustMaybe(_Maybe[T]):
|
2683
|
+
__slots__ = ('_v', '_hash')
|
2684
|
+
|
2685
|
+
def __init__(self, v: T) -> None:
|
2686
|
+
super().__init__()
|
2687
|
+
|
2688
|
+
self._v = v
|
2570
2689
|
|
2571
2690
|
@property
|
2572
2691
|
def present(self) -> bool:
|
2573
|
-
return
|
2692
|
+
return True
|
2574
2693
|
|
2575
2694
|
def must(self) -> T:
|
2576
|
-
|
2577
|
-
raise ValueError
|
2578
|
-
return self[0]
|
2695
|
+
return self._v
|
2579
2696
|
|
2697
|
+
#
|
2580
2698
|
|
2581
|
-
|
2699
|
+
def __repr__(self) -> str:
|
2700
|
+
return f'just({self._v!r})'
|
2582
2701
|
|
2702
|
+
def __hash__(self) -> int:
|
2703
|
+
try:
|
2704
|
+
return self._hash # type: ignore[has-type]
|
2705
|
+
except AttributeError:
|
2706
|
+
pass
|
2707
|
+
h = self._hash = hash((_JustMaybe, self._v))
|
2708
|
+
return h
|
2583
2709
|
|
2584
|
-
|
2710
|
+
def __eq__(self, other):
|
2711
|
+
return (
|
2712
|
+
self.__class__ is other.__class__ and
|
2713
|
+
self._v == other._v # noqa
|
2714
|
+
)
|
2715
|
+
|
2716
|
+
|
2717
|
+
class _EmptyMaybe(_Maybe[T]):
|
2718
|
+
__slots__ = ()
|
2719
|
+
|
2720
|
+
@property
|
2721
|
+
def present(self) -> bool:
|
2722
|
+
return False
|
2585
2723
|
|
2724
|
+
def must(self) -> T:
|
2725
|
+
raise Maybe.ValueNotPresentError
|
2586
2726
|
|
2587
|
-
|
2588
|
-
def as_maybe(obj: ta.Any) -> Maybe:
|
2589
|
-
raise TypeError(obj)
|
2727
|
+
#
|
2590
2728
|
|
2729
|
+
def __repr__(self) -> str:
|
2730
|
+
return 'empty()'
|
2591
2731
|
|
2592
|
-
|
2593
|
-
|
2594
|
-
|
2732
|
+
def __hash__(self) -> int:
|
2733
|
+
return hash(_EmptyMaybe)
|
2734
|
+
|
2735
|
+
def __eq__(self, other):
|
2736
|
+
return self.__class__ is other.__class__
|
2737
|
+
|
2738
|
+
|
2739
|
+
Maybe._empty = _EmptyMaybe() # noqa
|
2595
2740
|
|
2596
2741
|
|
2597
2742
|
########################################
|
@@ -2832,9 +2977,16 @@ class Func3(ta.Generic[A0, A1, A2, T]):
|
|
2832
2977
|
# ../../../omlish/logs/filters.py
|
2833
2978
|
|
2834
2979
|
|
2980
|
+
##
|
2981
|
+
|
2982
|
+
|
2835
2983
|
class TidLogFilter(logging.Filter):
|
2836
2984
|
def filter(self, record):
|
2837
|
-
|
2985
|
+
# FIXME: handle better - missing from wasm and cosmos
|
2986
|
+
if hasattr(threading, 'get_native_id'):
|
2987
|
+
record.tid = threading.get_native_id()
|
2988
|
+
else:
|
2989
|
+
record.tid = '?'
|
2838
2990
|
return True
|
2839
2991
|
|
2840
2992
|
|
@@ -2842,6 +2994,9 @@ class TidLogFilter(logging.Filter):
|
|
2842
2994
|
# ../../../omlish/logs/proxy.py
|
2843
2995
|
|
2844
2996
|
|
2997
|
+
##
|
2998
|
+
|
2999
|
+
|
2845
3000
|
class ProxyLogFilterer(logging.Filterer):
|
2846
3001
|
def __init__(self, underlying: logging.Filterer) -> None: # noqa
|
2847
3002
|
self._underlying = underlying
|
@@ -6357,6 +6512,9 @@ TODO:
|
|
6357
6512
|
"""
|
6358
6513
|
|
6359
6514
|
|
6515
|
+
##
|
6516
|
+
|
6517
|
+
|
6360
6518
|
class JsonLogFormatter(logging.Formatter):
|
6361
6519
|
KEYS: ta.Mapping[str, bool] = {
|
6362
6520
|
'name': False,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev316
|
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.dev316
|
16
|
+
Requires-Dist: omlish==0.0.0.dev316
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.21; extra == "all"
|
@@ -30,7 +30,7 @@ ominfra/clouds/aws/models/gen/__main__.py,sha256=Jsrv3P7LX2Cg08W7ByZfZ1JQT4lgLDP
|
|
30
30
|
ominfra/clouds/aws/models/gen/cli.py,sha256=vcI8_-BOv4f-s_TFAqvnyzvBexZ_9y5akiUEGfioCqA,3857
|
31
31
|
ominfra/clouds/aws/models/gen/gen.py,sha256=4pftOlyEIxDDoe73c5Z7NaJ1uhFsTBnMwmS1nlDiLOE,15903
|
32
32
|
ominfra/clouds/aws/models/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
|
-
ominfra/clouds/aws/models/services/ec2.py,sha256=
|
33
|
+
ominfra/clouds/aws/models/services/ec2.py,sha256=pW0yCA5yyXwErMHtnyZN6ITj6cHVnBM54Cik205-HIg,270137
|
34
34
|
ominfra/clouds/aws/models/services/lambda_.py,sha256=dp2I4ZVDb6Dci15XcjPPURUElyzH8cwhM911J_HM7Qo,25823
|
35
35
|
ominfra/clouds/aws/models/services/rds.py,sha256=cYjqdM3Sm3F0qpxinA8A8ofXi_HZflK3epu_sog7LzQ,59759
|
36
36
|
ominfra/clouds/aws/models/services/s3.py,sha256=bEWMu3oxNDX26RlihLdw_-v_x-cnwR7lQxfwrxKIZyo,51024
|
@@ -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=SnIJej3-Vu9Ui0K1BHw49nbr73SeT4aqHF_zvdH6W6c,171909
|
116
|
+
ominfra/scripts/manage.py,sha256=4usIgYab469W6vCbm84S0pXrSdNTlw6BNyD9c-gYxDY,385609
|
117
|
+
ominfra/scripts/supervisor.py,sha256=QUhVr8fKBelrq8lEXCDIKKCSCjkJAwSMOeUqkYGivn8,303894
|
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=zRV7-tKB7kBah1oTVZlol-vwx1FBlnfzYAPGkeU5jX4,3543
|
157
157
|
ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
158
158
|
ominfra/tools/listresources.py,sha256=auGP1LlbBJSFKUWNvQo_UzA8IsBNZBTMwEkFFRJ4FX4,6185
|
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.dev316.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
160
|
+
ominfra-0.0.0.dev316.dist-info/METADATA,sha256=SscaelEr2d-Tevs3TNdYyOr4Mr8zkv-XPxwAoo8-IY8,753
|
161
|
+
ominfra-0.0.0.dev316.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
162
|
+
ominfra-0.0.0.dev316.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
163
|
+
ominfra-0.0.0.dev316.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
164
|
+
ominfra-0.0.0.dev316.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|