aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalarvizhi <malarvizhi.44@wipro.com>2021-12-22 08:06:10 +0000
committerMalarvizhi <malarvizhi.44@wipro.com>2021-12-22 08:06:10 +0000
commitdb36560895e39e727ff3825307736f98565ee1a1 (patch)
tree0c474e3ede173f4d6f13627815c02b4d88aebdf6
parente4964e1fc514dda28ab0647f23ff8f38b67ec37a (diff)
Fix bug in preloading templates to CPS-TBDMT container
Issue-ID: CPS-839 Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com> Change-Id: I3c3cd59d7749fcc823cb34b17366261495b25960
-rw-r--r--docker-compose/docker-compose.yml7
-rw-r--r--docker-compose/preload-templates/cpspreload.py12
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)