saltstack/salt — pull request #993 by trane (2012-03-22 23:41:40+00:00)
Title: Verify top file return failure on invalid (#345)

Sorry for all the other pull requests, I realized I forgot a test that ended up breaking with my patch. That is working now and tested. Tests were using `''` as the server name in various locations for the file.

Note:
This is only a prototype, feel free to reject and have me update more

Checks completely built top file for invalid keys, such as `''`. This can be
expanded to check for other things that are not expected by salt.

This is the output from `salt-call -l debug state.highstate` the the `top.sls` file contains `''`:

```
salt-call -l debug state.highstate
[DEBUG ] Failed to import module json_mako, this is most likely NOT a problem: No module named mako.template
[DEBUG ] Failed to import module yaml_mako, this is most likely NOT a problem: No module named mako.template
[DEBUG ] Loaded minion key: /etc/salt/pki/minion.pem
[DEBUG ] Decrypting the current master AES key
[DEBUG ] Loaded minion key: /etc/salt/pki/minion.pem
[INFO ] Loading fresh modules for state activity
[DEBUG ] Failed to import module json_mako, this is most likely NOT a problem: No module named mako.template
[DEBUG ] Failed to import module yaml_mako, this is most likely NOT a problem: No module named mako.template
local:
----------
State: - no
Name: states
Function: None
Result: False
Comment: Invalid top syntax
Changes:

```