From 253f7d7728e561d5da6532a138b6786e7499e145 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 9 May 2018 18:03:09 +0530 Subject: [PATCH] listostypes: Fixes #2529 return boolean than string in response (#2632) This returns the boolean value of the `isuserdefined` key than converting it to string. Fixes #2529. Signed-off-by: Rohit Yadav --- .../org/apache/cloudstack/api/response/GuestOSResponse.java | 6 +++--- server/src/com/cloud/api/ApiResponseHelper.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java b/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java index 6822288a862..c1a57c3e0e1 100644 --- a/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java +++ b/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java @@ -41,7 +41,7 @@ public class GuestOSResponse extends BaseResponse { @SerializedName(ApiConstants.IS_USER_DEFINED) @Param(description = "is the guest OS user defined") - private String isUserDefined; + private Boolean isUserDefined; public String getId() { return id; @@ -67,11 +67,11 @@ public class GuestOSResponse extends BaseResponse { this.description = description; } - public String getIsUserDefined() { + public Boolean getIsUserDefined() { return isUserDefined; } - public void setIsUserDefined(String isUserDefined) { + public void setIsUserDefined(Boolean isUserDefined) { this.isUserDefined = isUserDefined; } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 88da6342b81..24fecb6d8d9 100644 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -3203,7 +3203,7 @@ public class ApiResponseHelper implements ResponseGenerator { GuestOSResponse response = new GuestOSResponse(); response.setDescription(guestOS.getDisplayName()); response.setId(guestOS.getUuid()); - response.setIsUserDefined(Boolean.valueOf(guestOS.getIsUserDefined()).toString()); + response.setIsUserDefined(guestOS.getIsUserDefined()); GuestOSCategoryVO category = ApiDBUtils.findGuestOsCategoryById(guestOS.getCategoryId()); if (category != null) { response.setOsCategoryId(category.getUuid());