projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 6473-fetch-events-starting-at
[arvados.git]
/
sdk
/
python
/
arvados
/
api.py
diff --git
a/sdk/python/arvados/api.py
b/sdk/python/arvados/api.py
index 48e73f31493e5d5c413ea20263aa11c9804a9526..086487aa09714e2873e2b49ac7cafff222ea0d1b 100644
(file)
--- a/
sdk/python/arvados/api.py
+++ b/
sdk/python/arvados/api.py
@@
-90,7
+90,10
@@
def _new_http_error(cls, *args, **kwargs):
apiclient_errors.HttpError.__new__ = staticmethod(_new_http_error)
def http_cache(data_type):
apiclient_errors.HttpError.__new__ = staticmethod(_new_http_error)
def http_cache(data_type):
- path = os.environ['HOME'] + '/.cache/arvados/' + data_type
+ homedir = os.environ.get('HOME')
+ if not homedir or len(homedir) == 0:
+ return None
+ path = homedir + '/.cache/arvados/' + data_type
try:
util.mkdir_dash_p(path)
except OSError:
try:
util.mkdir_dash_p(path)
except OSError:
@@
-155,11
+158,7
@@
def api(version=None, cache=True, host=None, token=None, insecure=False, **kwarg
'https://%s/discovery/v1/apis/{api}/{apiVersion}/rest' % (host,))
if 'http' not in kwargs:
'https://%s/discovery/v1/apis/{api}/{apiVersion}/rest' % (host,))
if 'http' not in kwargs:
- http_kwargs = {}
- # Prefer system's CA certificates (if available) over httplib2's.
- certs_path = '/etc/ssl/certs/ca-certificates.crt'
- if os.path.exists(certs_path):
- http_kwargs['ca_certs'] = certs_path
+ http_kwargs = {'ca_certs': util.ca_certs_path()}
if cache:
http_kwargs['cache'] = http_cache('discovery')
if insecure:
if cache:
http_kwargs['cache'] = http_cache('discovery')
if insecure: