diff options
author | Steve Smokowski <ss835w@att.com> | 2020-04-16 11:05:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-04-16 11:05:57 +0000 |
commit | 152ab4897bf6489e475d8aa68b039884fd56e162 (patch) | |
tree | fd24e649384a393931215314e9e18783c309ba67 /adapters | |
parent | e48f1fbe2339704e96743d008bee017b1f8faa19 (diff) | |
parent | c502f6cf451b57966344955effcb4a3085766146 (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.java | 24 |
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) |