eva-shell 0.2.35__tar.gz → 0.2.36__tar.gz
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.
- {eva_shell-0.2.35 → eva_shell-0.2.36}/PKG-INFO +1 -1
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/__init__.py +1 -1
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/ap.py +4 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/cli.py +21 -3
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/client.py +5 -2
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva_shell.egg-info/PKG-INFO +1 -1
- {eva_shell-0.2.35 → eva_shell-0.2.36}/setup.py +1 -1
- {eva_shell-0.2.35 → eva_shell-0.2.36}/LICENSE +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/README.md +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/bin/eva +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/charts.py +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/compl.py +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/sharedobj.py +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/shell.py +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva4_shell/tools.py +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva_shell.egg-info/SOURCES.txt +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva_shell.egg-info/dependency_links.txt +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva_shell.egg-info/requires.txt +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/eva_shell.egg-info/top_level.txt +0 -0
- {eva_shell-0.2.35 → eva_shell-0.2.36}/setup.cfg +0 -0
|
@@ -481,6 +481,10 @@ def append_svc_cli(root_sp):
|
|
|
481
481
|
metavar='FILE',
|
|
482
482
|
help='read call params payload form the file ("-" for stdin)'
|
|
483
483
|
).completer = ComplDeployFile()
|
|
484
|
+
p.add_argument('-o', '--output', metavar='FILE', help='output file')
|
|
485
|
+
p.add_argument('--passthrough',
|
|
486
|
+
action='store_true',
|
|
487
|
+
help='do not unpack the result (requires the output file)')
|
|
484
488
|
p.add_argument('method', metavar='METHOD').completer = ComplSvcRpcMethod()
|
|
485
489
|
p.add_argument(
|
|
486
490
|
'params',
|
|
@@ -669,7 +669,14 @@ class CLI:
|
|
|
669
669
|
call_rpc('svc.purge', dict(svcs=[i]))
|
|
670
670
|
ok()
|
|
671
671
|
|
|
672
|
-
def svc_call(self,
|
|
672
|
+
def svc_call(self,
|
|
673
|
+
i,
|
|
674
|
+
file,
|
|
675
|
+
output,
|
|
676
|
+
passthrough,
|
|
677
|
+
method,
|
|
678
|
+
params,
|
|
679
|
+
trace=False):
|
|
673
680
|
if file:
|
|
674
681
|
import yaml
|
|
675
682
|
payload = yaml.safe_load(read_file(file))
|
|
@@ -678,11 +685,22 @@ class CLI:
|
|
|
678
685
|
for p in params:
|
|
679
686
|
n, v = p.split('=', 1)
|
|
680
687
|
payload[n] = format_value(v, advanced=True, name=n)
|
|
688
|
+
if passthrough and not output:
|
|
689
|
+
raise ValueError(
|
|
690
|
+
'output file is required when passthrought is enabled')
|
|
681
691
|
result = call_rpc(method,
|
|
682
692
|
payload if payload else None,
|
|
683
693
|
target=i,
|
|
684
|
-
trace=trace
|
|
685
|
-
|
|
694
|
+
trace=trace,
|
|
695
|
+
unpack_result=not passthrough)
|
|
696
|
+
if passthrough:
|
|
697
|
+
write_file(output, result, mode='wb')
|
|
698
|
+
ok()
|
|
699
|
+
elif output:
|
|
700
|
+
import json
|
|
701
|
+
write_file(output, json.dumps(result, indent=4, sort_keys=True))
|
|
702
|
+
ok()
|
|
703
|
+
elif current_command.json or isinstance(result, list):
|
|
686
704
|
print_result(result)
|
|
687
705
|
elif isinstance(result, dict):
|
|
688
706
|
print_result(result, name_value=True)
|
|
@@ -19,6 +19,7 @@ DEFAULT_GENERATOR_SERVICE = 'eva.generator.default'
|
|
|
19
19
|
DEFAULT_ACCOUNTING_SERVICE = 'eva.aaa.accounting'
|
|
20
20
|
DEFAULT_ALARM_SERVICE = 'eva.alarm.default'
|
|
21
21
|
|
|
22
|
+
|
|
22
23
|
def print_trace_msg(msg):
|
|
23
24
|
level = msg['l']
|
|
24
25
|
print('[', end='')
|
|
@@ -53,7 +54,7 @@ def connect():
|
|
|
53
54
|
common.rpc.on_frame = on_frame
|
|
54
55
|
|
|
55
56
|
|
|
56
|
-
def call_rpc(method, params=None, target='eva.core', trace=False):
|
|
57
|
+
def call_rpc(method, params=None, target='eva.core', trace=False, unpack_result=True):
|
|
57
58
|
common.bus_conn_no += 1
|
|
58
59
|
connect()
|
|
59
60
|
if current_command.debug:
|
|
@@ -85,5 +86,7 @@ def call_rpc(method, params=None, target='eva.core', trace=False):
|
|
|
85
86
|
print()
|
|
86
87
|
if result.is_empty():
|
|
87
88
|
return None
|
|
88
|
-
|
|
89
|
+
elif unpack_result:
|
|
89
90
|
return unpack(result.get_payload())
|
|
91
|
+
else:
|
|
92
|
+
return result.get_payload()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|