systembell/salt-consul

Call to consul_check.present not working...

Closed this issue · 1 comments

I believe the consul_mod.py line 257 is missing a required parameter (check) when calling c.agent.check.register.

With the following yaml:

  consul_check.present:
      - name: auth-expire-client-auths
      - ttl: 8m

I get the following error:


      ID: /srv/aocsol/jobs/expire_client_auths.sh
Function: consul_check.present
    Name: auth-expire-client-auths
  Result: False
 Comment: An exception occurred in this state: Traceback (most recent call last):
            File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1560, in call
              **cdata['kwargs'])
            File "/var/cache/salt/minion/extmods/states/consul_check.py", line 68, in present
              __salt__['consul.check_register'](name, check_id, script, interval, ttl, notes)
            File "/var/cache/salt/minion/extmods/modules/consul_mod.py", line 257, in check_register
              return c.agent.check.register(name, check_id, script, interval, ttl, notes)
            File "/usr/local/lib/python2.7/dist-packages/consul/base.py", line 753, in register
              'check is required'
          AssertionError: check is required
 Started: 13:51:04.975531
Duration: 3.298 ms
 Changes:   

Ah, thanks for catching this @samprakos.