diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java index 9e6677bb4..333a1e9df 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackHttpClient.java @@ -496,9 +496,7 @@ public Port retrievePort(@NotNull String deviceId) throws OpenstackManagerExcept PortsResponse portsResponse = this.gson.fromJson(entity, PortsResponse.class); if (portsResponse != null && portsResponse.ports != null) { for (Port port : portsResponse.ports) { - logger.debug("Available port - ID: " + port.id + " Device ID: " + port.device_id); if (deviceId.equals(port.device_id)) { - logger.debug("Port selected that matches our device ID: " + port.id); return port; } } @@ -616,8 +614,6 @@ public Floatingip allocateFloatingip(Port port, Network network) throws Openstac try { checkToken(); - logger.debug("Attempting to allocate a floating ID with port ID: " + port.id + " and network ID: " + network.id); - Floatingip fip = new Floatingip(); fip.port_id = port.id; fip.floating_network_id = network.id; @@ -636,8 +632,6 @@ public Floatingip allocateFloatingip(Port port, Network network) throws Openstac StatusLine status = response.getStatusLine(); String entity = EntityUtils.toString(response.getEntity()); - logger.debug("Response body: " + entity); - if (status.getStatusCode() != HttpStatus.SC_CREATED) { throw new OpenstackManagerException("OpenStack create floating ip failed - " + status); } @@ -657,8 +651,6 @@ public Floatingip allocateFloatingip(Port port, Network network) throws Openstac public Network findExternalNetwork(String externalNetwork) throws OpenstackManagerException { - logger.debug("External network name from the CPS: " + externalNetwork); - try { checkToken(); @@ -678,15 +670,8 @@ public Network findExternalNetwork(String externalNetwork) throws OpenstackManag Networks networks = this.gson.fromJson(entity, Networks.class); if (networks != null && networks.networks != null) { for (Network network : networks.networks) { - logger.debug("Available network - ID: " + network.id + " Name: " + network.name + " External? " + network.route_external); if (externalNetwork != null && externalNetwork.equals(network.name)) { - logger.debug("Selected network: " + network.id); return network; - } else { - if (network.route_external) { - logger.debug("External network name was not provided in CPS or no match was found. Selected network: " + network.id); - return network; - } } } } diff --git a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java index 338f96a04..9434937c2 100644 --- a/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java +++ b/galasa-managers-parent/galasa-managers-cloud-parent/dev.galasa.openstack.manager/src/main/java/dev/galasa/openstack/manager/internal/OpenstackServerImpl.java @@ -317,8 +317,10 @@ protected void createServer(ServerRequest serverRequest) throws OpenstackManager // *** Locate the external network String networkName = OpenStackNetworkName.get(); + if (networkName == null) { + throw new OpenstackManagerException("The external network name to allocate a floatingip on was not provided in the CPS"); + } Network network = this.openstackHttpClient.findExternalNetwork(networkName); - if (network == null) { throw new OpenstackManagerException("Unable to select an external network to allocate a floatingip on"); }