Skip to content

Commit f9626b5

Browse files
Merge pull request ceph#53722 from rishabh-d-dave/mon-authmon
mon/AuthMonitor: clean up AuthMonitor Reviewed-by: Leonid Usov <[email protected]> Reviewed-by: Xiubo Li <[email protected]> Reviewed-by: Kotresh HR <[email protected]> Reviewed-by: Laura Flores <[email protected]>
2 parents e7200f5 + 8545784 commit f9626b5

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/mon/AuthMonitor.cc

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,23 @@
4242
#define dout_prefix _prefix(_dout, mon, get_last_committed())
4343
using namespace TOPNSPC::common;
4444

45-
using std::cerr;
46-
using std::cout;
47-
using std::dec;
48-
using std::hex;
4945
using std::list;
5046
using std::map;
5147
using std::make_pair;
5248
using std::ostream;
5349
using std::ostringstream;
5450
using std::pair;
5551
using std::set;
56-
using std::setfill;
5752
using std::string;
5853
using std::stringstream;
59-
using std::to_string;
6054
using std::vector;
61-
using std::unique_ptr;
6255

6356
using ceph::bufferlist;
6457
using ceph::decode;
6558
using ceph::encode;
6659
using ceph::Formatter;
67-
using ceph::JSONFormatter;
68-
using ceph::make_message;
69-
using ceph::mono_clock;
70-
using ceph::mono_time;
71-
using ceph::timespan_str;
72-
static ostream& _prefix(std::ostream *_dout, Monitor &mon, version_t v) {
60+
61+
static ostream& _prefix(ostream *_dout, Monitor &mon, version_t v) {
7362
return *_dout << "mon." << mon.name << "@" << mon.rank
7463
<< "(" << mon.get_state_name()
7564
<< ").auth v" << v << " ";
@@ -93,7 +82,7 @@ bool AuthMonitor::check_rotate()
9382
}
9483

9584
void AuthMonitor::process_used_pending_keys(
96-
const std::map<EntityName,CryptoKey>& used_pending_keys)
85+
const map<EntityName,CryptoKey>& used_pending_keys)
9786
{
9887
for (auto& [name, used_key] : used_pending_keys) {
9988
dout(10) << __func__ << " used pending_key for " << name << dendl;
@@ -1714,7 +1703,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
17141703
err = -EINVAL;
17151704
goto done;
17161705
} else {
1717-
mon_cap_string += " fsname=" + std::string(fs->get_mds_map().get_fs_name());
1706+
mon_cap_string += " fsname=" + string(fs->get_mds_map().get_fs_name());
17181707
}
17191708
}
17201709

@@ -1756,7 +1745,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
17561745
mds_cap_string += "allow " + cap;
17571746

17581747
if (filesystem != "*" && filesystem != "all" && fs != nullptr) {
1759-
mds_cap_string += " fsname=" + std::string(fs->get_mds_map().get_fs_name());
1748+
mds_cap_string += " fsname=" + string(fs->get_mds_map().get_fs_name());
17601749
}
17611750

17621751
if (path != "/") {
@@ -2088,7 +2077,7 @@ bool AuthMonitor::_upgrade_format_to_dumpling()
20882077
// set daemon profiles
20892078
if ((p->first.is_osd() || p->first.is_mds()) &&
20902079
mon_caps == "allow rwx") {
2091-
new_caps = string("allow profile ") + std::string(p->first.get_type_name());
2080+
new_caps = string("allow profile ") + string(p->first.get_type_name());
20922081
}
20932082

20942083
// update bootstrap keys

0 commit comments

Comments
 (0)