Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable GAX by default if it is importable. #2085

Merged
merged 2 commits into from
Aug 10, 2016
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions docs/logging-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Authentication and Configuration
to interact with. If you are Google App Engine or Google Compute Engine
this will be detected automatically.

- The library now enables the ``gRPC`` transport for the logging API by
default, assuming that the required dependencies are installed and
importable. To *disable* this transport, set the
:envvar:`GCLOUD_DISABLE_GAX` environment variable to a non-empty string,
e.g.: ``$ export GCLOUD_DISABLE_GAX=1``.

- After configuring your environment, create a
:class:`Client <gcloud.logging.client.Client>`

Expand Down
11 changes: 11 additions & 0 deletions docs/pubsub-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ Authentication / Configuration
- Use :class:`Client <gcloud.pubsub.client.Client>` objects to configure
your applications.

- In addition to any authentication configuration, you should also set the
:envvar:`GCLOUD_PROJECT` environment variable for the project you'd like
to interact with. If you are Google App Engine or Google Compute Engine
this will be detected automatically.

- The library now enables the ``gRPC`` transport for the pubsub API by
default, assuming that the required dependencies are installed and
importable. To *disable* this transport, set the
:envvar:`GCLOUD_DISABLE_GAX` environment variable to a non-empty string,
e.g.: ``$ export GCLOUD_DISABLE_GAX=1``.

- :class:`Client <gcloud.pubsub.client.Client>` objects hold both a ``project``
and an authenticated connection to the PubSub service.

Expand Down
3 changes: 2 additions & 1 deletion gcloud/logging/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
from gcloud.logging.sink import Sink


_USE_GAX = _HAVE_GAX and (os.environ.get('GCLOUD_ENABLE_GAX') is not None)
_DISABLE_GAX = os.getenv('GCLOUD_DISABLE_GAX', False)
_USE_GAX = _HAVE_GAX and not _DISABLE_GAX


class Client(JSONClient):
Expand Down
3 changes: 2 additions & 1 deletion gcloud/pubsub/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
# pylint: enable=ungrouped-imports


_USE_GAX = _HAVE_GAX and (os.environ.get('GCLOUD_ENABLE_GAX') is not None)
_DISABLE_GAX = os.getenv('GCLOUD_DISABLE_GAX', False)
_USE_GAX = _HAVE_GAX and not _DISABLE_GAX


class Client(JSONClient):
Expand Down