Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Customizable soap_cache_file.json location #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions FuelSDK/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ET_Client(object):
soap_client = None
auth_url = None
soap_endpoint = None
soap_cache_file = "soap_cache_file.json"
soap_cache_file = None
use_oAuth2_authentication = None
account_id = None
scope = None
Expand Down Expand Up @@ -118,6 +118,15 @@ def configure_client(self, get_server_wsdl, params, tokenResponse):
elif 'FUELSDK_SOAP_ENDPOINT' in os.environ:
self.soap_endpoint = os.environ['FUELSDK_SOAP_ENDPOINT']

if params is not None and "soap_cache_file_loc" in params:
self.soap_cache_file = params["soap_cache_file_loc"]
elif config.has_option("Web Services", "soap_cache_file_loc"):
self.soap_cache_file = config.get("Web Services", "soap_cache_file_loc")
elif "FUELSDK_SOAP_CACHE_FILE_LOC" in os.environ:
self.soap_cache_file = os.environ["FUELSDK_SOAP_CACHE_FILE_LOC"]
else:
self.soap_cache_file = "soap_cache_file.json"

if params is not None and "wsdl_file_local_loc" in params:
wsdl_file_local_location = params["wsdl_file_local_loc"]
elif config.has_option("Web Services", "wsdl_file_local_loc"):
Expand Down Expand Up @@ -402,7 +411,8 @@ def get_soap_endpoint(self):
return soap_url
else:
return default_endpoint

except PermissionError as e:
raise e
except Exception as e:
return default_endpoint

Expand Down