Skip to content

Commit a434e75

Browse files
committed
don't depend on PhysicalNetworkResponse for PhysicalNetworkTrafficType.isolationMethods
1 parent 30e2c3a commit a434e75

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

api/src/main/java/org/apache/cloudstack/api/response/PhysicalNetworkResponse.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ public void setIsolationMethods(List<String> isolationMethods) {
139139
this.isolationMethods = buf.delete(buf.length() - 1, buf.length()).toString();
140140
}
141141

142-
public String getIsolationMethods() {
143-
return isolationMethods;
144-
}
145-
146142
public void setName(String name) {
147143
this.name = name;
148144
}

server/src/main/java/com/cloud/api/ApiResponseHelper.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3082,10 +3082,9 @@ public TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType
30823082
PhysicalNetwork pnet = ApiDBUtils.findPhysicalNetworkById(result.getPhysicalNetworkId());
30833083
if (pnet != null) {
30843084
response.setPhysicalNetworkId(pnet.getUuid());
3085-
// using PhysicalNetworkResponse only to convert isolation methods to string
3086-
PhysicalNetworkResponse pnetResponse = new PhysicalNetworkResponse();
3087-
pnetResponse.setIsolationMethods(pnet.getIsolationMethods());
3088-
response.setIsolationMethods(pnetResponse.getIsolationMethods());
3085+
if (!pnet.getIsolationMethods().isEmpty()) {
3086+
response.setIsolationMethods(String.join(",", pnet.getIsolationMethods()));
3087+
}
30893088
}
30903089
if (result.getTrafficType() != null) {
30913090
response.setTrafficType(result.getTrafficType().toString());

0 commit comments

Comments
 (0)