From: Dan Mick Date: Wed, 10 Jul 2013 23:47:15 +0000 (-0700) Subject: mon: AuthMonitor: formatted output to 'auth get-or-create[-key]' X-Git-Tag: v0.67-rc1~103 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b18554a6a584f4c3055ccb69d7c4d273eaefc9f6;p=ceph.git mon: AuthMonitor: formatted output to 'auth get-or-create[-key]' Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 9d6f26aa9dfe..c328d0c56ba8 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -788,11 +788,19 @@ bool AuthMonitor::prepare_command(MMonCommand *m) } if (prefix == "auth get-or-create-key") { - ds << entity_auth.key; + if (f) { + entity_auth.key.encode_formatted("auth", f.get(), rdata); + } else { + ds << entity_auth.key; + } } else { KeyRing kr; kr.add(entity, entity_auth.key); - kr.encode_plaintext(rdata); + if (f) { + kr.encode_formatted("auth", f.get(), rdata); + } else { + kr.encode_plaintext(rdata); + } } err = 0; goto done; @@ -827,11 +835,19 @@ bool AuthMonitor::prepare_command(MMonCommand *m) push_cephx_inc(auth_inc); if (prefix == "auth get-or-create-key") { - ds << auth_inc.auth.key; + if (f) { + auth_inc.auth.key.encode_formatted("auth", f.get(), rdata); + } else { + ds << auth_inc.auth.key; + } } else { KeyRing kr; kr.add(entity, auth_inc.auth.key); - kr.encode_plaintext(rdata); + if (f) { + kr.encode_formatted("auth", f.get(), rdata); + } else { + kr.encode_plaintext(rdata); + } } rdata.append(ds);