rafaelweingartner 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_r189858968
 
 

 ##########
 File path: server/src/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -1228,6 +1230,19 @@ public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) 
throws InvalidParameterV
         return _vmDao.findById(vmInstance.getId());
     }
 
+    /**
+     * If the given MAC address is invalid it replaces the given MAC with the 
next available MAC address
+     */
+    protected String validateOrReplaceMacAddress(String macAddress, long 
networkId) {
+        if (!NetUtils.isValidMac(macAddress)) {
 
 Review comment:
   Well.. yes and no. It depends on how the API is handling this case. I am not 
sure if all (`blank`, `empty`, `null`) will be represented as the same. I mean, 
I do not know if whenever we enter a blank or empty case, if these values will 
be treated as `null`  by ACS.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to