Fix bug in preloading templates to CPS-TBDMT container 63/126363/1
authorMalarvizhi <malarvizhi.44@wipro.com>
Wed, 22 Dec 2021 08:06:10 +0000 (08:06 +0000)
committerMalarvizhi <malarvizhi.44@wipro.com>
Wed, 22 Dec 2021 08:06:10 +0000 (08:06 +0000)
Issue-ID: CPS-839
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: I3c3cd59d7749fcc823cb34b17366261495b25960

docker-compose/docker-compose.yml
docker-compose/preload-templates/cpspreload.py

index 1868c89..a4df8ed 100644 (file)
@@ -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"
 
index 25fd568..17f14fc 100644 (file)
@@ -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)