diff options
Diffstat (limited to 'adapters/mso-adapter-utils/src/main/java')
3 files changed, 20 insertions, 9 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java index 00602af216..8fbccaaf69 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java @@ -128,6 +128,6 @@ public class KeystoneV3Authentication { } } } - throw new ServiceEndpointNotFoundException("endpoint url not found"); + throw new ServiceEndpointNotFoundException("endpoint url not found: type:" + type +" region: " + region + " facing: " + facing); } } diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java index f50a6fd1bd..97e1627fd3 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java @@ -1047,7 +1047,11 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin{ } } else if (type.equalsIgnoreCase("json")) { try { - return JSON_MAPPER.writeValueAsString(inputValue); + if (inputValue instanceof String) { + return JSON_MAPPER.readTree(inputValue.toString()); + } + //will already marshal to json without intervention + return inputValue; } catch (Exception e) { logger.debug("Unable to convert {} to a JsonNode!", inputValue); diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java index ee1c79c09c..012c560689 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java @@ -38,6 +38,8 @@ import com.woorea.openstack.keystone.Keystone; import com.woorea.openstack.keystone.model.Access; import com.woorea.openstack.keystone.model.Authentication; import com.woorea.openstack.keystone.utils.KeystoneUtils; + +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; @@ -999,6 +1001,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ OpenStackRequest <Stack> request = heatClient.getStacks ().byName (stackName); return executeAndRecordOpenstackRequest (request); } catch (OpenStackResponseException e) { + logger.error("Error in Query Stack", e); if (e.getStatus () == 404) { logger.debug ("queryHeatStack - stack not found: {}", stackName); return null; @@ -1355,18 +1358,22 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ } } else if ("json".equalsIgnoreCase(type)) { Object jsonObj = inputs.get(key); - String jsonString; + Object json; try { - jsonString = JSON_MAPPER.writeValueAsString(jsonObj); - } catch (JsonProcessingException e) { + if (jsonObj instanceof String) { + json = JSON_MAPPER.readTree(jsonObj.toString()); + } else { + //will already marshal to json without intervention + json = jsonObj; + } + } catch (IOException e) { logger.error("failed to map to json, directly converting to string instead", e); - jsonString = jsonObj.toString(); + json = jsonObj.toString(); } if (alias) - newInputs.put(realName, jsonString); + newInputs.put(realName, json); else - newInputs.put(key, jsonString); - //} + newInputs.put(key, json); } else if ("comma_delimited_list".equalsIgnoreCase(type)) { String commaSeparated = inputs.get(key).toString(); try { |