mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Removing quotes from the plugin_status query. Updating tests to reflect changes.
This commit is contained in:
parent
3dc66393b2
commit
fcc061368b
2 changed files with 6 additions and 5 deletions
|
@ -2821,12 +2821,12 @@ def plugin_status(name, **connection_args):
|
|||
if dbc is None:
|
||||
return ''
|
||||
cur = dbc.cursor()
|
||||
qry = 'SELECT PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = "%(name)s"'
|
||||
qry = 'SELECT PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = %(name)s'
|
||||
args = {}
|
||||
args['name'] = name
|
||||
|
||||
try:
|
||||
_execute(cur, qry)
|
||||
_execute(cur, qry, args)
|
||||
except MySQLdb.OperationalError as exc:
|
||||
err = 'MySQL Error {0}: {1}'.format(*exc.args)
|
||||
__context__['mysql.error'] = err
|
||||
|
|
|
@ -534,9 +534,10 @@ class MySQLTestCase(TestCase, LoaderModuleMockMixin):
|
|||
Test checking the status of a MySQL / MariaDB plugin
|
||||
'''
|
||||
self._test_call(mysql.plugin_status,
|
||||
'SELECT PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = "%(name)s"',
|
||||
'auth_socket',
|
||||
)
|
||||
{'sql': 'SELECT PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = %(name)s',
|
||||
'sql_args': {'name': 'auth_socket'}
|
||||
},
|
||||
'auth_socket')
|
||||
|
||||
def _test_call(self, function, expected_sql, *args, **kwargs):
|
||||
connect_mock = MagicMock()
|
||||
|
|
Loading…
Add table
Reference in a new issue