Avoid fail during yields
This just causes a double-exception, so don't do it.
This commit is contained in:
parent
2a637c62e8
commit
73a4795967
|
@ -152,10 +152,7 @@ def chroot(destination):
|
|||
os.fchdir(fake_root)
|
||||
yield
|
||||
except Exception:
|
||||
fail(
|
||||
None,
|
||||
f"Failed to chroot into {destination}",
|
||||
)
|
||||
raise
|
||||
finally:
|
||||
os.fchdir(real_root)
|
||||
os.chroot(".")
|
||||
|
@ -187,10 +184,7 @@ def open_db(config):
|
|||
try:
|
||||
yield cur
|
||||
except Exception:
|
||||
fail(
|
||||
None,
|
||||
"Failed to yield database handle",
|
||||
)
|
||||
raise
|
||||
finally:
|
||||
conn.commit()
|
||||
cur.close()
|
||||
|
@ -213,10 +207,7 @@ def open_zk(config):
|
|||
try:
|
||||
yield zkhandler
|
||||
except Exception:
|
||||
fail(
|
||||
None,
|
||||
"Failed to yield Zookeeper connection",
|
||||
)
|
||||
raise
|
||||
finally:
|
||||
zkhandler.disconnect()
|
||||
del zkhandler
|
||||
|
|
Loading…
Reference in New Issue