def _update_felix_status(self, ttl): """ Writes two keys to etcd: * uptime in secs * felix status in JSON - containing current time in ISO 8601 Zulu format :param: ttl int: time to live in sec - lifetime of the status report """ time_formatted = iso_utc_timestamp() uptime = monotonic_time() - self._start_time status = { "time": time_formatted, "uptime": uptime, "first_update": not self.done_first_status_report, } status_value = json.dumps(status) _log.debug("Reporting felix status/uptime (%.1fs) using hostname %s", uptime, self._config.HOSTNAME) status_key = key_for_last_status(self._config.HOSTNAME) self.client.set(status_key, status_value) status_key = key_for_status(self._config.HOSTNAME) self.client.set(status_key, status_value, ttl=ttl) self.done_first_status_report = True