+
    i                         ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtHt RRRR/t	]P                  ! ]4      tRR	 ltR
 tRR ltR tRR ltR tR# )    N)dmi)net)
url_helperutilpubliceth0privateeth1c                   V'       g"   \        V 4      p\        P                  RV4       V'       g   \        R4      hRP	                  \
        P                  ! ^^4      \
        P                  ! ^ ^4      4      p V P                  P                  W4       V P                  P                  V4       \        P                  RW4       V#   \         d     \        P                  ! \        RTT4       h i ; i)zBring up NIC using an address using link-local (ip4LL) IPs.
On DigitalOcean, the link-local domain is per-droplet routed, so there
is no risk of collisions. However, to be more safe, the ip4LL
address is random.
z,selected interface '%s' for reading metadatazPunable to find interfaces to access themeta-data server. This droplet is broken.z169.254.{0}.{1}/16z&brought device '%s' up with address %szRip4LL address assignment of '%s' to '%s' failed. Droplet networking will be broken)get_link_local_nicLOGdebugRuntimeErrorformatrandomrandintnet_opsadd_addrlink_up	Exceptionr   logexc)distronicaddrs   && H/usr/lib/python3/dist-packages/cloudinit/sources/helpers/digitalocean.pyassign_ipv4_link_localr      s      (		@#F8
 	

  &&q#q# 6D*s#		:CF J  1	
 	s   :AC *C2c                     \         P                  ! 4        Uu. uF(  pV P                  P                  V4      '       g   K&  VNK*  	  ppV'       g   R # \	        VR R7      # u upi )Nc                 0    \         P                  ! V R 4      # )ifindex)cloudnetread_sys_net_int)ds   &r   <lambda>$get_link_local_nic.<locals>.<lambda>@   s    8#<#<Q	#J    )key)r    get_devicelist
networkingis_physicalmin)r   fnicss   &  r   r   r   8   s^     ((**A((+ 	
* 	 
 tJKKs   #A  A c                <   V'       g   \         P                  R4       R# \         P                  R4        V P                  P                  V4       \         P                  RV4       R#   \         d(   p\
        P                  ! \         RY4        Rp?R# Rp?ii ; i)zoRemove the ip4LL address. While this is not necessary, the ip4LL
address is extraneous and confusing to users.
zLno link_local address interface defined, skipping link local address cleanupNzcleaning up ipv4LL addresszremoved ip4LL addresses from %sz)failed to remove ip4LL address from '%s'.)r   r   r   
flush_addrr   r   r   )r   r   es   && r   del_ipv4_link_localr0   C   sw     		$	
 	II*+N!!#&		3S9 NCDcMMNs   1A) )B4BBc                p   R p. p\         P                  ! 4       p\        P                  RV4       V  EFG  pW,          ^ ,          p\        P                  RV4       VP	                  R4      pWt9  d   \        RV: RV: 24      hVP	                  V4      pVP	                  RR4      p	\        P	                  W4      p
W8w  d   \        P                  R	V	VVV
4       MR
p\        P                  WV4       RRRVRV
/p. pR FI  pVP	                  VR4      pV'       g   K  V! V4      pV	R8w  g   RV9   d   VR VP                  V4       KK  	  WR&   VP                  V4       \        P                  RW4       EKJ  	  V'       d,   \        P                  RV4       VP                  RRRV/4       R^RV/# )a  Convert the DigitalOcean Network description into Cloud-init's netconfig
format.

Example JSON:
 {'public': [
       {'mac': '04:01:58:27:7f:01',
        'ipv4': {'gateway': '45.55.32.1',
                 'netmask': '255.255.224.0',
                 'ip_address': '45.55.50.93'},
        'anchor_ipv4': {
                 'gateway': '10.17.0.1',
                 'netmask': '255.255.0.0',
                 'ip_address': '10.17.0.9'},
        'type': 'public',
        'ipv6': {'gateway': '....',
                 'ip_address': '....',
                 'cidr': 64}}
    ],
   'private': [
       {'mac': '04:01:58:27:7f:02',
        'ipv4': {'gateway': '10.132.0.1',
                 'netmask': '255.255.0.0',
                 'ip_address': '10.132.75.35'},
        'type': 'private'}
    ]
 }
c           
         R RRRRV P                  R4      RV P                  R4      /pRV P                  R4      9   d6   RP                  V P                  R4      V P                  R	4      4      VR&   V# V P                  R
4      VR
&   V# )typestaticcontrolautoaddress
ip_addressgateway:z{0}/{1}cidrnetmask)getr   )pcfgsubparts   & r   _get_subnet_part7convert_network_configuration.<locals>._get_subnet_partu   s    Hvtxx-txx	*	
 $((<((!*!1!1&(8"GI  "&)!4GIr%   znic mapping: %szconsidering %smacz3Did not find network interface on system with mac 'z'. Cannot apply configuration: r3   unknownz6Found %s interface '%s' on '%s', assigned name of '%s'zfFound interface '%s' on '%s', which is not a public or private interface. Using default system naming.physicalmac_addressnameNr   anchorr9   subnetsznic '%s' configuration: %szadded dns servers: %s
nameserverr7   versionconfig)ipv4ipv6anchor_ipv4anchor_ipv6)r    get_interfaces_by_macr   r   r=   r   NIC_MAPappend)rK   dns_serversr@   nic_configsmacs_to_nicsnr   rE   
sysfs_namenic_typeif_namemsgncfgrH   netdef
raw_subnetsub_parts   &&               r   convert_network_configurationr_   X   s   :" K113LII.il		"C(ggen* %  "%%k2
7769-++h3 IIHE  IIc
3 J;G
 DF.J'
3H8#x6'9Y'NN8$ E "Y4 		.>g j 		);7FL)[IJq(K00r%   c                     \         P                  ! WW#R 7      pVP                  4       '       g   \        RV ,          4      h\        P
                  ! VP                  P                  4       4      # ))timeoutsec_betweenretrieszunable to read metadata at %s)r   readurlokr   jsonloadscontentsdecode)urlra   rb   rc   responses   &&&& r   read_metadatarl      sS    !!+H ;;==:S@AA::h''..011r%   c                      \         P                  ! R 4      p V R8w  d   R# \         P                  ! R4      pV'       d   \        P                  RV4       RV3# Rp\        P	                  V4       \        V4      h)zsystem-manufacturerDigitalOceanzsystem-serial-numberz8system identified via SMBIOS as DigitalOcean Droplet: %szsystem identified via SMBIOS as a DigitalOcean Droplet, but did not provide an ID. Please file a support ticket at: https://cloud.digitalocean.com/support/tickets/newT)FN)r   read_dmi_datar   r   criticalr   )vendor_name
droplet_idrZ   s      r   read_sysinfors      sz    
 ##$9:Kn$""#9:J		F	
 *A 	 	S3r%   )N)   rt      )rf   loggingr   	cloudinitr   r   r    r   r   rQ   	getLogger__name__r   r   r   r0   r_   rl   rs    r%   r   <module>r{      sZ   
     % &VY
/!#LLN*k1\2r%   