summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-04-16 11:05:57 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-16 11:05:57 +0000
commit152ab4897bf6489e475d8aa68b039884fd56e162 (patch)
treefd24e649384a393931215314e9e18783c309ba67 /adapters
parente48f1fbe2339704e96743d008bee017b1f8faa19 (diff)
parentc502f6cf451b57966344955effcb4a3085766146 (diff)
Merge "Allow client exception to propogate"
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java24
1 files changed, 10 insertions, 14 deletions
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)