You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2020/11/13 08:08:16 UTC

[cloudstack] branch 4.13 updated: Fix IndexOutOfBoundsException when creating basic network (#4464)

This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.13
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.13 by this push:
     new cc8bee7  Fix IndexOutOfBoundsException when creating basic network (#4464)
cc8bee7 is described below

commit cc8bee722323039faf2a1a198ac73356d785d23e
Author: slavkap <51...@users.noreply.github.com>
AuthorDate: Fri Nov 13 10:07:40 2020 +0200

    Fix IndexOutOfBoundsException when creating basic network (#4464)
    
    For Basic network isolation methods are not provided, and exception is
    thrown when trying to encode the Vlan id. That's why we have to check
    before encoding that the list with isolation methods is not empty
---
 .../org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index c49da14..65172b2 100644
--- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -2484,7 +2484,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
             throw new InvalidParameterValueException(String.format("Failed to encode VLAN/VXLAN %s into a Broadcast URI. Physical Network cannot be null.", vlanId));
         }
 
-        if(StringUtils.isNotBlank(pNtwk.getIsolationMethods().get(0))) {
+        if(!pNtwk.getIsolationMethods().isEmpty() && StringUtils.isNotBlank(pNtwk.getIsolationMethods().get(0))) {
             String isolationMethod = pNtwk.getIsolationMethods().get(0).toLowerCase();
             String vxlan = BroadcastDomainType.Vxlan.toString().toLowerCase();
             if(isolationMethod.equals(vxlan)) {