Skip to content

Commit c721248

Browse files
gcf-owl-bot[bot]partheaohmayr
authored
fix: [Many APIs] Resolve AttributeError 'Credentials' object has no attribute 'universe_domain' (#12263)
- [ ] 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLW1ldGFzdG9yZS8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFzdHJlYW0vLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRlcGxveS8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctY3gvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJ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dGV3YXkvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]> Co-authored-by: omair <[email protected]>
1 parent 27dceb9 commit c721248

File tree

326 files changed

+29248
-30112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+29248
-30112
lines changed

packages/google-cloud-dataproc-metastore/google/cloud/metastore/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.15.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.15.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ def _read_environment_variables():
503503
)
504504
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
505505

506+
@staticmethod
506507
def _get_client_cert_source(provided_cert_source, use_cert_flag):
507508
"""Return the client cert source to be used by the client.
508509
@@ -521,6 +522,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
521522
client_cert_source = mtls.default_client_cert_source()
522523
return client_cert_source
523524

525+
@staticmethod
524526
def _get_api_endpoint(
525527
api_override, client_cert_source, universe_domain, use_mtls_endpoint
526528
):
@@ -595,17 +597,18 @@ def _compare_universes(
595597
Raises:
596598
ValueError: when client_universe does not match the universe in credentials.
597599
"""
598-
if credentials:
599-
credentials_universe = credentials.universe_domain
600-
if client_universe != credentials_universe:
601-
default_universe = DataprocMetastoreClient._DEFAULT_UNIVERSE
602-
raise ValueError(
603-
"The configured universe domain "
604-
f"({client_universe}) does not match the universe domain "
605-
f"found in the credentials ({credentials_universe}). "
606-
"If you haven't configured the universe domain explicitly, "
607-
f"`{default_universe}` is the default."
608-
)
600+
601+
default_universe = DataprocMetastoreClient._DEFAULT_UNIVERSE
602+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
603+
604+
if client_universe != credentials_universe:
605+
raise ValueError(
606+
"The configured universe domain "
607+
f"({client_universe}) does not match the universe domain "
608+
f"found in the credentials ({credentials_universe}). "
609+
"If you haven't configured the universe domain explicitly, "
610+
f"`{default_universe}` is the default."
611+
)
609612
return True
610613

611614
def _validate_universe_domain(self):

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ def _read_environment_variables():
413413
)
414414
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
415415

416+
@staticmethod
416417
def _get_client_cert_source(provided_cert_source, use_cert_flag):
417418
"""Return the client cert source to be used by the client.
418419
@@ -431,6 +432,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
431432
client_cert_source = mtls.default_client_cert_source()
432433
return client_cert_source
433434

435+
@staticmethod
434436
def _get_api_endpoint(
435437
api_override, client_cert_source, universe_domain, use_mtls_endpoint
436438
):
@@ -507,17 +509,18 @@ def _compare_universes(
507509
Raises:
508510
ValueError: when client_universe does not match the universe in credentials.
509511
"""
510-
if credentials:
511-
credentials_universe = credentials.universe_domain
512-
if client_universe != credentials_universe:
513-
default_universe = DataprocMetastoreFederationClient._DEFAULT_UNIVERSE
514-
raise ValueError(
515-
"The configured universe domain "
516-
f"({client_universe}) does not match the universe domain "
517-
f"found in the credentials ({credentials_universe}). "
518-
"If you haven't configured the universe domain explicitly, "
519-
f"`{default_universe}` is the default."
520-
)
512+
513+
default_universe = DataprocMetastoreFederationClient._DEFAULT_UNIVERSE
514+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
515+
516+
if client_universe != credentials_universe:
517+
raise ValueError(
518+
"The configured universe domain "
519+
f"({client_universe}) does not match the universe domain "
520+
f"found in the credentials ({credentials_universe}). "
521+
"If you haven't configured the universe domain explicitly, "
522+
f"`{default_universe}` is the default."
523+
)
521524
return True
522525

523526
def _validate_universe_domain(self):

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.15.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ def _read_environment_variables():
525525
)
526526
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
527527

528+
@staticmethod
528529
def _get_client_cert_source(provided_cert_source, use_cert_flag):
529530
"""Return the client cert source to be used by the client.
530531
@@ -543,6 +544,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
543544
client_cert_source = mtls.default_client_cert_source()
544545
return client_cert_source
545546

547+
@staticmethod
546548
def _get_api_endpoint(
547549
api_override, client_cert_source, universe_domain, use_mtls_endpoint
548550
):
@@ -617,17 +619,18 @@ def _compare_universes(
617619
Raises:
618620
ValueError: when client_universe does not match the universe in credentials.
619621
"""
620-
if credentials:
621-
credentials_universe = credentials.universe_domain
622-
if client_universe != credentials_universe:
623-
default_universe = DataprocMetastoreClient._DEFAULT_UNIVERSE
624-
raise ValueError(
625-
"The configured universe domain "
626-
f"({client_universe}) does not match the universe domain "
627-
f"found in the credentials ({credentials_universe}). "
628-
"If you haven't configured the universe domain explicitly, "
629-
f"`{default_universe}` is the default."
630-
)
622+
623+
default_universe = DataprocMetastoreClient._DEFAULT_UNIVERSE
624+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
625+
626+
if client_universe != credentials_universe:
627+
raise ValueError(
628+
"The configured universe domain "
629+
f"({client_universe}) does not match the universe domain "
630+
f"found in the credentials ({credentials_universe}). "
631+
"If you haven't configured the universe domain explicitly, "
632+
f"`{default_universe}` is the default."
633+
)
631634
return True
632635

