From f8413af9168adc0ad7c730b9adea9eba67949ba5 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 22 Jun 2012 23:26:50 -0700 Subject: 1. Move the getkeybyid function back here but add some slight adjustments a. Instead of executing a bash string, write out a temporary file and then just execute '/bin/sh' on that file with the right arguments instead. 2. Rename util.SilentTemporaryFile to util.ExtendedTemporaryFile and update the usages of the previous name accordingly, this better reflects what this temp file is. 3. More teenie pep8 line length fixings --- cloudinit/config/cc_bootcmd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cloudinit/config/cc_bootcmd.py') diff --git a/cloudinit/config/cc_bootcmd.py b/cloudinit/config/cc_bootcmd.py index 89ccf3f1..bae1ea54 100644 --- a/cloudinit/config/cc_bootcmd.py +++ b/cloudinit/config/cc_bootcmd.py @@ -19,7 +19,6 @@ # along with this program. If not, see . import os -import tempfile from cloudinit import util from cloudinit.settings import PER_ALWAYS @@ -34,7 +33,7 @@ def handle(name, cfg, cloud, log, _args): " no 'bootcmd' key in configuration"), name) return - with tempfile.NamedTemporaryFile(suffix=".sh") as tmpf: + with util.ExtendedTemporaryFile(suffix=".sh") as tmpf: try: content = util.shellify(cfg["bootcmd"]) tmpf.write(content) -- cgit v1.2.3