Fix out-of-scope call for subprocess.CompletedProcess object

This commit is contained in:
Eric Torres 2019-02-20 15:44:07 -08:00
parent 387c5f7d33
commit c6bfaefff1

View File

@ -14,7 +14,6 @@ class RepoAddError(BaseException):
# ========== Functions ==========
# TODO generalize this function
def db_modify(operation, db, *args):
"""Run either repo-add or repo-remove.
@ -50,8 +49,8 @@ def db_modify(operation, db, *args):
try:
process = _run_script(operation, *args)
except subprocess.CalledProcessError:
raise RepoAddError(process.stderr)
except subprocess.CalledProcessError as e:
raise RepoAddError(e)
else:
syslog.debug(process.stdout)
syslog.info('Database operation complete')