From c808c8a22ad40de15e1f3877212358fd2eacceb9 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 16 Dec 2014 16:09:17 -0800 Subject: [PATCH] Fix some of the new math filters --- lib/ansible/runner/filter_plugins/math.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/runner/filter_plugins/math.py b/lib/ansible/runner/filter_plugins/math.py index ce01ae573b..d069fbd391 100644 --- a/lib/ansible/runner/filter_plugins/math.py +++ b/lib/ansible/runner/filter_plugins/math.py @@ -21,7 +21,7 @@ from ansible import errors def isnotanumber(x): try: return math.isnan(x) - except TypeError, e: + except TypeError: return False @@ -30,14 +30,14 @@ def logarithm(x, base=math.e): if base == 10: return math.log10(x) else: - return = math.log(x, base) + return math.log(x, base) except TypeError, e: raise errors.AnsibleFilterError('log() can only be used on numbers: %s' % str(e)) -def power(x): +def power(x, y): try: - return math.pow(x,y) + return math.pow(x, y) except TypeError, e: raise errors.AnsibleFilterError('pow() can only be used on numbers: %s' % str(e))