From df8febbd6576175f3c739bf16fecbf9a4908805b Mon Sep 17 00:00:00 2001 From: Vallabh Chugh Date: Tue, 11 Oct 2022 00:20:38 +0530 Subject: [PATCH] Update script.py --- scripts/PagerDuty-Integration/script.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/PagerDuty-Integration/script.py b/scripts/PagerDuty-Integration/script.py index 185f8ef..feef8a0 100644 --- a/scripts/PagerDuty-Integration/script.py +++ b/scripts/PagerDuty-Integration/script.py @@ -2,9 +2,14 @@ import json import requests +from pathlib import Path +from dotenv import load_dotenv +env_path=Path('.')/'.env' +load_dotenv(dotenv_path=env_path) + #This Key should be available in .env file -ROUTING_KEY = "" # ENTER EVENTS V2 API INTEGRATION KEY HERE +ROUTING_KEY = os.environ['ROUTING_KEY'] # ENTER EVENTS V2 API INTEGRATION KEY HERE # This function takes the payload info from the user and can be put in the right format