Skip to content

Commit

Permalink
fix: [Many APIs] Resolve AttributeError 'Credentials' object has no a…
Browse files Browse the repository at this point in the history
…ttribute 'universe_domain' (#12266)

- [ ] Regenerate this pull request now.


BEGIN_COMMIT_OVERRIDE
fix: Resolve AttributeError 'Credentials' object has no attribute
'universe_domain'
fix: Add google-auth as a direct dependency
fix: Add staticmethod decorator to `_get_client_cert_source` and
`_get_api_endpoint`
END_COMMIT_OVERRIDE

chore: Update gapic-generator-python to v1.14.1
PiperOrigin-RevId: 603728206

Source-Link:
googleapis/googleapis@9063da8

Source-Link:
googleapis/googleapis-gen@891c67d
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlZGlzLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0=
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlc291cmNlLW1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlc291cmNlLXNldHRpbmdzLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0=
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJ1bi8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9
Copy-Tag:
eyJ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
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXN0b3JhZ2VpbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Feb 3, 2024
1 parent d7d730a commit 9e8d039
Show file tree
Hide file tree
Showing 268 changed files with 18,587 additions and 19,117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.15.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.15.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ def _read_environment_variables():
)
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env

@staticmethod
def _get_client_cert_source(provided_cert_source, use_cert_flag):
"""Return the client cert source to be used by the client.
Expand All @@ -427,6 +428,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
client_cert_source = mtls.default_client_cert_source()
return client_cert_source

@staticmethod
def _get_api_endpoint(
api_override, client_cert_source, universe_domain, use_mtls_endpoint
):
Expand Down Expand Up @@ -501,17 +503,18 @@ def _compare_universes(
Raises:
ValueError: when client_universe does not match the universe in credentials.
"""
if credentials:
credentials_universe = credentials.universe_domain
if client_universe != credentials_universe:
default_universe = CloudRedisClient._DEFAULT_UNIVERSE
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)

default_universe = CloudRedisClient._DEFAULT_UNIVERSE
credentials_universe = getattr(credentials, "universe_domain", default_universe)

if client_universe != credentials_universe:
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)
return True

def _validate_universe_domain(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.15.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ def _read_environment_variables():
)
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env

@staticmethod
def _get_client_cert_source(provided_cert_source, use_cert_flag):
"""Return the client cert source to be used by the client.
Expand All @@ -426,6 +427,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
client_cert_source = mtls.default_client_cert_source()
return client_cert_source

@staticmethod
def _get_api_endpoint(
api_override, client_cert_source, universe_domain, use_mtls_endpoint
):
Expand Down Expand Up @@ -500,17 +502,18 @@ def _compare_universes(
Raises:
ValueError: when client_universe does not match the universe in credentials.
"""
if credentials:
credentials_universe = credentials.universe_domain
if client_universe != credentials_universe:
default_universe = CloudRedisClient._DEFAULT_UNIVERSE
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)

default_universe = CloudRedisClient._DEFAULT_UNIVERSE
credentials_universe = getattr(credentials, "universe_domain", default_universe)

if client_universe != credentials_universe:
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)
return True

def _validate_universe_domain(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-redis",
"version": "2.15.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-redis",
"version": "2.15.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-redis/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

dependencies = [
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
"google-auth >= 2.14.1, <3.0.0dev",
"proto-plus >= 1.22.3, <2.0.0dev",
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-redis/testing/constraints-3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
google-api-core==1.34.0
google-auth==2.14.1
proto-plus==1.22.3
protobuf==3.19.5
Loading

0 comments on commit 9e8d039

Please sign in to comment.