This commit is contained in:
parent
e2b1bf4cda
commit
5f59650d7f
@ -31,7 +31,7 @@ def get_public_ip(url="https://api.ipapi.is/"):
|
||||
def get_internal_networks(tgt="*", fmt="std"):
|
||||
res = []
|
||||
res.extend([net for k, net in __salt__["mine.get"](tgt=tgt, fun='public_ip', tgt_type='compound').items()])
|
||||
res.extend([net for k, nets in __salt__["mine.get"](tgt=tgt, fun='ip_networks', tgt_type='compound').items() for net in nets if __salt__['network.is_private'](net.split("/")[0])])
|
||||
res.extend([net for k, nets in __salt__["mine.get"](tgt=tgt, fun='ip_networks', tgt_type='compound').items() for net in nets if __salt__['network.is_private'](net.split("/")[0]) or net.split("/")[0].startswith("100.64.0")])
|
||||
if fmt == "std":
|
||||
res.extend([net for k, nets in __salt__["mine.get"](tgt=tgt, fun='ip_networks6', tgt_type='compound').items() for net in nets])
|
||||
elif fmt == "postfix":
|
||||
|
Loading…
Reference in New Issue
Block a user