Skip to content

Commit

Permalink
Fix log messages when find an IAM client and S3 bucket node and when …
Browse files Browse the repository at this point in the history
…skipping their creation
  • Loading branch information
lgiommi committed Jul 29, 2024
1 parent 21998c0 commit 9108bf7
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,18 @@ public boolean doDeploy(DeploymentMessage deploymentMessage) {
for (Resource resource : resources.get(false)) {
if (resource.getToscaNodeType().equals(IAM_TOSCA_NODE_TYPE)) {
String nodeName = resource.getToscaNodeName();
LOG.info("Found node of type: {}. Node name: {}", IAM_TOSCA_NODE_TYPE, nodeName);

// If resource metadata is not empty means that the IAM client is already created.
// If it is, fill iamTemplateOutput with resource metadata info, then continue to next
// resource
if (resource.getMetadata() != null) {
LOG.info("Found an IAM client already created for the {} tosca node. Loading it.",
nodeName);
iamTemplateOutput.put(nodeName, resource.getMetadata());
continue;
}

LOG.info("Found node of type: {}. Node name: {}", IAM_TOSCA_NODE_TYPE, nodeName);
String scopes;
String issuerNode;
String tokenCredentials = null;
Expand Down Expand Up @@ -427,11 +429,15 @@ public boolean doDeploy(DeploymentMessage deploymentMessage) {
// Manage creation of an S3 bucket
if (resource.getToscaNodeType().equals(toscaService.getS3ToscaNodeType())) {
String nodeName = resource.getToscaNodeName();
LOG.info("Found node of type: {}. Node name: {}", toscaService.getS3ToscaNodeType(),
nodeName);

// If resource metadata is not empty means that the S3 bucket is already created.
// If it is, fill s3TemplateOutput with resource metadata info, then continue to next
// resource
if (resource.getMetadata() != null) {
LOG.info("Found an S3 bucket already created for the {} tosca node. Loading it.",
nodeName);
s3TemplateOutput.put(nodeName, resource.getMetadata());
continue;
}
Expand All @@ -442,8 +448,6 @@ public boolean doDeploy(DeploymentMessage deploymentMessage) {
String s3Url = null;
String enableVersioning = null;
Map<String, String> resourceMetadata = new HashMap<>();
LOG.info("Found node of type: {}. Node name: {}", toscaService.getS3ToscaNodeType(),
nodeName);

if (s3TemplateInput == null) {
s3TemplateInput = toscaService.getS3Properties(ar);
Expand Down

0 comments on commit 9108bf7

Please sign in to comment.