saltstack/salt — Issue #741: Exception in minion.py with 'and' in compound matcher in top.sls
Author: gordonm
Created: 2012-02-22 17:05:46+00:00
State: open

With the following matcher in top.sls:

'G@os:CentOS and G@role:kvm':
- match: compound
- yum.centos-cr

Here is the result when calling state.highstate:

[root@engkvm01 ~]# salt-call state.highstate
libvir: RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No s
uch file or directory
[INFO ] Loading fresh modules for state activity
libvir: RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No s
uch file or directory
libvir: RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No s
uch file or directory
Traceback (most recent call last):
File "/usr/bin/salt-call", line 21, in
main()
File "/usr/bin/salt-call", line 17, in main
client.run()
File "/usr/lib/python2.6/site-packages/salt/cli/__init__.py", line 669, in run
caller.run()
File "/usr/lib/python2.6/site-packages/salt/cli/caller.py", line 107, in run
ret = self.call()
File "/usr/lib/python2.6/site-packages/salt/cli/caller.py", line 42, in call
*self.opts['arg']
File "/usr/lib/python2.6/site-packages/salt/modules/state.py", line 79, in highstat
e
return st_.call_highstate()
File "/usr/lib/python2.6/site-packages/salt/state.py", line 1036, in call_highstate
matches = self.top_matches(top)
File "/usr/lib/python2.6/site-packages/salt/state.py", line 905, in top_matches
self.opts['nodegroups']
File "/usr/lib/python2.6/site-packages/salt/minion.py", line 537, in confirm_top
return getattr(self, '{0}_match'.format(matcher))(match)
File "/usr/lib/python2.6/site-packages/salt/minion.py", line 638, in compound_match
return eval(' '.join(results))
File "", line 1
True and and True
^
SyntaxError: invalid syntax

Without the 'and' in the compound matcher above, the match works as expected.