Skip to content

Commit

Permalink
fix cnm in cma
Browse files Browse the repository at this point in the history
  • Loading branch information
torimcd committed May 28, 2024
1 parent 33e2225 commit 10d3113
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bignbit/save_cnm_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def process(self):
"""
pobit_audit_bucket = self.config['pobit_audit_bucket']

collection_name = self.config['collection']
granule_ur = self.input.get('granule_ur')
collection_name = self.config['collection_name']
granule_ur = self.config['granule_ur']

cnm_content = self.input

Expand Down
13 changes: 8 additions & 5 deletions bignbit/send_to_gitc.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,21 @@ def process(self):
list of granules
"""

notification_id = ""

if self.input is not None:
# Send ImageSet(s) to GITC for processing
collection_name = self.input.get('collection_name')
cmr_provider = self.input.get('cmr_provider')
image_set = ImageSet(**self.input['image_set'])
gitc_id = image_set.name

notification_id = notify_gitc(image_set, cmr_provider, gitc_id, collection_name)
response_payload = {}
response_payload = self.input.copy()
response_payload['cnm'] = []

cnm_message = notify_gitc(image_set, cmr_provider, gitc_id, collection_name)
response_payload['cnm'].append(cnm_message)

return notification_id
return response_payload


def notify_gitc(image_set: ImageSet, cmr_provider: str, gitc_id: str, collection_name: str):
Expand Down Expand Up @@ -100,7 +103,7 @@ def notify_gitc(image_set: ImageSet, cmr_provider: str, gitc_id: str, collection

CUMULUS_LOGGER.debug(f'SQS send_message output: {response}')

return cnm['identifier']
return cnm


def construct_cnm(image_set: ImageSet, cmr_provider: str, gitc_id: str, collection_name: str):
Expand Down
5 changes: 3 additions & 2 deletions terraform/state_machine_definition.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,11 @@
"cma": {
"event.$": "$",
"task_config": {
"collection": "{$.collection}",
"collection": "{$.collection_name}",
"granule_ur": "{$.granule_ur}",
"pobit_audit_bucket": "${PobitAuditBucket}",
"cumulus_message": {
"input": "{$.payload}"
"input": "{$.payload.cnm}"
}
}
}
Expand Down

0 comments on commit 10d3113

Please sign in to comment.