summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-26Add a nice '-p1'Joshua Harlow
2012-09-26Ensure the patches get activated.Joshua Harlow
2012-09-25Clean doesn't seem needed.Joshua Harlow
2012-09-25Add a top_dir define.Joshua Harlow
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-25Fix cheetah syntax error.Joshua Harlow
2012-09-25Allow package_mirrors to be non-existent.Joshua Harlow
2012-09-25Fix syntax error.Joshua Harlow
2012-09-25Add the ability to pass patches to theJoshua Harlow
rpm builder utility.
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-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-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-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-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.