return trivial_result([])
config_func = config_fns.get(daemon_type, None)
- service_name = spec.service_name()
- self.log.debug('Applying service %s spec' % service_name)
daemons = self.cache.get_daemons_by_service(service_name)
+
+ public_network = None
+ if daemon_type == 'mon':
+ ret, out, err = self.mon_command({
+ 'prefix': 'config get',
+ 'who': 'mon',
+ 'key': 'public_network',
+ })
+ if '/' in out:
+ public_network = out.strip()
+ self.log.debug('mon public_network is %s' % public_network)
+
+ def matches_network(host):
+ # type: (str) -> bool
+ if not public_network:
+ return False
+ # make sure we have 1 or more IPs for that network on that
+ # host
+ return len(self.cache.networks[host].get(public_network, [])) > 0
+
hosts = HostAssignment(
spec=spec,
get_hosts_func=self._get_hosts,