DaanHoogland commented on a change in pull request #5194:
URL: https://github.com/apache/cloudstack/pull/5194#discussion_r668533864



##########
File path: 
server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
##########
@@ -617,8 +617,8 @@ private void 
checkUnmanagedNicAndNetworkForImport(UnmanagedInstanceTO.Nic nic, N
         }
         if (nic.getVlan() != null && nic.getVlan() != 0 && nic.getPvlan() != 
null && nic.getPvlan() != 0 &&
                 (Strings.isNullOrEmpty(network.getBroadcastUri().toString()) ||
-                        
!networkBroadcastUri.equals(String.format("pvlan://%d-i%d", nic.getVlan(), 
nic.getPvlan())))) {
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, 
String.format("PVLAN of network(ID: %s) %s is found different from the VLAN of 
nic(ID: %s) pvlan://%d-i%d during VM import", network.getUuid(), 
networkBroadcastUri, nic.getNicId(), nic.getVlan(), nic.getPvlan()));
+                        
!networkBroadcastUri.equals(String.format("pvlan://%d-%s%d", nic.getVlan(), 
nic.getPvlanType().charAt(0), nic.getPvlan())))) {

Review comment:
       living dangerously, huh? as it is used twice anyway, better prepare it 
in a var above.




-- 
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]


Reply via email to