diff --git a/AUTHORS b/AUTHORS index 4decac605..df96910d1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,6 +16,7 @@ Gabriel Hurley Ghe Rivero Greg Althaus Hengqing Hu +Ionuț Arțăriși Ivan Kolodyazhny Jake Dahn Jake Zukowski diff --git a/horizon/dashboards/settings/ec2/forms.py b/horizon/dashboards/settings/ec2/forms.py index d3e55196a..bbacb0124 100644 --- a/horizon/dashboards/settings/ec2/forms.py +++ b/horizon/dashboards/settings/ec2/forms.py @@ -17,6 +17,7 @@ import logging import tempfile import zipfile +from contextlib import closing from django import http from django.template.loader import render_to_string @@ -87,7 +88,7 @@ class DownloadX509Credentials(forms.SelfHandlingForm): try: temp_zip = tempfile.NamedTemporaryFile(delete=True) - with zipfile.ZipFile(temp_zip.name, mode='w') as archive: + with closing(zipfile.ZipFile(temp_zip.name, mode='w')) as archive: archive.writestr('pk.pem', credentials.private_key) archive.writestr('cert.pem', credentials.data) archive.writestr('cacert.pem', cacert.data)