summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_bootcmd.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-22 23:26:50 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-22 23:26:50 -0700
commitf8413af9168adc0ad7c730b9adea9eba67949ba5 (patch)
tree03b9896cb71a24839e12eb6db4dbd5a640f21b4a /cloudinit/config/cc_bootcmd.py
parent9d1f042f862c114f1613dcd5d2d8c401a1c54eaa (diff)
downloadvyos-cloud-init-f8413af9168adc0ad7c730b9adea9eba67949ba5.tar.gz
vyos-cloud-init-f8413af9168adc0ad7c730b9adea9eba67949ba5.zip
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
Diffstat (limited to 'cloudinit/config/cc_bootcmd.py')
-rw-r--r--cloudinit/config/cc_bootcmd.py3
1 files changed, 1 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>.
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)