Commit 8858a4f2 authored by Qarnot computing's avatar Qarnot computing

Some cookie for better logging

parent e432f45e
......@@ -2,6 +2,7 @@
import json.decoder
import logging as log
import random
import urllib.parse
from abc import ABC, abstractmethod
......@@ -160,9 +161,10 @@ class DCMCClientHttp(DCMCClient):
async with ClientSession(raise_for_status=True, headers={'Authorization': self._authorization_header}) as session:
json_data = [item.json_obj() for item in migration_request]
raw_json = json.dumps(json_data, indent=4)
log.debug("Posting to DCMC client at %s: %s", self._remote_uri, raw_json)
cookie = random.randint(1, 100000000)
log.debug("Posting request %s to DCMC client at %s: %s", cookie, self._remote_uri, raw_json)
await session.post(url=self._remote_uri, json=json_data)
log.info("Migration request properly posted to DCMC")
log.info("Migration request %s properly posted to DCMC", cookie)
except Exception:
log.exception("Failed to submit migration request: ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment