saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.15k stars 5.47k forks source link

salt is looking for outputters in /var/cache/salt/minion/extmods/output not /var/cache/salt/minion/extmods/outputputters #17103

Closed arthurzenika closed 9 years ago

arthurzenika commented 9 years ago

My custom outputter doesn't seem to work even though I am sure that it was shiped during "salt-call saltutil.sync_all" and is present in /var/cache/salt/minion/extmods/outputputters (but no .pyc so it hasn't been loaded).

Looking at a call with log all, I can see

[TRACE   ] loading output in ['/var/cache/salt/minion/extmods/output', '/usr/lib/python2.7/dist-packages/salt/output']

Is this list not missing /var/cache/salt/minion/extmods/outputputters

Taking a look at loader.py where there might be a problem in def outputters.

arthurzenika commented 9 years ago

A dirty hack cd /var/cache/salt/minion/extmods/; ln -s outputters/ output get salt to run the code (but is clearly not the right solution)

basepi commented 9 years ago

So sync_all is shipping to the wrong directory? We should get this fixed. Seems like /var/cache/salt/minion/extmods/output is the right place, since the built-in outputters are in salt/output/.

arthurzenika commented 9 years ago

For anyone getting this bug, this is the sls workaround :

 make symlink to fix outputter bug:
    file.symlink:
        - name: /var/cache/salt/minion/extmods/output
        - target : /var/cache/salt/minion/extmods/outputters
rallytime commented 9 years ago

Glad you were able to find a work around! Can you post the output of salt --versions-report?

arthurzenika commented 9 years ago
# salt-call --versions-report
           Salt: 2014.7.0
         Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.6
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 13.1.0
           RAET: Not Installed
            ZMQ: 3.2.3
           Mako: 0.7.0

but at the time we might have been in 2014.1

sysless commented 9 years ago

Same problem here.

$ salt-call --versions-report
           Salt: 2014.7.0
         Python: 2.7.5 (default, Jun 17 2014, 18:11:42)
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
 msgpack-python: 0.4.2
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 14.3.1
           RAET: Not Installed
            ZMQ: 3.2.4
           Mako: Not Installed
arthurzenika commented 9 years ago

bump on this bug...

rallytime commented 9 years ago

Thanks for the bump here @arthurlogilab. I've added some extra labels here to help get some more eyes on it.

rallytime commented 9 years ago

@arthurlogilab and @HiTeN - I've fixed this problem in #27483. Note: If you're using _outputters in wherever your file_roots is pointed, you'll need to change it to _output. This pull request fixes the way we're synching the custom outputters to the minions, not the loader picking them up. This is because all of the custom dynamic modules match their directory name in the salt tree (_states matches salt/states and _modules matches salt/modules), so the outputters should be consistent there as well.

Another thing to note as this only works on the minion side. Until a solution for #12511 is found, master-side custom outputters will not work, similarly to custom runners.

Anyway, if you change the name of your directory to _output and do either a saltutil.sync_all or saltuitl.sync_outputters, the loader will pick it up the minion-side custom outputter.