Skip to content

Commit a73d4d0

Browse files
committed
rename connector to delimiter and add configKey.Category.Network
1 parent 0960ca0 commit a73d4d0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
public interface VpcManager {
4343
ConfigKey<Boolean> VpcTierNamePrepend = new ConfigKey<>(Boolean.class,
4444
"vpc.tier.name.prepend",
45-
"Advanced",
45+
ConfigKey.CATEGORY_NETWORK,
4646
"false",
4747
"Whether to prepend the VPC name to the VPC tier network name",
4848
true,
4949
ConfigKey.Scope.Global,
5050
null);
5151
ConfigKey<String> VpcTierNamePrependDelimiter = new ConfigKey<>(String.class,
5252
"vpc.tier.name.prepend.delimiter",
53-
"Advanced",
53+
ConfigKey.CATEGORY_NETWORK,
5454
" ",
5555
"Delimiter string to use between the VPC and the VPC tier name",
5656
true,

server/src/main/java/com/cloud/network/NetworkServiceImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,12 +1789,11 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
17891789
checkNetworkDns(ipv6, ntwkOff, vpcId, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2);
17901790

17911791
if (vpcId != null && VpcManager.VpcTierNamePrepend.value()) {
1792-
final String connector = VpcManager.VpcTierNamePrependDelimiter.value();
1792+
final String delimiter = VpcManager.VpcTierNamePrependDelimiter.value();
17931793
Vpc vpc = _vpcDao.findById(vpcId);
1794-
if (vpc == null) {
1795-
throw new CloudRuntimeException(String.format("VPC with id %s not found", vpcId));
1794+
if (vpc != null) {
1795+
name = vpc.getName() + delimiter + name;
17961796
}
1797-
name = vpc.getName() + connector + name;
17981797
}
17991798

18001799
Network network = commitNetwork(networkOfferingId, gateway, startIP, endIP, netmask, networkDomain, vlanId, bypassVlanOverlapCheck, name, displayText, caller, physicalNetworkId, zone.getId(),

0 commit comments

Comments
 (0)