Show all etcd addresses in the "reporting to..." message

rm-left-on-dead
Vitaliy Filippov 2022-06-04 00:42:35 +03:00
parent 36e851505a
commit 3e1b03bb5c
1 changed files with 5 additions and 1 deletions

View File

@ -390,7 +390,11 @@ void osd_t::acquire_lease()
etcd_lease_id = data["ID"].string_value();
create_osd_state();
});
printf("[OSD %lu] reporting to etcd at %s every %d seconds\n", this->osd_num, config["etcd_address"].string_value().c_str(), etcd_report_interval);
printf(
"[OSD %lu] reporting to etcd at %s every %d seconds\n", this->osd_num,
(config["etcd_address"].is_string() ? config["etcd_address"].string_value() : config["etcd_address"].dump()).c_str(),
etcd_report_interval
);
tfd->set_timer(etcd_report_interval*1000, true, [this](int timer_id)
{
renew_lease();