Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
c808c8a2
Commit
c808c8a2
authored
Dec 16, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some of the new math filters
parent
7ab1e525
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
lib/ansible/runner/filter_plugins/math.py
+4
-4
No files found.
lib/ansible/runner/filter_plugins/math.py
View file @
c808c8a2
...
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment