Skip to content

Commit

Permalink
adding protection for different key combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplegatecp committed Apr 12, 2024
1 parent 73edc50 commit ed1057e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ncm/ncm/ncm.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def __init__(self,
retry_backoff_factor=2,
retry_on=None,
base_url=None):
self.v2 = self # for backwards compatibility
base_url = base_url or os.environ.get("CP_BASE_URL", "https://www.cradlepointecm.com/api/v2")
super().__init__(log_events=log_events, logger=logger, retries=retries, retry_backoff_factor=retry_backoff_factor, retry_on=retry_on, base_url=base_url)
if api_keys:
Expand Down Expand Up @@ -2122,6 +2123,7 @@ def __init__(self,
:param base_url: # base url for calls. Configurable for testing.
Optional.
"""
self.v3 = self # For backwards compatibility
base_url = base_url or os.environ.get("CP_BASE_URL_V3", "https://api.cradlepointecm.com/api/v3")
super().__init__(log_events, logger, retries, retry_backoff_factor, retry_on, base_url)
if api_key:
Expand Down

0 comments on commit ed1057e

Please sign in to comment.