DaanHoogland commented on a change in pull request #2653: Generate MAC address 
if the MAC in command addNicToVirtualMachine is invalid
URL: https://github.com/apache/cloudstack/pull/2653#discussion_r189216172
 
 

 ##########
 File path: server/src/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -1158,7 +1158,9 @@ public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) 
throws InvalidParameterV
             }
         }
 
-        if(_nicDao.findByNetworkIdAndMacAddress(networkId, macAddress) != 
null) {
+        macAddress = 
lookForNextAvailableMacAddressInNetworkIfMacIsInvalid(macAddress, 
network.getId());
 
 Review comment:
   @rhtyd the method only changes the mac address if it is not valid. If it is 
provided and not changed it returns the same mac. please see 
lookForNextAvailableMacAddressInNetworkIfMacIsInvalid() below

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to