Merge pull request #1 from actown/master

Pass Pep8.
Command-line flag --stdout shows generated configuration.
Move code inside __main__ block.

Having code out of the __main__ block makes it run when the file is
loaded as a library, which interferes with most testing frameworks.

This was causing unexpected errors while using py.test.
Merge pull request #2 from funollet/to-stdout

Command-line flag --stdout shows generated configuration.
Merge branch 'master' into generic-directives

Conflicts:
	naginator.py
Minimal tests added for get_*_config() functions.

Function get_nagios_data() is mocked; no connections to PuppetDB for
running tests.

Requirements to run tests: py.test and mock.
Sort alphabetically directives in templates.
get_hosts_config(): use one template for all types.
get_contact_config(): use one template for all types.
get_contactgroup_config(): use one template for all types.
get_hostextinfo_config(): use one template for all types.
get_service_config(): use one template for all types.
Rename methods for readability. No functional changes.
Rename methods for readability. Fixed typos.
Show tip if 'import jinja2' fails.
Remove unused get_<dtyp>_config() functions.
Merge pull request #4 from funollet/generic-directives

Generic directives
Stop managing default parameters.

Same result can be achieved via Nagios template-based object
definitions.

Fixes #5
Stop guessing values for some parameters.

The script was filling the values for some parameters, not present in
PuppetDB response, with values of other parameters. This is highly
dependent on every user Nagios virtual resources.

This feature has been removed. This version may generate a different
configuration from older releases of the script, given the same response
from PuppetDB. If you were using this feature, you may want to ensure
the following parameters are present on your Nagios resources:

 * 'host_name' for 'nagios_host' resources
 * 'host_name' for 'nagios_hostextinfo' resources
 * 'contact_name' for 'nagios_contact' resources
 * 'contactgroup_name' for 'nagios_contactgroup' resources
 * 'command_name' for 'nagios_command' resources

Fixes #6
Mostly pass pep8, change reload_nagios to reload_monitoring and give it some options so you can use icinga or other nagios fork.