From 7da0320c56510f941e86c0cdef13dc5126acadad Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 10 Jul 2013 16:44:56 -0700 Subject: [PATCH] mon: AuthMonitor: dump formatted and plaintext key on 'get-key' Signed-off-by: Joao Eduardo Luis --- src/mon/AuthMonitor.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 9e2aed4b74a..9d6f26aa9df 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -617,7 +617,11 @@ bool AuthMonitor::preprocess_command(MMonCommand *m) r = -ENOENT; goto done; } - ds << auth.key; + if (f) { + auth.key.encode_formatted("auth", f.get(), rdata); + } else { + auth.key.encode_plaintext(rdata); + } r = 0; } else if (prefix == "auth list") { mon->key_server.list_secrets(ss, ds);