MXS-1354: Fix diagnostic output

The tests failed due to changes in the diagnostic output.
This commit is contained in:
Markus Mäkelä
2017-08-11 16:50:57 +03:00
parent af4e852649
commit f0c2843195
2 changed files with 26 additions and 9 deletions

View File

@ -579,17 +579,25 @@ admin_verify_inet_user(const char *username, const char *password)
*/
void dcb_PrintAdminUsers(DCB *dcb)
{
dcb_printf(dcb, "Enabled Linux accounts (secure):\n");
dcb_printf(dcb, "Enabled Linux accounts (secure) : ");
if (linux_users)
{
users_diagnostic(dcb, linux_users);
}
else
{
dcb_printf(dcb, "\n");
}
dcb_printf(dcb, "Created network accounts (insecure):\n");
dcb_printf(dcb, "Created network accounts (insecure): ");
if (inet_users)
{
users_diagnostic(dcb, inet_users);
}
else
{
dcb_printf(dcb, "\n");
}
}

View File

@ -88,8 +88,6 @@ public:
{
if (m_data.size())
{
dcb_printf(dcb, "User names: ");
const char *sep = "";
for (UserMap::const_iterator it = m_data.begin(); it != m_data.end(); it++)
@ -99,10 +97,11 @@ public:
}
dcb_printf(dcb, "\n");
}
else
{
dcb_printf(dcb, "Users table is empty\n");
}
bool empty() const
{
return m_data.size() > 0;
}
private:
@ -170,9 +169,19 @@ void users_default_diagnostic(DCB* dcb, SERV_LISTENER* port)
{
if (port->users)
{
Users* u = reinterpret_cast<Users*>(port->users);
if (u->empty())
{
dcb_printf(dcb, "Users table is empty\n");
}
else
{
dcb_printf(dcb, "User names: ");
users_diagnostic(dcb, port->users);
}
}
}
json_t* users_default_diagnostic_json(const SERV_LISTENER *port)
{