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