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
b3af2f9b
Commit
b3af2f9b
authored
Feb 02, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error message
parent
f6e8ddfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
lib/ansible/runner/filter_plugins/ipaddr.py
+7
-4
No files found.
lib/ansible/runner/filter_plugins/ipaddr.py
View file @
b3af2f9b
...
...
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from
ansible
import
errors
from
functools
import
partial
try
:
import
netaddr
...
...
@@ -27,6 +27,8 @@ else:
pass
mac_linux
.
word_fmt
=
'
%.2
x'
from
ansible
import
errors
# ---- IP address and network query helpers ----
...
...
@@ -595,8 +597,9 @@ def hwaddr(value, query = '', alias = 'hwaddr'):
def
macaddr
(
value
,
query
=
''
):
return
hwaddr
(
value
,
query
,
alias
=
'macaddr'
)
def
_need_netaddr
(
*
args
,
**
kwargs
):
raise
errors
.
AnsibleFilterError
(
'python-netaddr package is not installed'
)
def
_need_netaddr
(
f_name
,
*
args
,
**
kwargs
):
raise
errors
.
AnsibleFilterError
(
'The {0} filter requires python-netaddr be'
' installed on the ansible controller'
.
format
(
f_name
))
# ---- Ansible filters ----
...
...
@@ -620,4 +623,4 @@ class FilterModule(object):
return
self
.
filter_map
else
:
# Need to install python-netaddr for these filters to work
return
dict
((
f
,
_need_netaddr
)
for
f
in
self
.
filter_map
)
return
dict
((
f
,
partial
(
_need_netaddr
,
f
)
)
for
f
in
self
.
filter_map
)
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