This is a rather obscure one but it just bit us so I figured we should
fix it.
A recent change to our code that invokes salt through the Python API
ended up doing this:
ret = minion.functions['publish.publish'](self.name, fun, *args, **kwargs)
When we really meant to do this:
ret = minion.functions['publish.publish'](self.name, fun, arg=args, **kwargs)
What made this difficult to track down was that the master would just
silently die when this happened. Once we ran it in debug mode we found
the following exception:
16:14:30,049 [salt.master ][INFO ] AES payload received with command minion_publish
Process MWorker-5:
Traceback (most recent call last):
File "/usr/lib/python2.6/multiprocessing/process.py", line 232, in _bootstrap
self.run()
File "/usr/lib/python2.6/dist-packages/salt/master.py", line 368, in run
self.__bind()
File "/usr/lib/python2.6/dist-packages/salt/master.py", line 317, in __bind
ret = self.serial.dumps(self._handle_payload(payload))
File "/usr/lib/python2.6/dist-packages/salt/master.py", line 335, in _handle_payload
'clear': self._handle_clear}[key](load)
File "/usr/lib/python2.6/dist-packages/salt/master.py", line 362, in _handle_aes
return self.aes_funcs.run_func(data['cmd'], data)
File "/usr/lib/python2.6/dist-packages/salt/master.py", line 775, in run_func
ret = getattr(self, func)(load)
File "/usr/lib/python2.6/dist-packages/salt/master.py", line 722, in minion_publish
timeout = int(clear_load['tmo'])
ValueError: invalid literal for int() with base 10: ',00:16:36:9d:d9:30,'
With these changes the master will now log a warning and return gracefully.
Also, I fixed a small syntax error that suggested clear_load was a function.
This change makes it so that kwargs can be passed to templates and they
are loaded up with the correct data. This also repairs the mako template
system
As per http://dev.mysql.com/doc/refman/5.1/en/grant.html you can only
specify wildcards in the database part of the specification for the
grant.
As it stands right now when the grant is generated it is for a table
with backticks in the name. This leads to the confusing situation where
the user can access the database but cannot access any tables.