Skip to content

Commit

Permalink
sleep 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydvoss committed Jan 22, 2024
1 parent cff6b40 commit a48d7ea
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
ResourceAttributes,
)

from time import sleep

_AZURE_VM_METADATA_ENDPOINT = "http://169.254.169.254/metadata/instance/compute?api-version=2021-12-13&format=json"
_AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = "azure.vm.scaleset.name"
_AZURE_VM_SKU_ATTRIBUTE = "azure.vm.sku"
Expand Down Expand Up @@ -82,10 +84,12 @@ def get_azure_vm_metadata(self): # pylint: disable=no-self-use
pass
try:
print("begin urlopen")
with urlopen(request, timeout=5) as response:
print("end urlopen")
print("end get_azure_vm_metadata")
return loads(response.read())
sleep(10)
# with urlopen(request, timeout=) as response:
# print("end urlopen")
# print("end get_azure_vm_metadata")
# return loads(response.read())
return None
except URLError:
# Not on Azure VM
print("URLError end get_azure_vm_metadata ")
Expand Down

0 comments on commit a48d7ea

Please sign in to comment.