Skip to content

Commit

Permalink
Avoid unmutable list for OpenStack IA
Browse files Browse the repository at this point in the history
  • Loading branch information
wederbn committed Nov 18, 2023
1 parent 473355a commit b1c8c69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.opentosca.artifacttemplates.openstack;

import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -167,7 +168,7 @@ public void createVM(@RequestPayload CreateVMRequest request, MessageContext mes
logger.info("Created new security group with name: {}", securityGroup);

// open ports within security group
List<String> ports = Arrays.asList(request.getVMOpenPorts().split(","));
List<String> ports = new ArrayList<>(List.of(request.getVMOpenPorts().split(",")));
if (!ports.contains("22")){
// add SSH port if not defined
ports.add("22");
Expand Down

0 comments on commit b1c8c69

Please sign in to comment.