saltstack/salt — pull request #770 by fatbox (2012-02-26 21:18:15+00:00)
Title: When using isintance to detect strings we should check for basestring

I spent the past 30 min trying to debug a problem where when a command
was published to the minion it was arriving as a string instead of a
tuple. The cmd.run module was receiving:

{
'arg': 'mycommand myarg1 myarg2'
'fun': 'cmd.run',
'jid': '20120226160155389058',
'ret': '',
'tgt': 'mytarget'
}

This was causing the following exception:

TypeError: run() takes at most 3 arguments (20 given)

I traced this down to the publish module checking for an instance of
'str' and splitting on ','.

In my instance the problem was being caused because Django likes to use
Unicode strings everywhere and the isintance was returning False.

I've replaced all instances of str with basestring in all the isintance
checks.