mon: Add a Session operator<<, use it in OSDMonitor

This commit is contained in:
Greg Farnum 2010-03-15 14:45:30 -07:00
parent 7af73ac84b
commit 390258a73f
2 changed files with 9 additions and 0 deletions

View File

@ -1007,6 +1007,7 @@ int OSDMonitor::prepare_new_pool(MPoolOp *m)
{
//check permissions for the auid, then pass off to next function
Session * session = (Session *) m->get_connection()->get_priv();
dout(10) << "prepare_new_pool from Session " << std::endl << session << dendl;
if (m->auid) {
if(session->caps.check_privileges(PAXOS_OSDMAP, MON_CAP_W, m->auid)) {
return prepare_new_pool(m->name, m->auid);

View File

@ -126,4 +126,12 @@ struct SessionMap {
}
};
inline ostream& operator<<(ostream& out, const Session *s)
{
out << "Session: " << s->inst << " is "
<< (s->closed ? "closed" : "open");
out << s->caps;
return out;
}
#endif