MCPcopy Create free account
hub / github.com/StackStorm/st2 / run_and_print

Method run_and_print

st2client/st2client/commands/pack.py:89–106  ·  view source on GitHub ↗
(self, args, **kwargs)

Source from the content-addressed store, hash-verified

87
88class PackResourceCommand(resource.ResourceCommand):
89 def run_and_print(self, args, **kwargs):
90 try:
91 instance = self.run(args, **kwargs)
92 if not instance:
93 raise resource.ResourceNotFoundError("No matching items found")
94 self.print_output(
95 instance,
96 table.PropertyValueTable,
97 attributes=["all"],
98 json=args.json,
99 yaml=args.yaml,
100 )
101 except resource.ResourceNotFoundError:
102 print("No matching items found")
103 except Exception as e:
104 message = six.text_type(e)
105 print("ERROR: %s" % (message))
106 raise OperationFailureException(message)
107
108
109class PackAsyncCommand(ActionRunCommandMixin, resource.ResourceCommand):

Callers

nothing calls this directly

Calls 3

print_outputMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected