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
fe06577a
Commit
fe06577a
authored
Aug 20, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed mandatory test
parent
b5a078a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
lib/ansible/plugins/test/core.py
+8
-9
No files found.
lib/ansible/plugins/test/core.py
View file @
fe06577a
...
...
@@ -58,15 +58,6 @@ def skipped(*a, **kw):
skipped
=
item
.
get
(
'skipped'
,
False
)
return
skipped
def
mandatory
(
a
):
''' Make a variable mandatory '''
try
:
a
except
NameError
:
raise
errors
.
AnsibleFilterError
(
'Mandatory variable not defined.'
)
else
:
return
a
def
regex
(
value
=
''
,
pattern
=
''
,
ignorecase
=
False
,
match_type
=
'search'
):
''' Expose `re` as a boolean filter using the `search` method by default.
This is likely only useful for `search` and `match` which already
...
...
@@ -88,6 +79,14 @@ def search(value, pattern='', ignorecase=False):
''' Perform a `re.search` returning a boolean '''
return
regex
(
value
,
pattern
,
ignorecase
,
'search'
)
def
mandatory
(
a
):
from
jinja2.runtime
import
Undefined
''' Make a variable mandatory '''
if
isinstance
(
a
,
Undefined
):
raise
errors
.
AnsibleFilterError
(
'Mandatory variable not defined.'
)
return
a
class
TestModule
(
object
):
''' Ansible core jinja2 tests '''
...
...
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