mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Merge pull request #13460 from yesbox/devel
Adds support for converting a MAC address to an integer
This commit is contained in:
@@ -228,6 +228,9 @@ def _bool_hwaddr_query(v):
|
||||
if v:
|
||||
return True
|
||||
|
||||
def _int_hwaddr_query(v):
|
||||
return int(v)
|
||||
|
||||
def _cisco_query(v):
|
||||
v.dialect = netaddr.mac_cisco
|
||||
return str(v)
|
||||
@@ -637,6 +640,7 @@ def hwaddr(value, query = '', alias = 'hwaddr'):
|
||||
'': _empty_hwaddr_query,
|
||||
'bare': _bare_query,
|
||||
'bool': _bool_hwaddr_query,
|
||||
'int': _int_hwaddr_query,
|
||||
'cisco': _cisco_query,
|
||||
'eui48': _win_query,
|
||||
'linux': _linux_query,
|
||||
|
||||
Reference in New Issue
Block a user