summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-09-15 20:07:11 -0600
committerScott Moser <smoser@brickies.net>2017-09-18 20:37:10 -0400
commit7eb3460b0d6d3e362a246958a7ea0a9ee5d91d5e (patch)
tree8dc323976cd5ea55ebba37cf0462220dfa7c16df /cloudinit/util.py
parenteaadf52b1010cf189bde2a6abb3265b890f6d36d (diff)
downloadvyos-cloud-init-7eb3460b0d6d3e362a246958a7ea0a9ee5d91d5e.tar.gz
vyos-cloud-init-7eb3460b0d6d3e362a246958a7ea0a9ee5d91d5e.zip
ec2: Fix maybe_perform_dhcp_discovery to use /var/tmp as a tmpdir
/run/cloud-init/tmp is on a filesystem mounted noexec, so running dchlient in Ec2Local during discovery breaks with 'Permission denied'. This branch allows us to run from a different tmp dir so we have exec rights. LP: #1717627
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 7e9d94fc..4c01f449 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1755,7 +1755,7 @@ def subp_blob_in_tempfile(blob, *args, **kwargs):
args = [tuple()]
# Use tmpdir over tmpfile to avoid 'text file busy' on execute
- with temp_utils.tempdir() as tmpd:
+ with temp_utils.tempdir(needs_exe=True) as tmpd:
tmpf = os.path.join(tmpd, basename)
if 'args' in kwargs:
kwargs['args'] = [tmpf] + list(kwargs['args'])