DaanHoogland commented on code in PR #8151:
URL: https://github.com/apache/cloudstack/pull/8151#discussion_r1378585674
##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -3082,6 +3082,10 @@ public TrafficTypeResponse
createTrafficTypeResponse(PhysicalNetworkTrafficType
PhysicalNetwork pnet =
ApiDBUtils.findPhysicalNetworkById(result.getPhysicalNetworkId());
if (pnet != null) {
response.setPhysicalNetworkId(pnet.getUuid());
+ // using PhysicalNetworkResponse only to convert isolation methods
to string
+ PhysicalNetworkResponse pnetResponse = new
PhysicalNetworkResponse();
+ pnetResponse.setIsolationMethods(pnet.getIsolationMethods());
+ response.setIsolationMethods(pnetResponse.getIsolationMethods());
Review Comment:
@madhukar93, I am not sure about the dependency tree for responses but
importing a response for the sole purpose of getting a field well formatted for
another response seems a bit dodgy to me.
Overloading with only a different return value is not going to work.
I think a dependency for both `PhysicalNetworkResponse` and
`TrafficTypeResponse` should be found or created and the logic moved there.
Just calling a `String.join()` would work as well, but a common method to
use in all places that need this formatting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]