Skip to content

Commit 9c76656

Browse files
author
David Linko
committed
fix for handling string based nonce_cbor
1 parent abab943 commit 9c76656

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

anms-core/anms/routes/ARIs/reports.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,17 @@ async def report_ac(agent_id: int, nonce_cbor: str) -> dict:
144144
dec = ace.ari_cbor.Decoder()
145145
enc = ace.ari_text.Encoder()
146146
exec_set_dir = {}
147+
logger.info(nonce_cbor)
148+
logger.info(type(nonce_cbor))
147149
try:
148150
store_nonce = nonce_cbor
149151
nonce_cbor = ast.literal_eval(nonce_cbor)
150152
except Exception as e:
151-
logger.error(f"{e} while processing nonce")
152-
return []
153+
try:
154+
nonce_cbor = ast.literal_eval(str(bytes.fromhex(nonce_cbor)))
155+
except Exception as e:
156+
logger.error(f"{e} while processing nonce")
157+
return []
153158

154159

155160
# process each report in the rpt set and place inside appropiate nonce case or if null use source as key

0 commit comments

Comments
 (0)