{
ldout(cct, 10) << __func__ << dendl;
- if (mon_id.empty()) {
+ string new_mon_id;
+ if (monmap.contains("noname-"+mon_id)) {
+ new_mon_id = "noname-"+mon_id;
+ } else {
+ new_mon_id = mon_id;
+ }
+
+ if (new_mon_id.empty()) {
ldout(cct, 10) << __func__ << " specified mon id is empty!" << dendl;
return -EINVAL;
- } else if (!monmap.contains(mon_id)) {
- ldout(cct, 10) << __func__ << " no such monitor 'mon." << mon_id << "'"
+ } else if (!monmap.contains(new_mon_id)) {
+ ldout(cct, 10) << __func__ << " no such monitor 'mon." << new_mon_id << "'"
<< dendl;
return -ENOENT;
}
smsgr->add_dispatcher_head(pinger);
smsgr->start();
- ConnectionRef con = smsgr->get_connection(monmap.get_inst(mon_id));
- ldout(cct, 10) << __func__ << " ping mon." << mon_id
+ ConnectionRef con = smsgr->get_connection(monmap.get_inst(new_mon_id));
+ ldout(cct, 10) << __func__ << " ping mon." << new_mon_id
<< " " << con->get_peer_addr() << dendl;
con->send_message(new MPing);