Merge "Reorder modifiers"
[so.git] / adapters / mso-adapter-utils / src / main / java / org / openecomp / mso / openstack / utils / MsoHeatUtilsWithUpdate.java
index 0e0b9cb..08ae9df 100644 (file)
@@ -26,10 +26,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.ObjectMapper;
-
 import org.openecomp.mso.cloud.CloudConfigFactory;
 import org.openecomp.mso.cloud.CloudSite;
 import org.openecomp.mso.logger.MessageEnum;
@@ -42,12 +38,16 @@ import org.openecomp.mso.openstack.exceptions.MsoStackNotFound;
 import org.openecomp.mso.properties.MsoJavaProperties;
 import org.openecomp.mso.properties.MsoPropertiesException;
 import org.openecomp.mso.properties.MsoPropertiesFactory;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.woorea.openstack.base.client.OpenStackBaseException;
 import com.woorea.openstack.base.client.OpenStackRequest;
 import com.woorea.openstack.heat.Heat;
 import com.woorea.openstack.heat.model.Stack;
-import com.woorea.openstack.heat.model.UpdateStackParam;
 import com.woorea.openstack.heat.model.Stack.Output;
+import com.woorea.openstack.heat.model.UpdateStackParam;
 
 public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
 
@@ -193,7 +193,7 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
         }
 
         // Obtain the cloud site information where we will create the stack
-        CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId).orElseThrow(
+        CloudSite cloudSite = getCloudConfigFactory().getCloudConfig().getCloudSite(cloudSiteId).orElseThrow(
                 () -> new MsoCloudSiteNotFound(cloudSiteId));
         // Get a Heat client. They are cached between calls (keyed by tenantId:cloudId)
         // This could throw MsoTenantNotFound or MsoOpenstackException (both propagated)
@@ -230,7 +230,7 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
         if (haveFiles && haveHeatFiles) {
             // Let's do this here - not in the bean
             LOGGER.debug ("Found files AND heatFiles - combine and add!");
-            Map <String, Object> combinedFiles = new HashMap <String, Object> ();
+            Map <String, Object> combinedFiles = new HashMap<>();
             for (String keyString : files.keySet ()) {
                 combinedFiles.put (keyString, files.get (keyString));
             }
@@ -358,7 +358,7 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
                        sb.append("(outputs is empty)");
                        return sb;
                }
-               Map<String, Object> outputs = new HashMap<String,Object>();
+               Map<String, Object> outputs = new HashMap<>();
                for (Output outputItem : outputList) {
                        outputs.put(outputItem.getOutputKey(), outputItem.getOutputValue());
                }
@@ -428,8 +428,6 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
                        final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
                        final String json = JSON_MAPPER.writeValueAsString(obj);
                        return json;
-               } catch (JsonParseException jpe) {
-                       LOGGER.debug("Error converting json to string " + jpe.getMessage(), jpe);
                } catch (Exception e) {
                        LOGGER.debug("Error converting json to string " + e.getMessage(), e);
                }