New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql_grants.present escape option incorrectly reports failure #48507

Closed
emersonveenstra opened this Issue Jul 10, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@emersonveenstra

emersonveenstra commented Jul 10, 2018

Description of Issue/Question

Setting the escape: False for mysql_grants.present returns a failure, but the grant is applied correctly

Setup

check test mysql grant:
  mysql_grants.present:
    - grant: all privileges
    - database: "test.*"
    - user: test
    - host: '%'
    - escape: False

Steps to Reproduce Issue

Run the above SLS file. The output on the salt master is:

----------
ID: check test mysql grant
    Function: mysql_grants.present
      Result: False
     Comment: Failed to execute: "GRANT all privileges ON test.* TO test@%"
     Started: 17:06:10.161363
    Duration: 45.931 ms
     Changes:   

however, looking at the mysql grants, the check test mysql grant actually succeeded correctly

+-------------------------------------------------------------------------------------------------------------+
| Grants for test@%                                                                                   |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'%' IDENTIFIED BY PASSWORD '*[censored]' |
| GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'%'                                              |
+-------------------------------------------------------------------------------------------------------------+

Versions Report

Salt Version:
           Salt: 2018.3.2

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: 1.0.3
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.3.7
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.12 (default, Dec  4 2017, 14:50:18)
   python-gnupg: 0.3.8
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: Ubuntu 16.04 xenial
         locale: UTF-8
        machine: x86_64
        release: 4.4.0-116-generic
         system: Linux
        version: Ubuntu 16.04 xenial

Both master and minion are the same version

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jul 13, 2018

@emersonveenstra Please see #48561 for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment