You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/07/13 08:16:42 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5194: adapt condition to use the correct letter for pvlan types

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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org