diff options
-rw-r--r-- | adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java | 21 |
1 files changed, 13 insertions, 8 deletions
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 ad2543032f..d7bc22aa7c 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 @@ -755,16 +755,19 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin { GetBlueprint getRequest = cloudify.blueprints().getMetadataById(blueprintId); try { Blueprint bp = getRequest.execute(); - logger.debug("Blueprint exists: {}", bp.getId()); - return true; + if (bp != null) { + logger.debug("Blueprint exists: {}", bp.getId()); + return true; + } else { + logger.debug("Null blueprint!"); + return false; + } } catch (CloudifyResponseException ce) { if (ce.getStatus() == 404) { return false; } else { throw ce; } - } catch (Exception e) { - throw e; } } @@ -803,8 +806,12 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin { GetBlueprint getRequest = cloudify.blueprints().getMetadataById(blueprintId); try { Blueprint bp = getRequest.execute(); - logger.debug("Blueprint {} already exists.", bp.getId()); - return false; + if (bp != null) { + logger.debug("Blueprint {} already exists.", bp.getId()); + return false; + } else { + logger.debug("Null blueprint!"); + } } catch (CloudifyResponseException ce) { if (ce.getStatus() == 404) { // This is the expected result. @@ -812,8 +819,6 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin { } else { throw ce; } - } catch (Exception e) { - throw e; } // Create a blueprint ZIP file in memory |