Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public abstract class NetworkOfferingBaseCmd extends BaseCmd {
description = "the routing mode for the network offering. Supported types are: Static or Dynamic.")
private String routingMode;

private Map<String, String> sourceDetailsMap;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -430,9 +432,8 @@ public Map<Network.Capability, String> getServiceCapabilities(Network.Service se

public Map<String, String> getDetails() {
if (details == null || details.isEmpty()) {
return null;
return sourceDetailsMap;
}
Comment on lines 433 to 436
Comment on lines 433 to 436

Collection paramsCollection = details.values();
Object objlist[] = paramsCollection.toArray();
Map<String, String> params = (Map<String, String>) (objlist[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8486,8 +8486,11 @@ private void applySourceOfferingValuesToCloneCmd(CloneNetworkOfferingCmd cmd,
private Map<String, String> getSourceOfferingDetails(Long sourceOfferingId) {
List<NetworkOfferingDetailsVO> sourceDetailsVOs = networkOfferingDetailsDao.listDetails(sourceOfferingId);
Map<String, String> sourceDetailsMap = new HashMap<>();
Set<String> ignoredSourceDetails = new HashSet<>(Arrays.asList(Detail.internetProtocol.name(), Detail.domainid.name(), Detail.zoneid.name()));
for (NetworkOfferingDetailsVO detailVO : sourceDetailsVOs) {
sourceDetailsMap.put(detailVO.getName(), detailVO.getValue());
if (!ignoredSourceDetails.contains(detailVO.getName())) {
sourceDetailsMap.put(detailVO.getName(), detailVO.getValue());
}
}
return sourceDetailsMap;
}
Expand Down Expand Up @@ -8635,7 +8638,7 @@ private void applyResolvedValuesToCommand(CloneNetworkOfferingCmd cmd, NetworkOf

if (cmd.getDetails() == null || cmd.getDetails().isEmpty()) {
if (!sourceDetailsMap.isEmpty()) {
setField(cmd, "details", sourceDetailsMap);
setField(cmd, "sourceDetailsMap", sourceDetailsMap);
}
Comment thread
weizhouapache marked this conversation as resolved.
}

Expand Down
Loading