mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:32:13 +02:00
Close the session once snap connections are acquired (#8438)
This PR uses the context manager available for `requests.Session` to close properly the `session` once snap connections have been acquired.
This commit is contained in:
@@ -49,7 +49,7 @@ def prepare_env(cli_args):
|
||||
os.environ['CERTBOT_AUGEAS_PATH'] = '{0}/usr/lib/{1}/libaugeas.so.0'.format(
|
||||
os.environ.get('SNAP'), _ARCH_TRIPLET_MAP[snap_arch])
|
||||
|
||||
session = Session()
|
||||
with Session() as session:
|
||||
session.mount('http://snapd/', _SnapdAdapter())
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user