Skip to content

Commit

Permalink
[Filestore] print response of create session command (#1549)
Browse files Browse the repository at this point in the history
Print session id
  • Loading branch information
antonmyagkov committed Jul 22, 2024
1 parent ff0fd65 commit b70b452
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cloud/filestore/apps/client/lib/create_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -42,6 +53,7 @@ class TCreateSessionCommand final
TCallContextPtr ctx = MakeIntrusive<TCallContext>();
auto response = WaitFor(Client->CreateSession(ctx, std::move(request)));
CheckResponse(response);
Print(response, JsonOutput);

return true;
}
Expand Down

0 comments on commit b70b452

Please sign in to comment.