Skip to content

Commit

Permalink
Expanding load resources (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuAWS authored Oct 26, 2023
1 parent a8a5c3a commit a2b3a04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cid/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def track(self, action, dashboard_id):
except Exception as e:
logger.debug(f"Issue logging action {action} for dashboard {dashboard_id} , due to a urllib3 exception {str(e)} . This issue will be ignored")

def get_page(self, source):
return requests.get(source, timeout=10)

def load_resources(self):
''' load additional resources from command line parameters
Expand All @@ -290,7 +292,7 @@ def load_resources(self):
resources = {}
try:
if source.startswith('https://'):
resp = requests.get(source, timeout=10)
resp = self.get_page(source)
assert resp.status_code in [200, 201], f'Error {resp.status_code} while loading url. {resp.text}'
resources = yaml.safe_load(resp.text)
else:
Expand Down

0 comments on commit a2b3a04

Please sign in to comment.