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;
}
}
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.
} else {
throw ce;
}
- } catch (Exception e) {
- throw e;
}
// Create a blueprint ZIP file in memory