summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
AgeCommit message (Collapse)Author
2012-06-21Fixup python selinux guards, only try to restore after we check if its ↵harlowja
useful to restore, fix test to work with selinux enabled sysystems
2012-06-211. Update the comment about fstab to just point to 'man fstab'Joshua Harlow
2. Update the mount point adding of '/' to just add it in one place if it does not already exist
2012-06-21Returning whether it was enabled, useful for unit testingJoshua Harlow
2012-06-21Use yaml safe_load just incaseJoshua Harlow
2012-06-20Massive pylint + pep8 fixups!Joshua Harlow
2012-06-191. Cleanup variable names to match more of the pythonic underscore patternJoshua Harlow
2. Seperate config loading from the actual final 'merging' process. a. A util function will now merge multiple config dictionaries after they have all been loaded instead of loading and merging at the same time, which can get confusing to follow.
2012-06-181. Allow the built-in config to be passed in when getting the base configJoshua Harlow
2. Move the cloudinit util function that writes the command line url to a file to here.
2012-06-181. Decreasing of logging in piping routingJoshua Harlow
2. Fixup of merge dict after found out that it depends on the src return for non dict types 3. Only merge kernel config if there was any kernel config
2012-06-171. Add a url response class that urlreading now returns (instead of a tuple). harlowja
a. This allows for more properties to be added as needed in the future, instead of being very restrictive. 2. Fix up all uses of the url reading to now use this new response object. 3. Also fixup user data including, such that if no response actual occurs the url content is not further processed.
2012-06-16Let read_file_or_url util function have good defaultsJoshua Harlow
2012-06-16Correct the mount options to use a comma separated list for the mount ↵Joshua Harlow
options (if any provided/selected)
2012-06-16Add a restricted set of characters which can be used in filenames when ↵Joshua Harlow
cleaning them.
2012-06-16Have the ensure file function be able to take in a file permission.Joshua Harlow
2012-06-161. Add in one function that will do output redirection from config for a ↵Joshua Harlow
given mode. 2. Adjust the usage of items() to iteritems() which will help translation to python 3.
2012-06-15Fixups to ensure that pylint does not find anything major wrong.Joshua Harlow
2012-06-15Inclusion of more utility functions included:Joshua Harlow
1. Adjustments to using more selinux guards around directory creation, chmod... 2. Adding util functions to check if values are false or true (used internally and externally) 3. Move find_devs_with to util.py and allow it to serve multiple use cases 4. Add fork_cb which will fork a process and then call a certain callback (used right now by the resize nonblocking mode) 5. Move functions that performed time_rfc2822 time fetching and uptime fetching to here. 6. Allow the subp util function to act in shell mode 7. Increase logging usefulness in shellify function
2012-06-13Add in a make url function (might be useful).Joshua Harlow
Adjust usage of logexc to use that in the utils file for exceptions that occur. Add in more options to sub function to capture outputs, shell mode and such.
2012-06-11Add centering method + more descriptive mount failure exception message.Joshua Harlow
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