Improve "standby switchover" --dry-run output

This commit is contained in:
Ian Barwick
2017-08-10 22:43:05 +09:00
parent 8a50a72dc5
commit 1292e8991a

View File

@@ -1994,10 +1994,16 @@ do_standby_switchover(void)
*/ */
if (runtime_options.dry_run == true) if (runtime_options.dry_run == true)
{ {
char shutdown_command[MAXLEN] = "";
strncpy(shutdown_command, command_output.data, MAXLEN);
termPQExpBuffer(&command_output);
string_remove_trailing_newlines(shutdown_command);
log_info(_("following shutdown command would be run on node \"%s\":\n \"%s\""), log_info(_("following shutdown command would be run on node \"%s\":\n \"%s\""),
remote_node_record.node_name, remote_node_record.node_name,
command_output.data); shutdown_command);
termPQExpBuffer(&command_output);
return; return;
} }