Fix out-of-scope call for subprocess.CompletedProcess object
This commit is contained in:
parent
387c5f7d33
commit
c6bfaefff1
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user