nagaboinaramgopal commented on code in PR #14038:
URL: https://github.com/apache/cloudstack/pull/14038#discussion_r3951260262
##########
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java:
##########
@@ -1120,9 +1120,9 @@ private NicVO checkForRaceAndAllocateNic(final NicProfile
requested, final Netwo
}
if (vo == null) {
- if (requested.getRequestedIPv4() != null) {
+ if (requested != null && requested.getRequestedIPv4() != null)
{
throw new
InsufficientVirtualNetworkCapacityException("Unable to acquire requested Guest
IP address " + requested.getRequestedIPv4() + " for network " + network,
DataCenter.class, dcVo.getId());
- } else {
+ } else if (requested != null) {
requested.setIPv4Address(null);
}
Review Comment:
Applied, thanks @DaanHoogland . Folded the requested-IPv4 throw and the
address reset under a single `requested != null` guard as you suggested.
`NetworkOrchestratorNicRaceTest` still passes.
--
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]