summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
AgeCommit message (Collapse)Author
2012-06-11Pylint cleanups, add a load yaml function that handles errors nicely + other ↵Joshua Harlow
cleanups.
2012-06-09Move cmdline functions here. Cleanup exception trapping. Fixup copyright.Joshua Harlow
2012-06-08Moved the shell functionality back in here.Joshua Harlow
2012-04-04initial checkin of kernel commandline cloud-config url supportScott Moser
2012-03-08Add DataSourceMaaS, a Data Source for Ubuntu Machine as a ServiceScott Moser
LP: #942061
2012-03-07fix pylint and pep8 warningsScott Moser
2012-03-06add headers_cb to doc for wait_for_urlScott Moser
2012-03-06move wait_for_metadata_service for util, rename to wait_for_urlScott Moser
Also, add in the headers_cb which will be required for oauth.
2012-03-05use builtin runparts rather than system run-parts utilityScott Moser
Because Fedora's run-parts does not accept '--regex' and debian's run-parts skips files with a '.' in the *without* '--regex=.*', we're forced to include our own version of run-parts. LP: #933553
2012-02-28fix docstring for is_containerScott Moser
2012-02-28address change in name of lxc-is-container to running-in-containerScott Moser
Also improves the logic in is_container following ubuntu's /etc/init/container-detect.conf . LP: #941955
2012-02-17fix pylint warningsScott Moser
2012-02-16DataSourceNoCloud: allow reading user-data and meta-data from simple filesScott Moser
This allows you to attach a disk in ISO9660 or vfat filesystem format labeled 'cidata' with 'user-data' and 'meta-data' on it. It provides a much easier way to interact with cloud-init in nocloud than mounting the image or the OVF method.
2012-02-16initial version of DataSourceConfigDriveScott Moser
2012-01-18Add HP to Copyright, and Juerg Haefliger Authors.Scott Moser
This copyright change reflects previous changes that Juerg made for pylint and pep8 cleanups. From: Juerg Haefliger <juerg.haefliger@hp.com> Date: Mon, 16 Jan 2012 10:45:12 +0100
2012-01-17add support for add/remove CA Certificates via cloud-config (LP: #915232)Scott Moser
LP: #915232
2012-01-17[PATCH] PEP8 coding style fixes.Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> This pulls in the named patch for LP: #914739 with a few other changes.
2012-01-17[PATCH 4/4] Fix pylint conventions C0301 (line too long)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17Merge from trunk.Mike Milner
2012-01-17[PATCH 3/4] Fix pylint conventions C0324 (comma not followed by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 2/4] Fix pylint conventions C0322 (operator not preceded by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 1/4] Fix pylint conventions C0321 (more than one statement on a ↵Scott Moser
single line) From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17Added delete_dir_contents function to cloudinit.util.Mike Milner
2012-01-17Add unit tests for util.write_file.Mike Milner
2012-01-12[PATCH 11/13] Fix pylint warnings W0141 (used builtin function xyz)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> Replace superseded builtin functions 'filter' and 'map' using list comprehension.
2012-01-12[PATCH 10/13] Fix pylint warnings W0102 (dangerous default value asScott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> argument)
2012-01-12[PATCH 07/13] Fix pylint warnings W0622 (redefining built-in 'xyz')Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 06/13] Fix pylint warnings W0612 (unused variable)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 02/13] Fix pylint warnings W0312 (found indentation with tabsScott Moser
instead of spaces) From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 01/13] Fix pylint warnings W0311 (bad indentation)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2011-12-19make stdin read from /dev/null for all cloud-init programs (LP: #903993)Scott Moser
the cloud-init programs are never intended to run interactively. Some programs were being run via subprocess, and would notice that their input was attached to a terminal (/dev/console). As a result, they they would try to prompt the user for input (apt-add-repository) This change simply re-opens standard input as /dev/null so any subprocesses will not end up blocking on input.
2011-12-16initial mirror configuration/discoveryScott Moser
2011-10-30Make the types of SSH keys to generate configurableScott Moser
Notes: * This also makes cc_ssh.py *not* write ssh keys to the console. That means that if keys-to-console is configured off, nothing will write the keys to the console. * I removed Garret's use of xargs, replacing with a shell for loop in write-ssh-key-fingerprints. taken from git://pkgs.fedoraproject.org/cloud-init.git commit 87f33190f43d2b26cced4597e7298835024466c2 Author: Garrett Holmstrom <gholms@fedoraproject.org> Patch8: cloud-init-0.6.2-sshkeytypes.patch
2011-10-30Restore created files' selinux contextsScott Moser
This adds a restorecon_if_possible method which uses selinux python module, and uses that for files modified in /etc. taken from git://pkgs.fedoraproject.org/cloud-init.git commit 87f33190f43d2b26cced4597e7298835024466c2 Author: Garrett Holmstrom <gholms@fedoraproject.org> Patch3: cloud-init-0.6.2-filecontext.patch
2011-10-27do not run run-parts if directory has no itemsScott Moser
Per bug 857926, on some systems, run-parts will exit failure if the directory is empty. On debian/ubuntu, at least of recent vintage, it exits success. Its reasonable to just not run it. LP: #857926
2011-09-22make read_seeded return OSError for a file not foundScott Moser
2011-09-22add retrying to read_seeded. have it use read_url.Scott Moser
read_seeded also takes a 'file_retry' which defaults to zero. This is so that if the seed path is a file, retries are not done. read_optional_seed is not passing 'retries=0' here, but all the users of read_optional_seed are using it from file.
2011-09-14try a little harder to get a fqdn rather than defaulting to localdomainScott Moser
This fixes (LP: #850206). See bug for more info. LP: #850206
2011-08-22util.subp: do not attach stdin cloud-init's stdin to subprocesses (LP: 831505)Scott Moser
Fix issue where 'isatty' would return true for apt-add-repository. It would get stdin which was attached to a terminal (/dev/console) and would thus hang when running during boot. This was done by changing all users of util.subp to have None input unless input was given. In that case, the input will be the string passed in. LP: #831505
2011-08-03cloudinit/util.py: fix syntax errorScott Moser
2011-08-03add get_hostname_fqdn method to 'util' and use it for getting hostnameScott Moser
This adds a method 'get_hostname_fqdn' to cloudinit.util, and then uses this method for getting the hostname and fqdn in places that get hostname. The single place for getting it right will help.
2011-07-19increase timeout on read_seed when a seedfrom was explicitly givenScott Moser
In the case where a seedfrom value was given on the command line or in the config file, we were timing out in 2 seconds on the connection. That timeout was put in place to support "probing" for sources, but seedfrom is explictly given. So, in that case, do a urllib.open without a timeout value. Looking at source code, default timeout is 'socket._GLOBAL_DEFAULT_TIMEOUT', but rather than importing that and using it, I will call without a timeout value. LP: #812646
2011-07-19do not complain if attempt to resizefs in an lxc container failsScott Moser
it is expected / understood that mknod would fail inside an lxc container. So, if thats the case, just log a debug message saying so. LP: #800856
2011-04-04convert some user input from dos to unix (LP: #744965)Scott Moser
If user input is a consumed as a user-script, a boothook, or a upstart job and appears to be dos-formated, then change it to unix formated LP: #744965
2011-03-03in subp, put output and stderr into the raised errorScott Moser
2011-02-17change from yaml+'#include' to yaml + config.d format for cloud.cfgScott Moser
2011-02-07add 'bootcmd' like 'runcmd' to cloud-config syntax for running things earlyScott Moser
2011-02-07add utility function get_cfg_by_pathScott Moser
2011-01-26remove needless import and defines in util.pyScott Moser
2011-01-25fix bad variable name in readurlScott Moser