You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-07 00:35:37 +02:00
Add empty archive array to info command JSON when stanza is missing.
There is an inconsistency when the JSON is output for the case when a stanza is requested and it does not exist in the repo. This was the only case where the archive array was not added to the JSON. Adding it will simplify the upcoming multi-repo support code. Also, a redundant test was removed rather than updating it for this case.
This commit is contained in:
@ -51,6 +51,7 @@ testRun(void)
|
||||
infoRender(),
|
||||
"["
|
||||
"{"
|
||||
"\"archive\":[],"
|
||||
"\"backup\":[],"
|
||||
"\"db\":[],"
|
||||
"\"name\":\"stanza1\","
|
||||
@ -1210,36 +1211,6 @@ testRun(void)
|
||||
" database list: none\n",
|
||||
"text - backup set requested, no db and no checksum error");
|
||||
|
||||
// Stanza not found
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
argList2 = strLstDup(argList);
|
||||
strLstAddZ(argList2, "--stanza=silly");
|
||||
harnessCfgLoad(cfgCmdInfo, argList2);
|
||||
TEST_RESULT_STR_Z(
|
||||
infoRender(),
|
||||
"["
|
||||
"{"
|
||||
"\"backup\":[],"
|
||||
"\"db\":[],"
|
||||
"\"name\":\"silly\","
|
||||
"\"status\":{"
|
||||
"\"code\":1,"
|
||||
"\"lock\":{\"backup\":{\"held\":false}},"
|
||||
"\"message\":\"missing stanza path\""
|
||||
"}"
|
||||
"}"
|
||||
"]",
|
||||
"json - missing stanza path");
|
||||
|
||||
StringList *argListText2 = strLstDup(argListText);
|
||||
strLstAddZ(argListText2, "--stanza=silly");
|
||||
harnessCfgLoad(cfgCmdInfo, argListText2);
|
||||
TEST_RESULT_STR_Z(
|
||||
infoRender(),
|
||||
"stanza: silly\n"
|
||||
" status: error (missing stanza path)\n",
|
||||
"text - missing stanza path");
|
||||
|
||||
// Stanza found
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
strLstAddZ(argList, "--stanza=stanza2");
|
||||
|
Reference in New Issue
Block a user