diff --git a/osbuild/api.py b/osbuild/api.py index e9d43227..b431af69 100644 --- a/osbuild/api.py +++ b/osbuild/api.py @@ -202,6 +202,7 @@ class API(BaseAPI): os.close(self._output_pipe) self._output_pipe = None + def exception(e, path="/run/osbuild/api/osbuild"): """Send exception to osbuild""" traceback.print_exception(type(e), e, e.__traceback__, file=sys.stderr) @@ -218,6 +219,7 @@ def exception(e, path="/run/osbuild/api/osbuild"): sys.exit(2) + # pylint: disable=broad-except @contextlib.contextmanager def exception_handler(path="/run/osbuild/api/osbuild"): @@ -226,6 +228,7 @@ def exception_handler(path="/run/osbuild/api/osbuild"): except Exception as e: exception(e, path) + def arguments(path="/run/osbuild/api/osbuild"): """Retrieve the input arguments that were supplied to API""" with jsoncomm.Socket.new_client(path) as client: