Skip to content

Commit

Permalink
Merge pull request googleapis#2085 from tseaver/reenable-gax-by-default
Browse files Browse the repository at this point in the history
Re-enable GAX by default if it is importable.
  • Loading branch information
tseaver authored Aug 10, 2016
2 parents 51a64f2 + 9cf5b72 commit 27f0af5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
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

0 comments on commit 27f0af5

Please sign in to comment.