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, salt-call: traceback: TypeError: a float is required #5959

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

peer, salt-call: traceback: TypeError: a float is required #5959

Mrten opened this issue Jul 5, 2013 · 2 comments · Fixed by #5966
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

see #5958 for the config:

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

missing =, results in traceback:

Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/pymodules/python2.7/salt/scripts.py", line 76, in salt_call
    client.run()
  File "/usr/lib/pymodules/python2.7/salt/cli/__init__.py", line 265, in run
    caller.run()
  File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 134, in run
    ret = self.call()
  File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 75, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/salt/modules/publish.py", line 129, in publish
    return _publish(tgt, fun, arg, expr_form, returner, timeout, 'clean')
  File "/usr/lib/pymodules/python2.7/salt/modules/publish.py", line 72, in _publish
    time.sleep(timeout)
TypeError: a float is required
@terminalmage
Copy link
Contributor

That's weird, IIRC time.sleep takes either an int or a float.

@terminalmage
Copy link
Contributor

Ahh, it looks like the value is being passed to time.sleep is a string, which causes that exact traceback.

Python 2.7.5 (default, May 12 2013, 12:00:47)
[GCC 4.8.0 20130502 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.sleep('5')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: a float is required
>>>

Should be an easy fix, thanks for the report!

terminalmage added a commit to terminalmage/salt that referenced this issue Jul 5, 2013
This fixes saltstack#5959 by re-casting the timeout value so that it is of the
proper type to be passed to time.sleep. Salt CLI args are loaded as
strings, which time.sleep does not like.
terminalmage added a commit that referenced this issue Jul 5, 2013
This fixes #5959 by re-casting the timeout value so that it is of the
proper type to be passed to time.sleep. Salt CLI args are loaded as
strings, which time.sleep does not like.
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.

2 participants