diff options
author | Scott Moser <smoser@brickies.net> | 2017-08-29 09:59:20 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-09-07 15:22:54 -0400 |
commit | 409918f9ba83e45e9bc5cc0b6c589e2fc8ae9b60 (patch) | |
tree | 9ed541b0118d6cb5a2b276e9a0473d8cd9ad2c18 /cloudinit/sources | |
parent | dcbb901cc3e9e888bc8f87e87bdc0ca8436a2baa (diff) | |
download | vyos-cloud-init-409918f9ba83e45e9bc5cc0b6c589e2fc8ae9b60.tar.gz vyos-cloud-init-409918f9ba83e45e9bc5cc0b6c589e2fc8ae9b60.zip |
Use /run/cloud-init for tempfile operations.
During boot, the usage of /tmp is not safe. In systemd systems,
systemd-tmpfiles-clean may run at any point and clear out a temp file
while cloud-init is using it. The solution here is to use
/run/cloud-init/tmp.
LP: #1707222
Diffstat (limited to 'cloudinit/sources')
-rw-r--r-- | cloudinit/sources/helpers/azure.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/sources/helpers/azure.py b/cloudinit/sources/helpers/azure.py index e22409d1..28ed0ae2 100644 --- a/cloudinit/sources/helpers/azure.py +++ b/cloudinit/sources/helpers/azure.py @@ -6,10 +6,10 @@ import os import re import socket import struct -import tempfile import time from cloudinit import stages +from cloudinit import temp_utils from contextlib import contextmanager from xml.etree import ElementTree @@ -111,7 +111,7 @@ class OpenSSLManager(object): } def __init__(self): - self.tmpdir = tempfile.mkdtemp() + self.tmpdir = temp_utils.mkdtemp() self.certificate = None self.generate_certificate() |