From db36560895e39e727ff3825307736f98565ee1a1 Mon Sep 17 00:00:00 2001 From: Malarvizhi Date: Wed, 22 Dec 2021 08:06:10 +0000 Subject: Fix bug in preloading templates to CPS-TBDMT container Issue-ID: CPS-839 Signed-off-by: Malarvizhi Paramasivam Change-Id: I3c3cd59d7749fcc823cb34b17366261495b25960 --- docker-compose/docker-compose.yml | 7 ++++--- docker-compose/preload-templates/cpspreload.py | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 1868c89..a4df8ed 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -39,7 +39,7 @@ services: retries: 5 networks: - cps-tbdmt-default - cps-tdmt: + cps-tbdmt: image: "cps-tbdmt:latest" container_name: cps-tbdmt hostname: cps-tbdmt @@ -52,11 +52,12 @@ services: networks: - cps-tbdmt-default preload-templates: - build: ../preload-templates + image: preload:latest + build: ./preload-templates depends_on: - cps-tbdmt networks: - cps-tbdmt-default volumes: - - ../preload-templates/$FILENAME:/usr/src/app/samplepreload.json + - "./preload-templates/$FILENAME:/usr/src/app/samplepreload.json" diff --git a/docker-compose/preload-templates/cpspreload.py b/docker-compose/preload-templates/cpspreload.py index 25fd568..17f14fc 100644 --- a/docker-compose/preload-templates/cpspreload.py +++ b/docker-compose/preload-templates/cpspreload.py @@ -6,6 +6,7 @@ CPS_HEADERS = { "Accept": "application/json", "Content-Type": "application/json", } + tbdmt_url="http://cps-tbdmt:8080/templates" @@ -17,10 +18,9 @@ templates=json.loads(templates_json) for template in templates: print(type(template)) - print("send rest req") - print("waiting before sent req") - time.sleep(2) - response=requests.post(tbdmt_url, json=template, headers=CPS_HEADERS) - print("res",response.reason) - + print("Waiting before sending request..") + time.sleep(8) + print("Sending rest request..") + response=requests.post(tbdmt_url, json=template, headers=CPS_HEADERS, verify=False) + print("Response is: ",response.reason) -- cgit 1.2.3-korg