/snap/core24/1643/usr/lib/python3/dist-packages/cloudinit/sources/helpers
NameSizeModeActions
vmware/-0755rm
__pycache__/-0755rm
akamai.py14800644editdlrm
aliyun.py73480644editdlrm
azure.py416730644editdlrm
cloudsigma.py29510644editdlrm
digitalocean.py69110644editdlrm
ec2.py87810644editdlrm
hetzner.py12710644editdlrm
netlink.py119310644editdlrm
openstack.py281150644editdlrm
upcloud.py66340644editdlrm
vultr.py81400644editdlrm
__init__.py00644editdlrm
Edit: /snap/core24/1643/usr/lib/python3/dist-packages/cloudinit/sources/helpers/hetzner.py (1271B)
# Author: Jonas Keidel # Author: Markus Schade # # This file is part of cloud-init. See LICENSE file for license information. from typing import Optional, Tuple from cloudinit import net, url_helper def _skip_retry_on_empty_response(cause: url_helper.UrlError) -> bool: return cause.code != 204 def get_metadata( urls, max_wait=120, timeout=2, sleep_time=2, ) -> Tuple[Optional[str], bytes]: try: url, contents = url_helper.wait_for_url( urls=urls, max_wait=max_wait, timeout=timeout, sleep_time=sleep_time, # It is ok for userdata to not exist (that's why we are stopping if # HTTP code is 204) and just in that case returning an empty # string. exception_cb=_skip_retry_on_empty_response, ) if not url: raise RuntimeError("No data received from urls: '%s':" % urls) return url, contents except url_helper.UrlError as e: if e.code == 204: return e.url, b"" raise def get_interface_name_from_mac(mac: str) -> Optional[str]: mac_to_iface = net.get_interfaces_by_mac() return mac_to_iface.get(mac.lower())