Skip to content
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

peer traceback: AttributeError: 'Matcher' object has no attribute 'user=www_match #5958

Closed
Mrten opened this issue Jul 5, 2013 · 5 comments · Fixed by #5968
Closed

peer traceback: AttributeError: 'Matcher' object has no attribute 'user=www_match #5958

Mrten opened this issue Jul 5, 2013 · 5 comments · Fixed by #5968
Labels
Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists
Milestone

Comments

@Mrten
Copy link
Contributor

Mrten commented Jul 5, 2013

With

peer:
  svn:
    - svn.update

and, on svn,

sudo salt-call publish.publish 'web-*' svn.update /var/www/svn user=www password=eb

I get no results and this in the log on web-*:

2013-07-05 14:08:17,857 [salt.minion      ][CRITICAL] An exception occurred while polling the minion
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 1013, in tune_in
    self._handle_payload(payload)
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 514, in _handle_payload
    'clear': self._handle_clear}[payload['enc']](payload['load'])
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 533, in _handle_aes
    '{0}_match'.format(data['tgt_type']))(data['tgt']):
AttributeError: 'Matcher' object has no attribute 'user=www_match'
@terminalmage
Copy link
Contributor

@thatch45 I'm not too familiar with the peer publish system, but it seems like we just need a default value of False to be added to the call to getattr() here. Is that correct?

@thatch45
Copy link
Contributor

thatch45 commented Jul 5, 2013

Yes, we should catch this better, but I think that this is a classic peer command nesting issue, I think the command that @Mrten needs is this:
sudo salt-call publish.publish 'web-*' svn.update '/var/www/svn user=www password=eb'

Salt is thinking that the user=www is supposed to be sent to publish.publish, not svn.update

@thatch45
Copy link
Contributor

thatch45 commented Jul 5, 2013

Oh, and yes, getting a catch in there should do it @terminalmage

@terminalmage
Copy link
Contributor

Cool, thanks.

terminalmage added a commit to terminalmage/salt that referenced this issue Jul 5, 2013
This fixes saltstack#5958 by adding a default value for the call to getattr().
terminalmage added a commit that referenced this issue Jul 5, 2013
This fixes #5958 by adding a default value for the call to getattr().
@Mrten
Copy link
Contributor Author

Mrten commented Jul 5, 2013

Using sudo salt-call publish.publish web-1 svn.update '/var/www/svn user=www password=eb' gives me another traceback:

    ret:
        Traceback (most recent call last):
          File "/usr/lib/pymodules/python2.7/salt/minion.py", line 626, in _thread_return
            ret['return'] = func(*args, **kwargs)
          File "/usr/lib/pymodules/python2.7/salt/modules/svn.py", line 171, in update
            return _run_svn('update', cwd, user, None, opts)
          File "/usr/lib/pymodules/python2.7/salt/modules/svn.py", line 61, in _run_svn
            result = __salt__['cmd.run_all'](cmd, cwd=cwd, runas=user, **kwargs)
          File "/usr/lib/pymodules/python2.7/salt/modules/cmdmod.py", line 592, in run_all
            timeout=timeout)
          File "/usr/lib/pymodules/python2.7/salt/modules/cmdmod.py", line 317, in _run
            proc = salt.utils.timed_subprocess.TimedProc(cmd, **kwargs)
          File "/usr/lib/pymodules/python2.7/salt/utils/timed_subprocess.py", line 20, in __init__
            self.process = subprocess.Popen(args, stdin=subprocess.PIPE, **kwargs)
          File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
            errread, errwrite)
          File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
            raise child_exception
        OSError: [Errno 2] No such file or directory: '/var/www/svn user=www password=eb'

If I do it with comma's as publish.publish module docs suggest I get a warning in the logs (and no output whatsoever)

2013-07-05 22:39:30,214 [salt.minion      ][WARNING ] TypeError encountered executing svn.update: update() got multiple values for keyword argument 'user'. See debug log for more info.  Possibly a missing arguments issue:  ArgSpec(args=['cwd', 'targets', 'user'], varargs='opts', keywords=None, defaults=(None, None))

What is the proper way? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants