Skip to content

Commit

Permalink
Drop unused 'run' function
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Nov 18, 2024
1 parent 88846cc commit b74414a
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions conda-store-server/conda_store_server/plugins/plugin_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(

def run_command(self, command, redirect_stderr=True, **kwargs):
"""Runs command and immediately writes to logs"""
self.log.info(f"Running command: {' '.join(command)}")
self.log.info("Running command: %s", command)

# Unlike subprocess.run, Popen doesn't support the check argument, so
# ignore it. The code below always checks the return code
Expand All @@ -58,17 +58,3 @@ def run_command(self, command, redirect_stderr=True, **kwargs):

if p.returncode != 0:
raise subprocess.CalledProcessError(p.returncode, p.args)

def run(self, *args, redirect_stderr=True, **kwargs):
"""Runs command waiting for it to succeed before writing to logs"""
result = subprocess.run(
*args,
**kwargs,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT if redirect_stderr else subprocess.PIPE,
encoding="utf-8",
)
self.stdout.write(result.stdout)
if not redirect_stderr:
self.stderr.write(result.stderr)
return result

0 comments on commit b74414a

Please sign in to comment.