From 1b325ef96d36f75954f5922376457cf68451c1fd Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 17 Apr 2024 16:00:27 +0300 Subject: Delete __run__cmd__. * gn2/wqflask/edit.py (__run_cmd__): Delete. Signed-off-by: Munyoki Kilyungi --- gn2/wqflask/edit.py | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'gn2') diff --git a/gn2/wqflask/edit.py b/gn2/wqflask/edit.py index 33772375..c0456615 100644 --- a/gn2/wqflask/edit.py +++ b/gn2/wqflask/edit.py @@ -25,26 +25,6 @@ from gn2.wqflask.oauth2.checks import require_oauth2_edit_resource_access metadata = Blueprint("metadata", __name__) -def __run_cmd__(cmd) -> Either: - """Run a given command and return it's results as an Either monad""" - _result = "" - try: - _result = subprocess.run( - cmd, capture_output=True - ) - except Exception as e_: - return Left({ - "command": cmd, - "error": str(e_), - }) - if _result.stderr: - return Left({ - "command": cmd, - "error": _result.stderr.decode() - }) - return Right(_result.stdout) - - @metadata.route("/edit") @require_oauth2_edit_resource_access @require_oauth2 -- cgit v1.2.3