84 Commits

Author SHA1 Message Date
Clint Byrum
f260f92a49 Fix tests for rename. 2013-06-26 13:08:42 -07:00
Clint Byrum
819a075de6 Fix .gitreview file 2013-06-26 12:53:07 -07:00
Clint Byrum
05b667a977 Splitting os-collect-config into its own repo. 2013-06-26 12:40:25 -07:00
Clint Byrum
5841dd6e24 Create os-collect-config entry point.
Tool to grab config from known data sources. First data source is
The EC2 metadata service.

Change-Id: I33f8c1a96dc20486836055bb60d87f544aac2a62
2013-06-17 09:56:27 -07:00
Robert Collins
ba51abbdf1 Rename to os-apply-config.
The name os-config-applier was too confusing given os-refresh-config as the
partner program, so we've decided to rename to os-apply-config.

To aid migration the old command name and default template path are still
supported.

Change-Id: I39725595275e7b4375ac4fda52e6a14b7071f7e9
2013-06-14 15:30:14 +12:00
Dan Prince
48e6c5f40e Allow default type's to contain underscores.
Fixes LP Bug #1188786.

Change-Id: I2ff2b4abc88ca914220a7de1fa0ef05a6105b9c1
2013-06-07 15:48:46 -04:00
Clint Byrum
e76e73a61d Add a 'netaddress' value type for --key.
It is quite common to expect either a numeric IP address or domain name.
We include all ASCII characters needed to express IPv4, CIDR networks,
IPv6, or DNS names.

Change-Id: I2ab370d2bdad0d568b34c4ed55d60a5b6cdd9b19
2013-05-28 11:32:56 -07:00
Jenkins
1ef136031c Merge "Add support for default --key values." 2013-05-21 17:13:38 +00:00
Clint Byrum
fa5fb2d163 Allow empty strings for raw and default types.
Empty string is a perfectly valid raw string and the default type is
meant to prevent malicious characters, not empty strings.

Change-Id: I717bbcfe1a81b383782122870d0d727b28f40cce
2013-05-21 10:07:48 -07:00
Clint Byrum
0746e22407 Add support for default --key values.
We are using a pattern of suppressing errors to allow missing keys
in some TripleO elements.

This allows simply specifying a default value inside
os-config-applier.

Change-Id: I15702d205bab995f918f2efcb75af832b760be74
2013-05-21 09:58:50 -07:00
Clint Byrum
c56819ae40 Allow missing tags in templates.
Previously missing_tags was set to 'strict', so any missing values in
the configuration json would be flagged as an error. They will now be
ignored and returned as u'', per the pystache documentation.

Change-Id: I46d675bdd76948238191be92f0a2162963fcc478
2013-05-09 11:47:04 -07:00
Clint Byrum
b208ab5269 Read metadata from local heat-cfntools cache
Heat writes to /var/lib/heat-cfntools/cfn-init-data , and heat-cfntools
writes the last metadata it read to
/var/cache/heat-cfntools/last_metadata. We expect to run on first boot,
which is why we need the heat version. Then we also expect to run after
cfn-hup notices changes, so that is where the last_metadata comes from.

Change-Id: I781c74a10b419f84c6983ed2b4d54b47bfa7b605
2013-04-12 16:30:12 -07:00
Jenkins
e22ebf2212 Merge "Make main() return rather than call sys.exit" 2013-04-10 23:02:27 +00:00
Clint Byrum
a8f8df92d8 Make main() return rather than call sys.exit
Fixes tests not all being run and also makes main() more directly
testable. Also adding tests for log messages when main() is called.
Finally adding argparse to requirements.txt to fix python 2.6

Change-Id: I7f152c9aa1e99d0fd3d763871c96cf60840e3ff7
2013-04-10 15:56:34 -07:00
Clint Byrum
af70f8402d Remove unnecessary check for writable output dir.
os-config-applier is useful by non-root users who have access to
write the files they need to in sub-directories under the main output
directory.

