google cloud storage client library - behind proxy - access bucket objects using python code?

Viewed 2654

Centos Linux on vmware - gsutil is working but I am trying to download objects from google cloud storage using python code. Running below python code fails as I am behind a proxy server. I tried exporting http_proxy and https_proxy, also adding it via .boto (though i'm guessing only gsutil uses it). But none works.

I can't find any mention of proxy settings in the documentation as well.

from google.cloud import storage

storage_client = storage.Client()
bucket = storage_client.get_bucket('my-bucket')
blobs=bucket.list_blobs()

OSError: [Errno 101] Network is unreachable

*UPDATE 24-JULY-17 - RESOLVED *

re-installed google cloud storage library and my script works fine with HTTP_PROXY set in the env. Not sure about the root cause for initial troubles and I was not able to reproduce the error again unfortunately.

2 Answers
Related