Skip to content

Commit

Permalink
Add 10 second timeout to VM Resource Detector
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydvoss committed Jan 9, 2024
1 parent 14d7779 commit 7bdbf16
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_azure_vm_metadata(self): # pylint: disable=no-self-use
request = Request(_AZURE_VM_METADATA_ENDPOINT)
request.add_header("Metadata", "True")
try:
with urlopen(request).read() as response:
with urlopen(request, timeout=10).read() as response:
return loads(response)
except URLError:
# Not on Azure VM
Expand Down

0 comments on commit 7bdbf16

Please sign in to comment.