Skip to content

Commit 971a0bd

Browse files
updated tests and csphelpers to use consistent mock enviornments with wif. slight adjustments to platform detection for URL fixes/header fixes that don't affect logic but make checks in the the csphelper more consistent
1 parent 7917c0d commit 971a0bd

File tree

5 files changed

+335
-449
lines changed

5 files changed

+335
-449
lines changed

src/snowflake/connector/platform_detection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def is_azure_vm(timeout_seconds: float):
135135
try:
136136
token_resp = requests.get(
137137
"http://169.254.169.254/metadata/instance?api-version=2021-02-01",
138-
headers={"Metadata": "true"},
138+
headers={"Metadata": "True"},
139139
timeout=timeout_seconds,
140140
)
141141
return (
@@ -327,7 +327,7 @@ def has_gcp_identity(timeout_seconds: float):
327327
"""
328328
try:
329329
response = requests.get(
330-
"http://metadata/computeMetadata/v1/instance/service-accounts/default/email",
330+
"http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email",
331331
headers={"Metadata-Flavor": "Google"},
332332
timeout=timeout_seconds,
333333
)

0 commit comments

Comments
 (0)