Exemplo n.º 1
0
 def update_ha_rgw_definitive_hosts(self, spec: ServiceSpec, hosts: List[HostPlacementSpec],
                                    add_hosts: Set[HostPlacementSpec]) -> HA_RGWSpec:
     spec = cast(HA_RGWSpec, spec)
     if not (set(hosts) == set(spec.definitive_host_list)):
         spec.definitive_host_list = hosts
         ha_rgw_daemons = self.mgr.cache.get_daemons_by_service(spec.service_name())
         for daemon in ha_rgw_daemons:
             if daemon.hostname in [h.hostname for h in hosts] and daemon.hostname not in add_hosts:
                 self.mgr.cache.schedule_daemon_action(
                     daemon.hostname, daemon.name(), 'reconfig')
     return spec
Exemplo n.º 2
0
 def update_ha_rgw_definitive_hosts(
         self,
         spec: ServiceSpec,
         hosts: List[DaemonPlacement],
         add_hosts: List[DaemonPlacement]
 ) -> HA_RGWSpec:
     spec = cast(HA_RGWSpec, spec)
     hostnames = [p.hostname for p in hosts]
     add_hostnames = [p.hostname for p in add_hosts]
     if not (set(hostnames) == set(spec.definitive_host_list)):
         spec.definitive_host_list = hostnames
         ha_rgw_daemons = self.mgr.cache.get_daemons_by_service(spec.service_name())
         for daemon in ha_rgw_daemons:
             if daemon.hostname in hostnames and daemon.hostname not in add_hostnames:
                 assert daemon.hostname is not None
                 self.mgr.cache.schedule_daemon_action(
                     daemon.hostname, daemon.name(), 'reconfig')
     return spec