Skip to content

Commit 4e3e58d

Browse files
authored
fix: moved DEFAULT_BASE_DOMAIN to object instantiation (#101)
1 parent aa5edbd commit 4e3e58d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

laceworksdk/api/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
from .v2.vulnerability_policies import VulnerabilityPoliciesAPI
5454

5555
from laceworksdk.config import (
56+
DEFAULT_BASE_DOMAIN,
5657
LACEWORK_ACCOUNT_ENVIRONMENT_VARIABLE,
5758
LACEWORK_SUBACCOUNT_ENVIRONMENT_VARIABLE,
5859
LACEWORK_API_KEY_ENVIRONMENT_VARIABLE,
@@ -99,7 +100,8 @@ def __init__(self,
99100
self._api_secret = api_secret or os.getenv(
100101
LACEWORK_API_SECRET_ENVIRONMENT_VARIABLE)
101102
self._base_domain = base_domain or os.getenv(
102-
LACEWORK_API_BASE_DOMAIN_ENVIRONMENT_VARIABLE)
103+
LACEWORK_API_BASE_DOMAIN_ENVIRONMENT_VARIABLE
104+
) or DEFAULT_BASE_DOMAIN
103105

104106
config_file_path = os.path.join(
105107
os.path.expanduser("~"), LACEWORK_CLI_CONFIG_RELATIVE_PATH)

laceworksdk/http_session.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
from laceworksdk import version
1515
from laceworksdk.config import (
16-
DEFAULT_BASE_DOMAIN,
1716
DEFAULT_ACCESS_TOKEN_EXPIRATION,
1817
DEFAULT_SUCCESS_RESPONSE_CODES,
1918
RATE_LIMIT_RESPONSE_CODE
@@ -52,7 +51,7 @@ def __init__(self, account, subaccount, api_key, api_secret, base_domain):
5251
# Set the base parameters
5352
self._api_key = api_key
5453
self._api_secret = api_secret
55-
self._base_domain = base_domain or DEFAULT_BASE_DOMAIN
54+
self._base_domain = base_domain
5655

5756
self._base_url = f"https://{account}.{self._base_domain}"
5857
self._account = account

0 commit comments

Comments
 (0)