CLOUDSTACK-10253: JSON response for SuccessResponse as boolean instead of string (#2428)

* JSON response for SuccessResponse as boolean instead of string

Signed-off-by: Marc-Aurèle Brothier <m@brothier.org>

* Fixing test cases
This commit is contained in:
Marc-Aurèle Brothier 2018-04-28 02:07:51 +02:00 committed by Rafael Weingärtner
parent e4537e9d39
commit 586edec7ac
2 changed files with 3 additions and 7 deletions

View File

@ -131,12 +131,8 @@ public class ApiResponseSerializer {
sb.append("}");
log.append("}");
}
} else if (result instanceof SuccessResponse) {
sb.append("{\"success\":\"").append(((SuccessResponse)result).getSuccess()).append("\"}");
log.append("{\"success\":\"").append(((SuccessResponse)result).getSuccess()).append("\"}");
} else if (result instanceof ExceptionResponse) {
String jsonErrorText = responseBuilder.toJson(result);
jsonErrorText = unescape(jsonErrorText);
} else if (result instanceof SuccessResponse || result instanceof ExceptionResponse) {
final String jsonErrorText = unescape(responseBuilder.toJson(result));
sb.append(jsonErrorText);
log.append(jsonErrorText);
} else {

View File

@ -161,7 +161,7 @@ class TestHostHA(cloudstackTestCase):
cmd.recover = recover
cmd.fence = fence
response = self.apiclient.configureSimulatorHAProviderState(cmd)
self.assertEqual(response.success, 'true')
self.assertEqual(response.success, True)
def getSimulatorHAStateTransitions(self, hostId):