633636
def _validate_universe_domain(self):

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ def _read_environment_variables():
413413
)
414414
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
415415

416+
@staticmethod
416417
def _get_client_cert_source(provided_cert_source, use_cert_flag):
417418
"""Return the client cert source to be used by the client.
418419
@@ -431,6 +432,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
431432
client_cert_source = mtls.default_client_cert_source()
432433
return client_cert_source
433434

435+
@staticmethod
434436
def _get_api_endpoint(
435437
api_override, client_cert_source, universe_domain, use_mtls_endpoint
436438
):
@@ -507,17 +509,18 @@ def _compare_universes(
507509
Raises:
508510
ValueError: when client_universe does not match the universe in credentials.
509511
"""
510-
if credentials:
511-
credentials_universe = credentials.universe_domain
512-
if client_universe != credentials_universe:
513-
default_universe = DataprocMetastoreFederationClient._DEFAULT_UNIVERSE
514-
raise ValueError(
515-
"The configured universe domain "
516-
f"({client_universe}) does not match the universe domain "
517-
f"found in the credentials ({credentials_universe}). "
518-
"If you haven't configured the universe domain explicitly, "
519-
f"`{default_universe}` is the default."
520-
)
512+
513+
default_universe = DataprocMetastoreFederationClient._DEFAULT_UNIVERSE
514+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
515+
516+
if client_universe != credentials_universe:
517+
raise ValueError(
518+
"The configured universe domain "
519+
f"({client_universe}) does not match the universe domain "
520+
f"found in the credentials ({credentials_universe}). "
521+
"If you haven't configured the universe domain explicitly, "
522+
f"`{default_universe}` is the default."
523+
)
521524
return True
522525

523526
def _validate_universe_domain(self):

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.15.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ def _read_environment_variables():
525525
)
526526
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
527527

528+
@staticmethod
528529
def _get_client_cert_source(provided_cert_source, use_cert_flag):
529530
"""Return the client cert source to be used by the client.
530531
@@ -543,6 +544,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
543544
client_cert_source = mtls.default_client_cert_source()
544545
return client_cert_source
545546

547+
@staticmethod
546548
def _get_api_endpoint(
547549
api_override, client_cert_source, universe_domain, use_mtls_endpoint
548550
):
@@ -617,17 +619,18 @@ def _compare_universes(
617619
Raises:
618620
ValueError: when client_universe does not match the universe in credentials.
619621
"""
620-
if credentials:
621-
credentials_universe = credentials.universe_domain
622-
if client_universe != credentials_universe:
623-
default_universe = DataprocMetastoreClient._DEFAULT_UNIVERSE
624-
raise ValueError(
625-
"The configured universe domain "
626-
f"({client_universe}) does not match the universe domain "
627-
f"found in the credentials ({credentials_universe}). "
628-
"If you haven't configured the universe domain explicitly, "
629-
f"`{default_universe}` is the default."
630-
)
622+
623+
default_universe = DataprocMetastoreClient._DEFAULT_UNIVERSE
624+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
625+
626+
if client_universe != credentials_universe:
627+
raise ValueError(
628+
"The configured universe domain "
629+
f"({client_universe}) does not match the universe domain "
630+
f"found in the credentials ({credentials_universe}). "
631+
"If you haven't configured the universe domain explicitly, "
632+
f"`{default_universe}` is the default."
633+
)
631634
return True
632635

633636
def _validate_universe_domain(self):

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ def _read_environment_variables():
413413
)
414414
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
415415

416+
@staticmethod
416417
def _get_client_cert_source(provided_cert_source, use_cert_flag):
417418
"""Return the client cert source to be used by the client.
418419
@@ -431,6 +432,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
431432
client_cert_source = mtls.default_client_cert_source()
432433
return client_cert_source
433434

435+
@staticmethod
434436
def _get_api_endpoint(
435437
api_override, client_cert_source, universe_domain, use_mtls_endpoint
436438
):
@@ -507,17 +509,18 @@ def _compare_universes(
507509
Raises:
508510
ValueError: when client_universe does not match the universe in credentials.
509511
"""
510-
if credentials:
511-
credentials_universe = credentials.universe_domain
512-
if client_universe != credentials_universe:
513-
default_universe = DataprocMetastoreFederationClient._DEFAULT_UNIVERSE
514-
raise ValueError(
515-
"The configured universe domain "
516-
f"({client_universe}) does not match the universe domain "
517-
f"found in the credentials ({credentials_universe}). "
518-
"If you haven't configured the universe domain explicitly, "
519-
f"`{default_universe}` is the default."
520-
)
512+
513+
default_universe = DataprocMetastoreFederationClient._DEFAULT_UNIVERSE
514+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
515+
516+
if client_universe != credentials_universe:
517+
raise ValueError(
518+
"The configured universe domain "
519+
f"({client_universe}) does not match the universe domain "
520+
f"found in the credentials ({credentials_universe}). "
521+
"If you haven't configured the universe domain explicitly, "
522+
f"`{default_universe}` is the default."
523+
)
521524
return True
522525

523526
def _validate_universe_domain(self):

0 commit comments

Comments
 (0)