From 631db94cb10dff6b239121e73b2235ba7f477fcd Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Tue, 4 Sep 2018 12:06:27 -0700 Subject: [PATCH] Create a new ClientInfo if none is provided. Fixes #2161. --- .../com/google/api/codegen/py/main.snip | 8 +++++--- .../codegen/testdata/py/python_library.baseline | 8 +++++--- .../py/python_multiple_services.baseline | 16 ++++++++++------ .../py/python_no_path_templates.baseline | 8 +++++--- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/main/resources/com/google/api/codegen/py/main.snip b/src/main/resources/com/google/api/codegen/py/main.snip index 0260ce51fe..61902a92b9 100644 --- a/src/main/resources/com/google/api/codegen/py/main.snip +++ b/src/main/resources/com/google/api/codegen/py/main.snip @@ -135,9 +135,11 @@ # Client information initialization. if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION self._client_info = client_info @# Parse out the default settings for retry and timeout for each RPC diff --git a/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline b/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline index 978a72048b..6b88b7d964 100644 --- a/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline +++ b/src/test/java/com/google/api/codegen/testdata/py/python_library.baseline @@ -1208,9 +1208,11 @@ class LibraryServiceClient(object): ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION self._client_info = client_info # Parse out the default settings for retry and timeout for each RPC diff --git a/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline b/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline index 615e893f34..d8f5059e7e 100644 --- a/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline +++ b/src/test/java/com/google/api/codegen/testdata/py/python_multiple_services.baseline @@ -959,9 +959,11 @@ class DecrementerServiceClient(object): ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION self._client_info = client_info # Parse out the default settings for retry and timeout for each RPC @@ -1174,9 +1176,11 @@ class IncrementerServiceClient(object): ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION self._client_info = client_info # Parse out the default settings for retry and timeout for each RPC diff --git a/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline b/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline index 03f7c3e1cb..f1a423c86e 100644 --- a/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline +++ b/src/test/java/com/google/api/codegen/testdata/py/python_no_path_templates.baseline @@ -902,9 +902,11 @@ class NoTemplatesAPIServiceClient(object): ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION self._client_info = client_info # Parse out the default settings for retry and timeout for each RPC