Skip to content

Commit

Permalink
1 second timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydvoss committed Jan 22, 2024
1 parent a810135 commit cc14205
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ def get_azure_vm_metadata(self): # pylint: disable=no-self-use
pass
try:
print("begin urlopen")
# # with urlopen(request, timeout=10) as response:
# # print("end urlopen")
# # print("end get_azure_vm_metadata")
# return loads(response.read())
return None
with urlopen(request, timeout=1) as response:
print("end urlopen")
print("end get_azure_vm_metadata")
return loads(response.read())
except URLError:
# Not on Azure VM
print("URLError end get_azure_vm_metadata ")
Expand Down

0 comments on commit cc14205

Please sign in to comment.