cerr << "no caps granted to: " << auth_inc.name << std::endl;
return -EINVAL;
}
+ map<string,string> caps;
+ std::transform(begin(auth_inc.auth.caps), end(auth_inc.auth.caps),
+ inserter(caps, end(caps)),
+ [](auto& cap) {
+ string c;
+ auto p = cap.second.cbegin();
+ decode(c, p);
+ return make_pair(cap.first, c);
+ });
+ cout << "adding auth for '"
+ << auth_inc.name << "': " << auth_inc.auth
+ << " with caps(" << caps << ")" << std::endl;
auth_inc.op = KeyServerData::AUTH_INC_ADD;
AuthMonitor::Incremental inc;
inc.inc_type = AuthMonitor::AUTH_DATA;
encode(auth_inc, inc.auth_data);
inc.auth_type = CEPH_AUTH_CEPHX;
-
inc.encode(bl, CEPH_FEATURES_ALL);
}
auto last_osdmap_epoch = st.get("osdmap", "last_committed");
int r = st.get("osdmap", st.combine_strings("full", last_osdmap_epoch), bl);
if (r < 0) {
- cerr << "unable to losd osdmap e" << last_osdmap_epoch << std::endl;
+ cerr << "unable to load osdmap e" << last_osdmap_epoch << std::endl;
return r;
}
creating.last_scan_epoch = last_osdmap_epoch;
bufferlist newbl;
- ::encode(creating, newbl);
+ encode(creating, newbl, CEPH_FEATURES_ALL);
auto t = make_shared<MonitorDBStore::Transaction>();
t->put("osd_pg_creating", "creating", newbl);
} else if (cmd == "get") {
unsigned v = 0;
string outpath;
- bool readable = false;
string map_type;
// visible options for this command
po::options_description op_desc("Allowed 'get' options");
"output file (default: stdout)")
("version,v", po::value<unsigned>(&v),
"map version to obtain")
- ("readable,r", po::value<bool>(&readable)->default_value(false),
- "print the map information in human readable format")
+ ("readable,r", "print the map information in human readable format")
;
// this is going to be a positional argument; we don't want to show
// it as an option during --help, but we do want to have it captured
goto done;
}
- if (readable) {
+ if (op_vm.count("readable")) {
stringstream ss;
bufferlist out;
try {