From 66c13ab5aca67ca3aa3d1536154989f98b85107a Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 15 Jun 2015 17:20:51 -0400 Subject: apt_configure: fix importing of apt gpg keys under in python3 LP: #1463373 --- ChangeLog | 1 + cloudinit/config/cc_apt_configure.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cc12cb6e..6261147e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -48,6 +48,7 @@ [Lars Kellogg-Stedman] - Add an rh_subscription module to handle registration of Red Hat instances. [Brent Baude] + - cc_apt_configure: fix importing keys under python3 (LP: #1463373) 0.7.6: - open 0.7.6 - Enable vendordata on CloudSigma datasource (LP: #1303986) diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py index 2c51d116..9e9e9e26 100644 --- a/cloudinit/config/cc_apt_configure.py +++ b/cloudinit/config/cc_apt_configure.py @@ -109,7 +109,7 @@ def handle(name, cfg, cloud, log, _args): # get gpg keyid from keyserver def getkeybyid(keyid, keyserver): - with util.ExtendedTemporaryFile(suffix='.sh') as fh: + with util.ExtendedTemporaryFile(suffix='.sh', mode="w+", ) as fh: fh.write(EXPORT_GPG_KEYID) fh.flush() cmd = ['/bin/sh', fh.name, keyid, keyserver] -- cgit v1.2.3