summaryrefslogtreecommitdiff
path: root/cloudinit
AgeCommit message (Collapse)Author
2012-10-16Move the recursive flushing to the log module.Joshua Harlow
2012-10-16Add a more generic package install mechansimJoshua Harlow
that removes some of the code in apt_update_upgrade to do upgrades and installs and places it in a generic package module and adjusts some of the reboot backoffs and log flushing/sleeping that was happening there.
2012-10-15Skip install when there is not configuration, and install the package to be ↵Thomas Hervé
setup properly.
2012-10-05Add checks around the device names that are foundJoshua Harlow
to ensure that even if they are found that they are also valid, before they are assumed to be the correct device name.
2012-10-05Add tests to show that the assigned bug is fixed.Joshua Harlow
Also fix the extraction of the metadata key name since it actually uses 'dashes' instead of being a single word.
2012-10-05Ensure that config drive datasource attempts toJoshua Harlow
translate the device name to a actual device using logic that will try the ec2 metadata (if avail) or will try using 'blkid' to find a corresponding label. LP: #1062540
2012-10-05bump version to 0.7.1Scott Moser
2012-10-04Ensure that for config drive thatJoshua Harlow
we map 'hostname' to 'local-hostname' so that the modules work correctly with the cfgdrive style of data.
2012-10-01fix oauth time skew. actual implementation was returning 401 not 403.Scott Moser
This fixes (tested) bug 978127. The server was actually returning a 401 not a 403. As such, the fix here was insufficient. This will now take either of those 2 error codes. I've also tested it by changing the clock in the cloud-init upstart job with a stanza like below, and verifying that we do see the problem and then it resolve itself: pre-start script offset="10 minutes ago" past=$(date -R --date "$offset") date --set "$past" && echo ===== "set date to $past [$offset]" ===== || echo ===== "failed to set date to $past [$offset]" ==== end script LP: #978127
2012-09-30rework the rest of the users of old single 'user' to support listsJoshua Harlow
Rework the rest of the locations that used the previous 'user' and make those locations go through the new distros functions to select the default user or the user list (depending on usage). Adjust the tests to check the new 'default' field that signifies the default user + test the new method to extract just the default user from a normalized user dictionary. "default" user is now marked in the user dict and get_default_user uses that.
2012-09-30[pylint]: remove unused importScott Moser
2012-09-28Sync with head and fix conflicts.Joshua Harlow
2012-09-28Make byobu more tolerant of the user not beingJoshua Harlow
located and warn when it is not found + only run the shell command when actual contents exist to run.
2012-09-28Add a comment as to why distros can't beJoshua Harlow
imported without being renamed due to previous usage of the attribute 'distros'
2012-09-28make DataSourceMAAS 'main()' use load_yamlScott Moser
2012-09-28Rework the rest of the locations that usedJoshua Harlow
the previous 'user' and make those locations go through the new distros functions to select the default user or the user list (depending on usage). Adjust the tests to check the new 'default' field that signifies the default user + test the new method to extract just the default user from a normalized user dictionary.
2012-09-28fix pep8 and pylintScott Moser
2012-09-28add 'safeyaml' to cloudinitScott Moser
In 0.7.0 we started using yaml.safe_load to load data rather than yaml.load. Some producers (namely, ubuntu MAAS created) have produced cloud-config data in the past that included python unicode types. This creates a specialized safe_loader that is basically safe_load + support for python unicode.
2012-09-28rpm spec and rpm build, better handle case with no package_mirrorsJoshua Harlow
2012-09-28Also ensure that if mirror info is not invalidJoshua Harlow
before we start iterating over it (it could be sent is as none).
2012-09-28Stop the bad habit of using 'or'.Joshua Harlow
2012-09-28restart salt-minion instead of start.Scott Moser
Packages on debian/ubuntu should start on installation. As a result, if we want to get config changes we've inserted to be read, we need to restart. Note one interesting thing here. upstart considers 'restart' as "restart only if currently running", while 'service' considers restart to be "stop if running, then start". So the use of 'service' here is important, rather than just 'restart'
2012-09-27cleanup the user/group listsJoshua Harlow
The primary utility here is normalize_user_groups, which would be called by config modules to get a list of users or groups. This centralizes what was copied code into this one location.
2012-09-25Resync with head.Joshua Harlow
2012-09-25Allow package_mirrors to be non-existent.Joshua Harlow
2012-09-24Adjust the fingerprints to use this newJoshua Harlow
user normalization function instead of the previous 'user' extraction.
2012-09-24Avoid rechecking if old users is availabile.Joshua Harlow
2012-09-24Handle the case where 'user' is defined but 'users' isn't.Joshua Harlow
2012-09-24Add a netconfig format test + if rhel is passed the 'all'Joshua Harlow
device name, throw an error since rhel can not currently handle this case.
2012-09-24Update to bring inline with trunk/head.Joshua Harlow
2012-09-24Refactor the ug normalization to take in a distroJoshua Harlow
and produce a user and group list. Clean this up to be simpler as well as handle the old 'user' case when it exists in configuration.
2012-09-24cleanups for rhel network configJoshua Harlow
Rework the rhel sysconfig writing/updating so that it goes through a single function which helps ensure correctness. Also write to /etc/sysconfig/network when we have written out devices to ensure that networking is on.
2012-09-24fix pep8Scott Moser
2012-09-24Oopies, missed u.Joshua Harlow
2012-09-24Bring up to date with trunk.Joshua Harlow
2012-09-24handle ifup on RH distros by iterating over 'ifup devname'Joshua Harlow
Fix the ifup so that if a list of devices is provided then each interface is brought up individually instead of using the '--all' which isn't on rhel. The default debian behavior will be to use this still though as it overrides the new bring up interfaces function for this case.
2012-09-24DataSourceMAAS: if a oauth request fails due to 403 try updating local timeScott Moser
In the event of a 403 (Unauthorized) in oauth, try set a 'oauth_clockskew' variable. In future headers, use a time created by 'time.time() + self.oauth_clockskew'. The idea here is that if the local time is bad (or even if the server time is bad) we will essentially use something that should be similar to the remote clock. This fixes LP: #978127. LP: #978127
2012-09-24fix pylintScott Moser
2012-09-24fix make pep8Scott Moser
2012-09-24do not create 'sems' directory. 'sem' is proper instance/ pathScott Moser
2012-09-23Make the normalization a module level functionJoshua Harlow
since it has little dependence on the distros class itself. Readjust the using code to use this new module level function instead.
2012-09-22Use 0440 permissions on sudoers, not 0644Garrett Holmstrom
2012-09-21Fix some docs + pylint warnings + log on default created in the module.Joshua Harlow
2012-09-21Also allow the user list to come in as a commaJoshua Harlow
separated list so that its types match more of what the group list can be.
2012-09-211. Cleanup the user creation so that the distro class isJoshua Harlow
responsible only for creating users and groups and normalizing a input configuration into a normalized format that splits up the user list, the group list and the default user listsand let the add user/group config module handle calling those methods to add its own users/groups and the default user (if any). 2. Also add in tests for this normalization process to ensure that it is pretty bug free and works with the different types of formats that users/groups/defaults + options can take.
2012-09-20Instead of special casing the empty listJoshua Harlow
we are going to check for the 'all' entry and if that exists then only fire off one call (since debian supports this).
2012-09-19Use a common header creation functionJoshua Harlow
to avoid duplicating the same code in this file.
2012-09-19Rework the rhel sysconfig writing/updatingJoshua Harlow
so that it goes through a single function which helps ensure correctness. Also write to /etc/sysconfig/network when we have written out devices to ensure that networking is on.
2012-09-19Fix the ifup so that if a list of devices is providedJoshua Harlow
then each interface is brought up individually instead of using the '--all' which isn't on rhel. The default debian behavior will be to use this still though as it overrides the new bring up interfaces function for this case.
2012-09-19if a logged message fails, fallback to logging to stdoutJoshua Harlow
This most commonly occurs if a user-data script does '/sbin/poweroff' where syslog was being used. Once poweroff is invoked, syslog gets killed and logging would start to show stack traces. This generally tries to continue working instead, but log to stderr.