ominfra 0.0.0.dev143__py3-none-any.whl → 0.0.0.dev145__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- ominfra/manage/commands/execution.py +1 -1
- ominfra/manage/commands/inject.py +2 -3
- ominfra/manage/deploy/__init__.py +0 -0
- ominfra/manage/deploy/command.py +23 -0
- ominfra/manage/deploy/inject.py +19 -0
- ominfra/manage/deploy/paths.py +33 -0
- ominfra/manage/inject.py +3 -0
- ominfra/manage/main.py +31 -16
- ominfra/manage/remote/execution.py +2 -1
- ominfra/scripts/journald2aws.py +73 -53
- ominfra/scripts/manage.py +136 -72
- ominfra/scripts/supervisor.py +114 -94
- ominfra/supervisor/dispatchers.py +3 -3
- ominfra/supervisor/http.py +6 -6
- ominfra/supervisor/inject.py +12 -12
- ominfra/supervisor/io.py +2 -2
- ominfra/supervisor/spawningimpl.py +2 -2
- ominfra/supervisor/supervisor.py +2 -2
- ominfra/supervisor/types.py +2 -2
- {ominfra-0.0.0.dev143.dist-info → ominfra-0.0.0.dev145.dist-info}/METADATA +3 -3
- {ominfra-0.0.0.dev143.dist-info → ominfra-0.0.0.dev145.dist-info}/RECORD +25 -21
- {ominfra-0.0.0.dev143.dist-info → ominfra-0.0.0.dev145.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev143.dist-info → ominfra-0.0.0.dev145.dist-info}/WHEEL +0 -0
- {ominfra-0.0.0.dev143.dist-info → ominfra-0.0.0.dev145.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev143.dist-info → ominfra-0.0.0.dev145.dist-info}/top_level.txt +0 -0
ominfra/scripts/manage.py
CHANGED
@@ -2328,23 +2328,24 @@ TODO:
|
|
2328
2328
|
@dc.dataclass(frozen=True)
|
2329
2329
|
class ObjMarshalOptions:
|
2330
2330
|
raw_bytes: bool = False
|
2331
|
+
nonstrict_dataclasses: bool = False
|
2331
2332
|
|
2332
2333
|
|
2333
2334
|
class ObjMarshaler(abc.ABC):
|
2334
2335
|
@abc.abstractmethod
|
2335
|
-
def marshal(self, o: ta.Any,
|
2336
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2336
2337
|
raise NotImplementedError
|
2337
2338
|
|
2338
2339
|
@abc.abstractmethod
|
2339
|
-
def unmarshal(self, o: ta.Any,
|
2340
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2340
2341
|
raise NotImplementedError
|
2341
2342
|
|
2342
2343
|
|
2343
2344
|
class NopObjMarshaler(ObjMarshaler):
|
2344
|
-
def marshal(self, o: ta.Any,
|
2345
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2345
2346
|
return o
|
2346
2347
|
|
2347
|
-
def unmarshal(self, o: ta.Any,
|
2348
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2348
2349
|
return o
|
2349
2350
|
|
2350
2351
|
|
@@ -2352,29 +2353,29 @@ class NopObjMarshaler(ObjMarshaler):
|
|
2352
2353
|
class ProxyObjMarshaler(ObjMarshaler):
|
2353
2354
|
m: ta.Optional[ObjMarshaler] = None
|
2354
2355
|
|
2355
|
-
def marshal(self, o: ta.Any,
|
2356
|
-
return check_not_none(self.m).marshal(o,
|
2356
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2357
|
+
return check_not_none(self.m).marshal(o, ctx)
|
2357
2358
|
|
2358
|
-
def unmarshal(self, o: ta.Any,
|
2359
|
-
return check_not_none(self.m).unmarshal(o,
|
2359
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2360
|
+
return check_not_none(self.m).unmarshal(o, ctx)
|
2360
2361
|
|
2361
2362
|
|
2362
2363
|
@dc.dataclass(frozen=True)
|
2363
2364
|
class CastObjMarshaler(ObjMarshaler):
|
2364
2365
|
ty: type
|
2365
2366
|
|
2366
|
-
def marshal(self, o: ta.Any,
|
2367
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2367
2368
|
return o
|
2368
2369
|
|
2369
|
-
def unmarshal(self, o: ta.Any,
|
2370
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2370
2371
|
return self.ty(o)
|
2371
2372
|
|
2372
2373
|
|
2373
2374
|
class DynamicObjMarshaler(ObjMarshaler):
|
2374
|
-
def marshal(self, o: ta.Any,
|
2375
|
-
return marshal_obj(o)
|
2375
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2376
|
+
return ctx.manager.marshal_obj(o, opts=ctx.options)
|
2376
2377
|
|
2377
|
-
def unmarshal(self, o: ta.Any,
|
2378
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2378
2379
|
return o
|
2379
2380
|
|
2380
2381
|
|
@@ -2382,10 +2383,10 @@ class DynamicObjMarshaler(ObjMarshaler):
|
|
2382
2383
|
class Base64ObjMarshaler(ObjMarshaler):
|
2383
2384
|
ty: type
|
2384
2385
|
|
2385
|
-
def marshal(self, o: ta.Any,
|
2386
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2386
2387
|
return base64.b64encode(o).decode('ascii')
|
2387
2388
|
|
2388
|
-
def unmarshal(self, o: ta.Any,
|
2389
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2389
2390
|
return self.ty(base64.b64decode(o))
|
2390
2391
|
|
2391
2392
|
|
@@ -2393,25 +2394,25 @@ class Base64ObjMarshaler(ObjMarshaler):
|
|
2393
2394
|
class BytesSwitchedObjMarshaler(ObjMarshaler):
|
2394
2395
|
m: ObjMarshaler
|
2395
2396
|
|
2396
|
-
def marshal(self, o: ta.Any,
|
2397
|
-
if
|
2397
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2398
|
+
if ctx.options.raw_bytes:
|
2398
2399
|
return o
|
2399
|
-
return self.m.marshal(o,
|
2400
|
+
return self.m.marshal(o, ctx)
|
2400
2401
|
|
2401
|
-
def unmarshal(self, o: ta.Any,
|
2402
|
-
if
|
2402
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2403
|
+
if ctx.options.raw_bytes:
|
2403
2404
|
return o
|
2404
|
-
return self.m.unmarshal(o,
|
2405
|
+
return self.m.unmarshal(o, ctx)
|
2405
2406
|
|
2406
2407
|
|
2407
2408
|
@dc.dataclass(frozen=True)
|
2408
2409
|
class EnumObjMarshaler(ObjMarshaler):
|
2409
2410
|
ty: type
|
2410
2411
|
|
2411
|
-
def marshal(self, o: ta.Any,
|
2412
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2412
2413
|
return o.name
|
2413
2414
|
|
2414
|
-
def unmarshal(self, o: ta.Any,
|
2415
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2415
2416
|
return self.ty.__members__[o] # type: ignore
|
2416
2417
|
|
2417
2418
|
|
@@ -2419,15 +2420,15 @@ class EnumObjMarshaler(ObjMarshaler):
|
|
2419
2420
|
class OptionalObjMarshaler(ObjMarshaler):
|
2420
2421
|
item: ObjMarshaler
|
2421
2422
|
|
2422
|
-
def marshal(self, o: ta.Any,
|
2423
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2423
2424
|
if o is None:
|
2424
2425
|
return None
|
2425
|
-
return self.item.marshal(o,
|
2426
|
+
return self.item.marshal(o, ctx)
|
2426
2427
|
|
2427
|
-
def unmarshal(self, o: ta.Any,
|
2428
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2428
2429
|
if o is None:
|
2429
2430
|
return None
|
2430
|
-
return self.item.unmarshal(o,
|
2431
|
+
return self.item.unmarshal(o, ctx)
|
2431
2432
|
|
2432
2433
|
|
2433
2434
|
@dc.dataclass(frozen=True)
|
@@ -2436,11 +2437,11 @@ class MappingObjMarshaler(ObjMarshaler):
|
|
2436
2437
|
km: ObjMarshaler
|
2437
2438
|
vm: ObjMarshaler
|
2438
2439
|
|
2439
|
-
def marshal(self, o: ta.Any,
|
2440
|
-
return {self.km.marshal(k,
|
2440
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2441
|
+
return {self.km.marshal(k, ctx): self.vm.marshal(v, ctx) for k, v in o.items()}
|
2441
2442
|
|
2442
|
-
def unmarshal(self, o: ta.Any,
|
2443
|
-
return self.ty((self.km.unmarshal(k,
|
2443
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2444
|
+
return self.ty((self.km.unmarshal(k, ctx), self.vm.unmarshal(v, ctx)) for k, v in o.items())
|
2444
2445
|
|
2445
2446
|
|
2446
2447
|
@dc.dataclass(frozen=True)
|
@@ -2448,11 +2449,11 @@ class IterableObjMarshaler(ObjMarshaler):
|
|
2448
2449
|
ty: type
|
2449
2450
|
item: ObjMarshaler
|
2450
2451
|
|
2451
|
-
def marshal(self, o: ta.Any,
|
2452
|
-
return [self.item.marshal(e,
|
2452
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2453
|
+
return [self.item.marshal(e, ctx) for e in o]
|
2453
2454
|
|
2454
|
-
def unmarshal(self, o: ta.Any,
|
2455
|
-
return self.ty(self.item.unmarshal(e,
|
2455
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2456
|
+
return self.ty(self.item.unmarshal(e, ctx) for e in o)
|
2456
2457
|
|
2457
2458
|
|
2458
2459
|
@dc.dataclass(frozen=True)
|
@@ -2461,11 +2462,18 @@ class DataclassObjMarshaler(ObjMarshaler):
|
|
2461
2462
|
fs: ta.Mapping[str, ObjMarshaler]
|
2462
2463
|
nonstrict: bool = False
|
2463
2464
|
|
2464
|
-
def marshal(self, o: ta.Any,
|
2465
|
-
return {
|
2465
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2466
|
+
return {
|
2467
|
+
k: m.marshal(getattr(o, k), ctx)
|
2468
|
+
for k, m in self.fs.items()
|
2469
|
+
}
|
2466
2470
|
|
2467
|
-
def unmarshal(self, o: ta.Any,
|
2468
|
-
return self.ty(**{
|
2471
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2472
|
+
return self.ty(**{
|
2473
|
+
k: self.fs[k].unmarshal(v, ctx)
|
2474
|
+
for k, v in o.items()
|
2475
|
+
if not (self.nonstrict or ctx.options.nonstrict_dataclasses) or k in self.fs
|
2476
|
+
})
|
2469
2477
|
|
2470
2478
|
|
2471
2479
|
@dc.dataclass(frozen=True)
|
@@ -2485,50 +2493,50 @@ class PolymorphicObjMarshaler(ObjMarshaler):
|
|
2485
2493
|
{i.tag: i for i in impls},
|
2486
2494
|
)
|
2487
2495
|
|
2488
|
-
def marshal(self, o: ta.Any,
|
2496
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2489
2497
|
impl = self.impls_by_ty[type(o)]
|
2490
|
-
return {impl.tag: impl.m.marshal(o,
|
2498
|
+
return {impl.tag: impl.m.marshal(o, ctx)}
|
2491
2499
|
|
2492
|
-
def unmarshal(self, o: ta.Any,
|
2500
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2493
2501
|
[(t, v)] = o.items()
|
2494
2502
|
impl = self.impls_by_tag[t]
|
2495
|
-
return impl.m.unmarshal(v,
|
2503
|
+
return impl.m.unmarshal(v, ctx)
|
2496
2504
|
|
2497
2505
|
|
2498
2506
|
@dc.dataclass(frozen=True)
|
2499
2507
|
class DatetimeObjMarshaler(ObjMarshaler):
|
2500
2508
|
ty: type
|
2501
2509
|
|
2502
|
-
def marshal(self, o: ta.Any,
|
2510
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2503
2511
|
return o.isoformat()
|
2504
2512
|
|
2505
|
-
def unmarshal(self, o: ta.Any,
|
2513
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2506
2514
|
return self.ty.fromisoformat(o) # type: ignore
|
2507
2515
|
|
2508
2516
|
|
2509
2517
|
class DecimalObjMarshaler(ObjMarshaler):
|
2510
|
-
def marshal(self, o: ta.Any,
|
2518
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2511
2519
|
return str(check_isinstance(o, decimal.Decimal))
|
2512
2520
|
|
2513
|
-
def unmarshal(self, v: ta.Any,
|
2521
|
+
def unmarshal(self, v: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2514
2522
|
return decimal.Decimal(check_isinstance(v, str))
|
2515
2523
|
|
2516
2524
|
|
2517
2525
|
class FractionObjMarshaler(ObjMarshaler):
|
2518
|
-
def marshal(self, o: ta.Any,
|
2526
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2519
2527
|
fr = check_isinstance(o, fractions.Fraction)
|
2520
2528
|
return [fr.numerator, fr.denominator]
|
2521
2529
|
|
2522
|
-
def unmarshal(self, v: ta.Any,
|
2530
|
+
def unmarshal(self, v: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2523
2531
|
num, denom = check_isinstance(v, list)
|
2524
2532
|
return fractions.Fraction(num, denom)
|
2525
2533
|
|
2526
2534
|
|
2527
2535
|
class UuidObjMarshaler(ObjMarshaler):
|
2528
|
-
def marshal(self, o: ta.Any,
|
2536
|
+
def marshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2529
2537
|
return str(o)
|
2530
2538
|
|
2531
|
-
def unmarshal(self, o: ta.Any,
|
2539
|
+
def unmarshal(self, o: ta.Any, ctx: 'ObjMarshalContext') -> ta.Any:
|
2532
2540
|
return uuid.UUID(o)
|
2533
2541
|
|
2534
2542
|
|
@@ -2689,6 +2697,12 @@ class ObjMarshalerManager:
|
|
2689
2697
|
|
2690
2698
|
#
|
2691
2699
|
|
2700
|
+
def _make_context(self, opts: ta.Optional[ObjMarshalOptions]) -> 'ObjMarshalContext':
|
2701
|
+
return ObjMarshalContext(
|
2702
|
+
options=opts or self._default_options,
|
2703
|
+
manager=self,
|
2704
|
+
)
|
2705
|
+
|
2692
2706
|
def marshal_obj(
|
2693
2707
|
self,
|
2694
2708
|
o: ta.Any,
|
@@ -2696,7 +2710,7 @@ class ObjMarshalerManager:
|
|
2696
2710
|
opts: ta.Optional[ObjMarshalOptions] = None,
|
2697
2711
|
) -> ta.Any:
|
2698
2712
|
m = self.get_obj_marshaler(ty if ty is not None else type(o))
|
2699
|
-
return m.marshal(o,
|
2713
|
+
return m.marshal(o, self._make_context(opts))
|
2700
2714
|
|
2701
2715
|
def unmarshal_obj(
|
2702
2716
|
self,
|
@@ -2705,7 +2719,7 @@ class ObjMarshalerManager:
|
|
2705
2719
|
opts: ta.Optional[ObjMarshalOptions] = None,
|
2706
2720
|
) -> T:
|
2707
2721
|
m = self.get_obj_marshaler(ty)
|
2708
|
-
return m.unmarshal(o,
|
2722
|
+
return m.unmarshal(o, self._make_context(opts))
|
2709
2723
|
|
2710
2724
|
def roundtrip_obj(
|
2711
2725
|
self,
|
@@ -2720,6 +2734,12 @@ class ObjMarshalerManager:
|
|
2720
2734
|
return u
|
2721
2735
|
|
2722
2736
|
|
2737
|
+
@dc.dataclass(frozen=True)
|
2738
|
+
class ObjMarshalContext:
|
2739
|
+
options: ObjMarshalOptions
|
2740
|
+
manager: ObjMarshalerManager
|
2741
|
+
|
2742
|
+
|
2723
2743
|
##
|
2724
2744
|
|
2725
2745
|
|
@@ -2767,7 +2787,7 @@ class MainBootstrap:
|
|
2767
2787
|
CommandExecutorMap = ta.NewType('CommandExecutorMap', ta.Mapping[ta.Type[Command], CommandExecutor])
|
2768
2788
|
|
2769
2789
|
|
2770
|
-
class
|
2790
|
+
class LocalCommandExecutor(CommandExecutor):
|
2771
2791
|
def __init__(
|
2772
2792
|
self,
|
2773
2793
|
*,
|
@@ -2807,6 +2827,28 @@ def install_command_marshaling(
|
|
2807
2827
|
)
|
2808
2828
|
|
2809
2829
|
|
2830
|
+
########################################
|
2831
|
+
# ../deploy/command.py
|
2832
|
+
|
2833
|
+
|
2834
|
+
##
|
2835
|
+
|
2836
|
+
|
2837
|
+
@dc.dataclass(frozen=True)
|
2838
|
+
class DeployCommand(Command['DeployCommand.Output']):
|
2839
|
+
@dc.dataclass(frozen=True)
|
2840
|
+
class Output(Command.Output):
|
2841
|
+
pass
|
2842
|
+
|
2843
|
+
|
2844
|
+
##
|
2845
|
+
|
2846
|
+
|
2847
|
+
class DeployCommandExecutor(CommandExecutor[DeployCommand, DeployCommand.Output]):
|
2848
|
+
def execute(self, cmd: DeployCommand) -> DeployCommand.Output:
|
2849
|
+
return DeployCommand.Output()
|
2850
|
+
|
2851
|
+
|
2810
2852
|
########################################
|
2811
2853
|
# ../marshal.py
|
2812
2854
|
|
@@ -3242,8 +3284,7 @@ def bind_commands(
|
|
3242
3284
|
lst.extend([
|
3243
3285
|
inj.bind(provide_command_executor_map, singleton=True),
|
3244
3286
|
|
3245
|
-
inj.bind(
|
3246
|
-
inj.bind(CommandExecutor, to_key=CommandExecutionService),
|
3287
|
+
inj.bind(LocalCommandExecutor, singleton=True, eager=main_config.debug),
|
3247
3288
|
])
|
3248
3289
|
|
3249
3290
|
#
|
@@ -3282,7 +3323,7 @@ def _remote_execution_main() -> None:
|
|
3282
3323
|
|
3283
3324
|
chan.set_marshaler(injector[ObjMarshalerManager])
|
3284
3325
|
|
3285
|
-
ce = injector[
|
3326
|
+
ce = injector[LocalCommandExecutor]
|
3286
3327
|
|
3287
3328
|
while True:
|
3288
3329
|
i = chan.recv_obj(Command)
|
@@ -3423,6 +3464,19 @@ class RemoteExecution:
|
|
3423
3464
|
yield RemoteCommandExecutor(chan)
|
3424
3465
|
|
3425
3466
|
|
3467
|
+
########################################
|
3468
|
+
# ../deploy/inject.py
|
3469
|
+
|
3470
|
+
|
3471
|
+
def bind_deploy(
|
3472
|
+
) -> InjectorBindings:
|
3473
|
+
lst: ta.List[InjectorBindingOrBindings] = [
|
3474
|
+
bind_command(DeployCommand, DeployCommandExecutor),
|
3475
|
+
]
|
3476
|
+
|
3477
|
+
return inj.as_bindings(*lst)
|
3478
|
+
|
3479
|
+
|
3426
3480
|
########################################
|
3427
3481
|
# ../remote/inject.py
|
3428
3482
|
|
@@ -3467,6 +3521,8 @@ def bind_main(
|
|
3467
3521
|
bind_remote(
|
3468
3522
|
remote_config=remote_config,
|
3469
3523
|
),
|
3524
|
+
|
3525
|
+
bind_deploy(),
|
3470
3526
|
]
|
3471
3527
|
|
3472
3528
|
#
|
@@ -3530,6 +3586,8 @@ def _main() -> None:
|
|
3530
3586
|
|
3531
3587
|
parser.add_argument('--debug', action='store_true')
|
3532
3588
|
|
3589
|
+
parser.add_argument('--local', action='store_true')
|
3590
|
+
|
3533
3591
|
parser.add_argument('command', nargs='+')
|
3534
3592
|
|
3535
3593
|
args = parser.parse_args()
|
@@ -3560,28 +3618,34 @@ def _main() -> None:
|
|
3560
3618
|
|
3561
3619
|
#
|
3562
3620
|
|
3563
|
-
cmds = [
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3621
|
+
cmds: ta.List[Command] = []
|
3622
|
+
for c in args.command:
|
3623
|
+
if c == 'deploy':
|
3624
|
+
cmds.append(DeployCommand())
|
3625
|
+
else:
|
3626
|
+
cmds.append(SubprocessCommand([c]))
|
3567
3627
|
|
3568
3628
|
#
|
3569
3629
|
|
3570
|
-
|
3571
|
-
|
3572
|
-
shell_quote=args.shell_quote,
|
3573
|
-
python=args.python,
|
3574
|
-
)
|
3630
|
+
with contextlib.ExitStack() as es:
|
3631
|
+
ce: CommandExecutor
|
3575
3632
|
|
3576
|
-
|
3577
|
-
|
3578
|
-
r = rce.try_execute(cmd)
|
3633
|
+
if args.local:
|
3634
|
+
ce = injector[LocalCommandExecutor]
|
3579
3635
|
|
3580
|
-
|
3636
|
+
else:
|
3637
|
+
tgt = RemoteSpawning.Target(
|
3638
|
+
shell=args.shell,
|
3639
|
+
shell_quote=args.shell_quote,
|
3640
|
+
python=args.python,
|
3641
|
+
)
|
3581
3642
|
|
3582
|
-
|
3643
|
+
ce = es.enter_context(injector[RemoteExecution].connect(tgt, bs)) # noqa
|
3583
3644
|
|
3584
|
-
|
3645
|
+
for cmd in cmds:
|
3646
|
+
r = ce.try_execute(cmd)
|
3647
|
+
|
3648
|
+
print(injector[ObjMarshalerManager].marshal_obj(r, opts=ObjMarshalOptions(raw_bytes=True)))
|
3585
3649
|
|
3586
3650
|
|
3587
3651
|
if __name__ == '__main__':
|