summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-09-26Adjust comment.Joshua Harlow
2012-09-26Fixup some pylint warnings.Joshua Harlow
2012-09-26Add a new example test that will patch utils and osJoshua Harlow
functions so that they can be 'retargeted' to a temporary directory, which allows us the ability to run a full set of cloud-init stages. Neat things: 1. All cloud-init code is unchanged (as long as it goes through the utils functions for most functionality) 2. Allows for a natural way to setup a temporary directory then patch the new directory as the new 'root' and then run cloud-init stages and then check the contents of what was placed as desired.
2012-09-25add tests for netcfg codeJoshua Harlow
2012-09-25Fix tests after resync with head.Joshua Harlow
2012-09-25Resync with head.Joshua Harlow
2012-09-24Fix pylint issues created.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-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-24write-ssh-key-fingerprints: do not send HOST KEYS through loggerScott Moser
In the previous commit to htis file I had wrapped the writing of 'BEGIN SSH HOST KEY KEYS' to go through logger. This would cause the keys to be prefixed with 'ec2:' which, previously they were not. That would break existing users *and* make it more difficult to consume that data, which was explicitly added to be easy to consume.
2012-09-24do not create 'sems' directory. 'sem' is proper instance/ pathScott Moser
2012-09-24send stderr from write-ssh-key-fingerprints to stdoutScott Moser
This changes all output write-ssh-key-fingerprints to go to its stdout by redirecting stderr to stdout. The reason for this is that cc_keys_to_console.py was swallowing stderr and not replaying it to /dev/console. Ideally, we'd have a way in 'util.subp' to do effectively the same thing as we're doing here in the shell script. LP: #1055688
2012-09-24fix permissions on /etc/sudoers.d file to be 0440 not 0644Garrett Holmstrom
sudo complains about the permissions on the sudoers config file that cloud-init writes: [ec2-user@ip-10-166-110-107 ~]$ sudo -s sudo: /etc/sudoers.d/90-cloud-init-users is mode 0644, should be 0440 This patch makes the file's permissions match sudo's recommendation. Note: ubuntu's sudo doesn't seem to complain about 644, but 440 is probably better.
2012-09-22Use 0440 permissions on sudoers, not 0644Garrett Holmstrom
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.
2012-09-19doc: document 'tags' as comma delimited stringsScott Moser
LP: #1042764
2012-09-19First thing that we do after we can start importingJoshua Harlow
is to patch the functionality before it gets reimported.
2012-09-19Get the fallback working.Joshua Harlow
2012-09-19add general signal handlersJoshua Harlow
A cloud-init job (user-data) might invoke /sbin/reboot or in some other way end up killing cloud-init. Rather than spewing the stack trace, we just print a nicer message.
2012-09-19do not disable logging on signalScott Moser
I had previously asked for this, but we're hoping to handle it in a more generic way. Just because we receive a signal doesn't mean that all logging is broken. The more general solution we'll chase is to catch a failure of a log message and fall back if necessary across the board. That way cloud-init will still send logging to the right places on a user interupt.
2012-09-19remove unit test.Scott Moser
the unit test required access to /dev/console due to the logging.
2012-09-19change exit messages to include signal nameScott Moser
2012-09-19Adding a dual fallback log handler thatJoshua Harlow
will be monkey patched in to replace the base handler. That patching isn't quite there yet but WIP.
2012-09-19fix 'update_package_sources' on rhel to only update package sourcesGarrett Holmstrom
update_package_sources on RHEL called "yum update", which actually upgrades packages on the system. Thix fix makes it instead call "yum makecache" instead.
2012-09-19Add the translation from the ubuntu format for nameservers and dns searchJoshua Harlow
servers and add in the writing of /etc/resolv.conf in rhel from that translation.
2012-09-19do not write a comment in /etc/hostname.Scott Moser
Network Manager (LP: #1053048), and apparently fedora/redhat do not like comments in this file. LP: #1052664
2012-09-19Actually download yum metadata with update_package_sourcesGarrett Holmstrom
2012-09-19write trailing newlines on generated filesScott Moser
This adds trailing newlines to /etc/default/locale, /etc/hostname, /etc/timezone.
2012-09-19Add support for 'selinux_user' key to useradd cloud-config syntaxGarrett Holmstrom
Fedora and RHEL and friends' useradd program supports an "--selinux-user" option that sets what SELinux user a new user should log in with. This commit introduces an "selinux-user" directive to cloud-config "users" lists that exposes this option.
2012-09-19fix incorrect ubuntu mirror locations for 'ports'Robie Basak
2012-09-19Fix ports.ubuntu.com mirror locationsRobie Basak
2012-09-18Make update_package_sources stop upgrading packages on RHELGarrett Holmstrom
2012-09-18Add support for useradd --selinux-user''Garrett Holmstrom
2012-09-17Fill in basic info for the Fedora distroGarrett Holmstrom
2012-09-14Cleanup pylint warnings.Joshua Harlow
2012-09-14Add a basic signal test and write out allJoshua Harlow
the signal information in one block instead of many.
2012-09-14only write landscape config if user-data providedScott Moser
2012-09-14fix hostname based on IP generation.Andy Grimm
LP: #1050962
2012-09-14remove 'start networking' from cloud-init-nonetScott Moser
do not 'start networking' in cloud-init-nonet, but add cloud-init-container job that runs only if in container and emits net-device-added (LP: #1031065) LP: #1031065