You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS X Yosemite 10.10.5 (14F1909)
14.5.0 Darwin Kernel Version 14.5.0: Thu Jun 16 19:58:21 PDT 2016; root:xnu-2782.50.4~1/RELEASE_X86_64 x86_64
Python 2.7.10
netaddr 0.7.18
##### SUMMARY
When specifying an address which is prefixed with /32 then the Jinja filter just renders an empty string. Also the Jinja filter does not allow prefixlen as query method - even if the locally installed version supports this method.
netaddr seems to work correctly.
##### STEPS TO REPRODUCE
Try to render this:
{{ 192.168.0.1/32 | ipaddr('netmask') }}
$ python -i
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from netaddr import *
>>> ip = IPNetwork('192.0.0.1/32')
>>> ip.netmask
IPAddress('255.255.255.255')
>>> ip.prefixlen
32
>>> ip = IPNetwork('192.0.0.1/24')
>>> ip.netmask
When trying larger prefix length that 32 it works correctly.
ISSUE TYPE
COMPONENT NAME
Jinja2 ipaddr() filter
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
EXPECTED RESULTS
ACTUAL RESULTS
I verified that netaddr is working correctly.
When trying larger prefix length that 32 it works correctly.
Also I noticed that prefixlen is not supported as method.
The text was updated successfully, but these errors were encountered: