aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-adapter-utils
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-adapter-utils')
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java1
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java24
2 files changed, 10 insertions, 15 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
index 3e28e5c45a..9a9bccfb5d 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java
@@ -24,7 +24,6 @@ package org.onap.so.openstack.utils;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.List;
import java.util.Optional;
import org.onap.so.cloud.CloudConfig;
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java
index 4dc139f37d..5d28eaaf71 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java
@@ -20,6 +20,7 @@
package org.onap.so.openstack.utils;
+import java.io.IOException;
import org.onap.so.cloud.authentication.KeystoneAuthHolder;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
@@ -224,20 +225,15 @@ public class NovaClientImpl extends MsoCommonUtils {
}
public void postActionToServer(String cloudSiteId, String tenantId, String id, String request)
- throws NovaClientException {
- try {
- ObjectMapper mapper = new ObjectMapper();
- JsonNode actualObj = mapper.readTree(request);
- Entity<JsonNode> openstackEntity = new Entity<>(actualObj, "application/json");
- CharSequence actionPath = "/servers/" + id + "/action";
- Nova novaClient = getNovaClient(cloudSiteId, tenantId);
- OpenStackRequest<Void> OSRequest =
- new OpenStackRequest<>(novaClient, HttpMethod.POST, actionPath, openstackEntity, Void.class);
- executeAndRecordOpenstackRequest(OSRequest, false);
- } catch (Exception e) {
- logger.error("Error building Nova Client", e);
- throw new NovaClientException("Error building Nova Client", e);
- }
+ throws IOException, MsoException {
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode actualObj = mapper.readTree(request);
+ Entity<JsonNode> openstackEntity = new Entity<>(actualObj, "application/json");
+ CharSequence actionPath = "/servers/" + id + "/action";
+ Nova novaClient = getNovaClient(cloudSiteId, tenantId);
+ OpenStackRequest<Void> OSRequest =
+ new OpenStackRequest<>(novaClient, HttpMethod.POST, actionPath, openstackEntity, Void.class);
+ executeAndRecordOpenstackRequest(OSRequest, false);
}
public void attachVolume(String cloudSiteId, String tenantId, String serverId, VolumeAttachment volumeAttachment)