isnotanumber is not needed as jinja2 has builtin number test
This commit is contained in:
parent
fe06577ac2
commit
cd4a0c70b0
1 changed files with 0 additions and 36 deletions
|
@ -1,36 +0,0 @@
|
||||||
# (c) 2014, Brian Coca <bcoca@ansible.com>
|
|
||||||
#
|
|
||||||
# This file is part of Ansible
|
|
||||||
#
|
|
||||||
# Ansible is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Ansible is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import math
|
|
||||||
from ansible import errors
|
|
||||||
|
|
||||||
def isnotanumber(x):
|
|
||||||
try:
|
|
||||||
return math.isnan(x)
|
|
||||||
except TypeError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
class TestModule(object):
|
|
||||||
''' Ansible math jinja2 tests '''
|
|
||||||
|
|
||||||
def tests(self):
|
|
||||||
return {
|
|
||||||
# general math
|
|
||||||
'isnan': isnotanumber,
|
|
||||||
}
|
|
Loading…
Reference in a new issue