DaanHoogland commented on code in PR #6425:
URL: https://github.com/apache/cloudstack/pull/6425#discussion_r888762352
##########
server/src/main/java/com/cloud/network/NetworkModelImpl.java:
##########
@@ -2637,4 +2641,42 @@ public String getValidNetworkCidr(Network guestNetwork) {
String networkCidr = guestNetwork.getNetworkCidr();
return networkCidr == null ? guestNetwork.getCidr() : networkCidr;
}
+
+ @Override
+ public Pair<String, String> getNetworkIp4Dns(final Network network, final
DataCenter zone) {
+ String dns1 = null;
+ String dns2 = null;
+ if
(org.apache.commons.lang3.StringUtils.isNotEmpty(network.getDns1())) {
+ dns1 = network.getDns1();
+ if
(org.apache.commons.lang3.StringUtils.isNotEmpty(network.getDns2())) {
+ dns2 = network.getDns2();
+ }
+ }
+ if (org.apache.commons.lang3.StringUtils.isEmpty(dns1)) {
+ dns1 = zone.getDns1();
+ }
+ if (org.apache.commons.lang3.StringUtils.isEmpty(dns2)) {
+ dns2 = zone.getDns2();
+ }
Review Comment:
can we throw an exception if either is `dns1` or `dns2` still `null`?
--
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]