summaryrefslogtreecommitdiff
path: root/cloudinit/temp_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* net: Ensure a tmp with exec permissions for dhcp (#1690)Alberto Contreras2022-09-011-30/+36
| | | | | | | | In the case cloudinit.temp_utils points to a fs mounted as noexec and needs_exe=True, fallback to use os.join.path(Distro.usr_lib_exec, "cloud-init/clouddir) that will be mounted with exec perms. LP: #1962343
* Adopt Black and isort (SC-700) (#1157)James Falcon2021-12-151-8/+12
| | | | | Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
* net: Wait for dhclient to daemonize before reading lease fileJason Zions2019-01-151-2/+2
| | | | | | | | | | | | | | | | | cloud-init uses dhclient to fetch the DHCP lease so it can extract DHCP options. dhclient creates the leasefile, then writes to it; simply waiting for the leasefile to appear creates a race between dhclient and cloud-init. Instead, wait for dhclient to be parented by init. At that point, we know it has written to the leasefile, so it's safe to copy the file and kill the process. cloud-init creates a temporary directory in which to execute dhclient, and deletes that directory after it has killed the process. If cloud-init abandons waiting for dhclient to daemonize, it will still attempt to delete the temporary directory, but will not report an exception should that attempt fail. LP: #1794399
* Azure VM Preprovisioning support.Douglas Jordan2018-01-241-3/+8
| | | | | | | | | | | | | | This change will enable azure vms to report provisioning has completed twice, first to tell the fabric it has completed then a second time to enable customer settings. The datasource for the second provisioning is the Instance Metadata Service (IMDS),and the VM will poll indefinitely for the new ovf-env.xml from IMDS. This branch introduces EphemeralDHCPv4 which encapsulates common logic used by both DataSourceEc2 an DataSourceAzure for temporary DHCP interactions without side-effects. LP: #1734991
* ec2: Fix maybe_perform_dhcp_discovery to use /var/tmp as a tmpdirChad Smith2017-09-181-7/+15
| | | | | | | | | /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
* Use /run/cloud-init for tempfile operations.Scott Moser2017-09-071-0/+93
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