Change-Id: I52af0bd076f3fef99ea09a3074f0b0d5b7e9afca
2013-04-10 04:06:15 +00:00
Clint Byrum
e7e4b9f0ec Adding stackforge .gitreview file 2013-03-27 21:10:31 -07:00
Monty Taylor
3bc12fbccf Remove env vars we don't use. 2013-03-28 04:05:31 +01:00
Monty Taylor
82489a11ba Align to OpenStack Hacking rules. 2013-03-28 04:03:46 +01:00
Monty Taylor
74929e70cc Aligned tests with OpenStack standards.
Made them run as testtools.TestCase tests.
Removed nose references.
2013-03-28 03:40:38 +01:00
Monty Taylor
49c060a313 Migrate to pbr and testr. 2013-03-28 02:37:45 +01:00
Tim Miller
354297435d Merge pull request #6 from SpamapS/master
Render complex sub-objects using json.dumps
2013-03-20 09:28:31 -07:00
Clint Byrum
e34be4df0f Render complex sub-objects using json.dumps
Normally pystache will just use the python unicode representation of
objects. This is not very useful programatically. Rendering using json
makes these values more useful.
2013-03-20 09:12:22 -07:00
Tim Miller
9883a86228 Ensure config files are readable by all. 2013-03-18 11:44:26 -07:00
Clint Byrum
1db777fd9e Pass all flake8 tests - run in CI too 2013-03-15 10:47:02 -07:00
Clint Byrum
57a2265ebb Atomically replace files 2013-03-15 09:18:31 -07:00
Clint Byrum
28365000ca Adding IRC notifications for travis CI 2013-03-15 00:41:14 -07:00
Clint Byrum
81dd76d62a Disable Python 2.6 CI until someone asks for it 2013-03-15 00:38:42 -07:00
Clint Byrum
0646793232 Make travis-CI python 2.6 jobs work 2013-03-15 00:31:34 -07:00
Clint Byrum
35b017f7f2 Adding Travis-CI support 2013-03-15 00:27:49 -07:00
Clint Byrum
8796d9c7b5 Pass subhash option to install_config 2013-03-15 00:21:58 -07:00
Clint Byrum
8107f6ef8c Test subhash 2013-03-15 00:19:34 -07:00
Clint Byrum
bbb887decd Fix printing stack trace while running tests 2013-03-15 00:18:45 -07:00
rbtcollins
84a54e7558 Merge pull request #4 from echohead/key-types
Allow printing of metadata values with '--key KEY --type TYPE'
2013-02-28 13:44:30 -08:00
Tim Miller
3833be24f3 Allow printing of metadata values with '--key KEY':
Print a key from the metadata file. the key may be nested
arbitrarily deep.

Pass --type=<int|default|raw> to raise an error if the requested
value does not conform to the type.
2013-02-27 16:32:39 -08:00
Tim Miller
3055f877b6 Add --subhash to use a sub-scope of metadata:
For example, if the metadata is {"a": {"b": {"c": "d"}}},
then `--subhash a.b` will use only {"c": "d"} instead of the
full hash.
2013-02-26 00:49:30 -08:00
Tim Miller
fd08a7585b Add default value to arguments to main:
so that `os-config-applier` works immediately after a pip install.
2013-02-10 13:52:22 -08:00
Tim Miller
6786d22e79 Merge pull request #2 from tripleo/ARG-PRINT-TEMPLATES
add --print-templates option
2013-02-07 15:28:51 -08:00
Clint Byrum
5667816ec8 add --print-templates option
This will let elements easily find where to drop their template files.
2013-02-07 15:23:15 -08:00
Clint Byrum
40f6dd3cb4 Add default templates path
Also shows defaults in --help for all options now.
2013-02-07 11:41:40 -08:00
Clint Byrum
c3c32a170b Use argparse as optparse is deprecated.
Also change the --validate option to match the variable name use in the
program, as it makes it easier for a user to map intentions to actual
code.
2013-02-07 11:41:04 -08:00
Tim Miller
a5f65f4bfe Merge branch 'master' of github.com:tripleo/os-config-applier 2013-02-01 11:27:51 -08:00
Tim Miller
bfa5f4baf4 include template path in missing key error. 2013-02-01 11:27:40 -08:00
Tim Miller
e9ddb1ab4d Update README.md 2013-01-31 15:15:31 -08:00
Tim Miller
b3bceea00d correct default cfn-init-data path 2013-01-31 11:45:01 -08:00
Tim Miller
916a6db0e3 make readme more serious 2013-01-30 19:58:12 -08:00
Tim Miller
d547bdb71d update readme with s/cornfig/os-config-applier/ 2013-01-30 19:55:58 -08:00
Tim Miller
6cd1768338 update code to reflect s/cornfig/os-config-applier/ 2013-01-30 19:48:27 -08:00
Tim Miller
f5e9edca98 bump version to 0.3 2013-01-30 12:31:29 -08:00
Tim Miller
b4fe2e1adc log to /var/log, if run as root. 2013-01-30 12:30:53 -08:00
Tim Miller
6c04767006 better error messages 2013-01-29 21:22:17 -08:00