def on_tick(self): # This procedure is to catch the annoying case of AES key changes (#7836), which are otherwise # ignored by minions which are doing only minion->master messaging. To ensure they # pick up on key changes, we actively send them something (doesn't matter what). To # avoid doing this constantly, we only send things to minions which seem to be a little # late # After this length of time, doubt a minion enough to send it a message in case # it needs a kick to update its key def _ping_period(fqdn): return datetime.timedelta(seconds=self.get_contact_period(fqdn) * 2) t = now() late_servers = [s.fqdn for s in self.servers.values() if s.last_contact and (t - s.last_contact) > _ping_period(s.fqdn)] log.debug("late servers: %s" % late_servers) if late_servers: client = LocalClient(config.get('cthulhu', 'salt_config_path')) pub = client.pub(late_servers, "test.ping", expr_form='list') log.debug(pub)
def on_tick(self): # This procedure is to catch the annoying case of AES key changes (#7836), which are otherwise # ignored by minions which are doing only minion->master messaging. To ensure they # pick up on key changes, we actively send them something (doesn't matter what). To # avoid doing this constantly, we only send things to minions which seem to be a little # late # After this length of time, doubt a minion enough to send it a message in case # it needs a kick to update its key def _ping_period(fqdn): return datetime.timedelta(seconds=self.get_contact_period(fqdn) * 2) t = now() late_servers = [ s.fqdn for s in self.servers.values() if s.last_contact and (t - s.last_contact) > _ping_period(s.fqdn) ] log.debug("late servers: %s" % late_servers) if late_servers: client = LocalClient(config.get('cthulhu', 'salt_config_path')) pub = client.pub(late_servers, "test.ping", expr_form='list') log.debug(pub)