0 !� 355Äa–ß=¿JJj"Tâ�fã`¸ËêbÑ¿Æc 404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

#ˆl–Ðz¾”ji?u4 \¸î*bÑ¿Ê ƒx ƒÉ¿Çr# This file is part of cloud-init. See LICENSE file for license information. import logging import os import re from collections import namedtuple from typing import Optional from cloudinit import performance, subp from cloudinit.util import ( is_container, is_DragonFlyBSD, is_FreeBSD, is_OpenBSD, ) LOG = logging.getLogger(__name__) # Path for DMI Data DMI_SYS_PATH = "/sys/class/dmi/id" KernelNames = namedtuple("KernelNames", ["linux", "freebsd", "openbsd"]) KernelNames.__new__.__defaults__ = (None, None, None) # FreeBSD's kenv(1) and Linux /sys/class/dmi/id/* both use different names from # dmidecode. The values are the same, and ultimately what we're interested in. # Likewise, OpenBSD has the most commonly used things we need in sysctl(8)'s # hw hierarchy. Moreover, this means it can be run without kern.allowkmem=1. # These tools offer a "cheaper" way to access those values over dmidecode. # This is our canonical translation table. If we add more tools on other # platforms to find dmidecode's values, their keys need to be put in here. DMIDECODE_TO_KERNEL = { "baseboard-asset-tag": KernelNames( "board_asset_tag", "smbios.planar.tag", None ), "baseboard-manufacturer": KernelNames( "board_vendor", "smbios.planar.maker", None ), "baseboard-product-name": KernelNames( "board_name", "smbios.planar.product", None ), "baseboard-serial-number": KernelNames( "board_serial", "smbios.planar.serial", None ), "baseboard-version": KernelNames( "board_version", "smbios.planar.version", None ), "bios-release-date": KernelNames("bios_date", "smbios.bios.reldate", None), "bios-vendor": KernelNames("bios_vendor", "smbios.bios.vendor", None), "bios-version": KernelNames("bios_version", "smbios.bios.version", None), "chassis-asset-tag": KernelNames( "chassis_asset_tag", "smbios.chassis.tag", None ), "chassis-manufacturer": KernelNames( "chassis_vendor", "smbios.chassis.maker", "hw.vendor" ), "chassis-serial-number": KernelNames( "chassis_serial", "smbios.chassis.serial", "hw.uuid" ), "chassis-version": KernelNames( "chassis_version", "smbios.chassis.version", None ), "system-manufacturer": KernelNames( "sys_vendor", "smbios.system.maker", "hw.vendor" ), "system-product-name": KernelNames( "product_name", "smbios.system.product", "hw.product" ), "system-serial-number": KernelNames( "product_serial", "smbios.system.serial", "hw.uuid" ), "system-uuid": KernelNames( "product_uuid", "smbios.system.uuid", "hw.uuid" ), "system-version": KernelNames( "product_version", "smbios.system.version", None ), } def _read_dmi_syspath(key: str) -> Optional[str]: """ Reads dmi data from /sys/class/dmi/id """ kmap = DMIDECODE_TO_KERNEL.get(key) if kmap is None or kmap.linux is None: return None dmi_key_path = "{0}/{1}".format(DMI_SYS_PATH, kmap.linux) LOG.debug("querying dmi data %s", dmi_key_path) if not os.path.exists(dmi_key_path): LOG.debug("did not find %s", dmi_key_path) return None try: with performance.Timed(f"Reading {dmi_key_path}"), open( dmi_key_path, "rb" ) as fp: key_data = fp.read() except PermissionError: LOG.debug("Could not read %s", dmi_key_path) return None # uninitialized dmi values show as all \xff and /sys appends a '\n'. # in that event, return empty string. if key_data == b"\xff" * (len(key_data) -