mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
19 lines
350 B
Python
19 lines
350 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
|
|
def _preferred_ip(ip_set, preferred=None):
|
|
'''
|
|
Returns a function that reacts which ip is prefered
|
|
:param ip_set:
|
|
:param private:
|
|
:return:
|
|
'''
|
|
|
|
def _ip_decider(vm, ips):
|
|
for ip in ips:
|
|
if ip in preferred:
|
|
return ip
|
|
return False
|
|
|
|
return _ip_decider
|