1
0

__init__.py 351 B

123456789101112131415161718
  1. # -*- coding: utf-8 -*-
  2. def _preferred_ip(ip_set, preferred=None):
  3. '''
  4. Returns a function that reacts which ip is preferred
  5. :param ip_set:
  6. :param private:
  7. :return:
  8. '''
  9. def _ip_decider(vm, ips):
  10. for ip in ips:
  11. if ip in preferred:
  12. return ip
  13. return False
  14. return _ip_decider