salt icon indicating copy to clipboard operation
salt copied to clipboard

mongo_future_return username attribute set incorrectly

Open nulfox opened this issue 11 years ago • 2 comments

salt 2015.5.3 (Lithium)

There seems to be a line that is referencing the mongo.user attribute as mongo.username, which causes the returner to default to logging without username and leads to permission issues.

https://github.com/saltstack/salt/blob/develop/salt/returners/mongo_future_return.py Ran into two issues when using the mongo returner: _get_options (line 100) attempts to grab username attribute, but it's supposed to be (and reference everywhere) as user.

Changing the attribute username to user fixes issue with permissions (not authorized to create index, etc...).

Also - minor issue, but getting deprecation warnings for the 3 uses of ensure_index method (lines 142-145). Changing it to create_index resolves this.

nulfox avatar Aug 03 '15 19:08 nulfox

           Salt: 2015.5.3
         Python: 2.7.5 (default, Apr  9 2015, 11:03:32)
         Jinja2: 2.7.3
       M2Crypto: 0.22
 msgpack-python: 0.4.6
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: Not Installed
         PyYAML: 3.11
          ioflo: Not Installed
          PyZMQ: 14.7.0
           RAET: Not Installed
            ZMQ: 4.1.2
           Mako: Not Installed
        Tornado: Not Installed
[WARNING ] Returner unavailable: command SON([('createIndexes', u'saltReturns'), ('indexes', [{'name': u'minion_1', 'key': SON([('minion', 1)])}])]) on namespace salt.$cmd failed: not authorized on salt to execute command { createIndexes: "saltReturns", indexes: [ { name: "minion_1", key: { minion: 1 } } ] }

nulfox avatar Aug 03 '15 19:08 nulfox

@mecarus, thanks for the report. Feel free to close this issue when your changes are merged.

jfindlay avatar Aug 03 '15 19:08 jfindlay