Only import the offline client if necessary in get_client
Otherwise, importing ara.client.utils triggers an import to the offline client which requires django dependencies to be installed. Change-Id: I61e659cfbeec3aa696f17db3addfbaa33af2e860
This commit is contained in:
parent
cab932f0ed
commit
bae32bf425
@ -18,7 +18,6 @@
|
||||
from requests.auth import HTTPBasicAuth
|
||||
|
||||
from ara.clients.http import AraHttpClient
|
||||
from ara.clients.offline import AraOfflineClient
|
||||
|
||||
|
||||
def get_client(client="offline", endpoint="http://127.0.0.1:8000", timeout=30, username=None, password=None):
|
||||
@ -30,6 +29,8 @@ def get_client(client="offline", endpoint="http://127.0.0.1:8000", timeout=30, u
|
||||
auth = HTTPBasicAuth(username, password)
|
||||
|
||||
if client == "offline":
|
||||
from ara.clients.offline import AraOfflineClient
|
||||
|
||||
return AraOfflineClient(auth=auth)
|
||||
elif client == "http":
|
||||
return AraHttpClient(endpoint=endpoint, timeout=timeout, auth=auth)
|
||||
|
Loading…
x
Reference in New Issue
Block a user