From b70b4520486e22d393854de53ac5f00f1819b5fa Mon Sep 17 00:00:00 2001 From: Anton Myagkov Date: Mon, 15 Jul 2024 19:29:06 +0200 Subject: [PATCH] [Filestore] print response of create session command (#1549) Print session id --- cloud/filestore/apps/client/lib/create_session.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cloud/filestore/apps/client/lib/create_session.cpp b/cloud/filestore/apps/client/lib/create_session.cpp index 575b6c8f4b..6e6bd95dc4 100644 --- a/cloud/filestore/apps/client/lib/create_session.cpp +++ b/cloud/filestore/apps/client/lib/create_session.cpp @@ -8,6 +8,17 @@ namespace { //////////////////////////////////////////////////////////////////////////////// +void Print(const NProto::TCreateSessionResponse& response, bool jsonOutput) +{ + if (jsonOutput) { + Cout << response.AsJSON() << Endl; + } else { + Cout << response.DebugString() << Endl; + } +} + +//////////////////////////////////////////////////////////////////////////////// + class TCreateSessionCommand final : public TFileStoreCommand { @@ -42,6 +53,7 @@ class TCreateSessionCommand final TCallContextPtr ctx = MakeIntrusive(); auto response = WaitFor(Client->CreateSession(ctx, std::move(request))); CheckResponse(response); + Print(response, JsonOutput); return true; }