
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
3
\me                 @   s   d dl Z d dlmZmZmZmZ d dlmZ dddddd	d
Zee	ee
e	f f dddZe
dddZee	 dddZdS )    N)AnyDictOptionalUnion)dmiZallow_local_stageZallow_init_stageZ
allow_dhcpZ
allow_ipv4Z
allow_ipv6Zpreferred_mac_prefixes)ZalsZaisZdhcpZv4Zv6pmp)returnc              C   sr   t jd} i }| s|S xVtjd| D ]F\}}}|tkr$|dkrLtt|}n|dkr^|jd}||t| < q$W |S )zH
    Parses flags from dmi data and updates self.ds_cfg accordingly
    zbaseboard-serial-numberz([a-z0-9]+)=(.*?)(;|$)Z01r   ,)r   read_dmi_datarefindallDMI_OVERRIDE_MAPboolintsplit)Z	dmi_flagsretkeyvalue_ r   /usr/lib/python3.6/akamai.pyget_dmi_config   s    

r   c              C   s   t jd} | dkS )zo
    Reads the BIOS vendor from dmi data to determine if we are running in the
    Akamai Connected Cloud.
    zsystem-manufacturerLinodeAkamai)r   r   )r   r
   )Zvendorr   r   r   is_on_akamai(   s    
r   c               C   s
   t jdS )zo
    Returns the instance id read from dmi data without requiring the metadata
    service to be reachable
    zsystem-serial-number)r   r
   r   r   r   r   get_local_instance_id1   s    r   )r   Ztypingr   r   r   r   Z	cloudinitr   r   strr   r   r   r   r   r   r   r   <module>   s   	