+
    ˜qgjê  ã                   óz   € ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ]P                  ! ]4      t	R t
R tR	R ltR tR# )
é    N)Údmi)Únet)Ú
url_helperc           
     ó0  € R p. p\         P                  ! 4       p\        P                  RV4       V P	                  R4       Fì  p\        P                  RV4       VP	                  R4      pWS9  d   \        RV: RV: 24      hVP	                  R4      pVP	                  V4      p\        P                  R	VVVVP	                  R
4      4       RRRVRV/p. p	VP	                  R4       F+  p
V! W P	                  R4      4      pV	P                  V4       K-  	  W˜R&   VP                  V4       Kî  	  V P	                  R4      '       dJ   \        P                  RV P	                  R4      4       VP                  RRRV P	                  R4      /4       R^RV/# )aÇ  
Convert the UpCloud network metadata description into
Cloud-init's version 1 netconfig format.

Example JSON:
{
  "interfaces": [
    {
      "index": 1,
      "ip_addresses": [
        {
          "address": "94.237.105.53",
          "dhcp": true,
          "dns": [
            "94.237.127.9",
            "94.237.40.9"
          ],
          "family": "IPv4",
          "floating": false,
          "gateway": "94.237.104.1",
          "network": "94.237.104.0/22"
        },
        {
          "address": "94.237.105.50",
          "dhcp": false,
          "dns": [],
          "family": "IPv4",
          "floating": true,
          "gateway": "",
          "network": "94.237.105.50/32"
        }
      ],
      "mac": "32:d5:ba:4a:36:e7",
      "network_id": "031457f4-0f8c-483c-96f2-eccede02909c",
      "type": "public"
    },
    {
      "index": 2,
      "ip_addresses": [
        {
          "address": "10.6.3.27",
          "dhcp": true,
          "dns": [],
          "family": "IPv4",
          "floating": false,
          "gateway": "10.6.0.1",
          "network": "10.6.0.0/22"
        }
      ],
      "mac": "32:d5:ba:4a:84:cc",
      "network_id": "03d82553-5bea-4132-b29a-e1cf67ec2dd1",
      "type": "utility"
    },
    {
      "index": 3,
      "ip_addresses": [
        {
          "address": "2a04:3545:1000:720:38d6:baff:fe4a:63e7",
          "dhcp": true,
          "dns": [
            "2a04:3540:53::1",
            "2a04:3544:53::1"
          ],
          "family": "IPv6",
          "floating": false,
          "gateway": "2a04:3545:1000:720::1",
          "network": "2a04:3545:1000:720::/64"
        }
      ],
      "mac": "32:d5:ba:4a:63:e7",
      "network_id": "03000000-0000-4000-8046-000000000000",
      "type": "public"
    },
    {
      "index": 4,
      "ip_addresses": [
        {
          "address": "172.30.1.10",
          "dhcp": true,
          "dns": [],
          "family": "IPv4",
          "floating": false,
          "gateway": "172.30.1.1",
          "network": "172.30.1.0/24"
        }
      ],
      "mac": "32:d5:ba:4a:8a:e1",
      "network_id": "035a0a4a-77b4-4de5-820d-189fc8135714",
      "type": "private"
    }
  ],
  "dns": [
    "94.237.127.9",
    "94.237.40.9"
  ]
}
c                 ó(  € V P                  R 4      '       d   R pV P                  R4      R8X  d   RpRV/# RpV P                  R4      R8X  d   RpRVRRR	V P                  R	4      /pV P                  R
4      '       d   V P                  R
4      VR
&   RV P                  R4      9   d+   V P                  R4      P                  R4      ^,          VR&   WP                  R4      8w  d,   V P                  R4      '       d   V P                  R4      VR&   V# )ÚdhcpÚfamilyÚIPv6zipv6_dhcpv6-statelessÚtypeÚstaticÚstatic6ÚcontrolÚautoÚaddressÚgatewayÚ/ÚnetworkÚnetmaskÚdnsÚdns_nameservers)ÚgetÚsplit)Úip_addrr   Ú	dhcp_typeÚstatic_typeÚsubparts   &&   ÚC/usr/lib/python3/dist-packages/cloudinit/sources/helpers/upcloud.pyÚ_get_subnet_configÚ8convert_to_network_config_v1.<locals>._get_subnet_configr   s  € Ø�;‰;�v×ÒØˆIØ�{‰{˜8Ó$¨Ô.ð 4�	Ø˜IÐ&Ð&àˆØ�;‰;�xÓ  FÔ*Ø#ˆKà�KØ�vØ�w—{‘{ 9Ó-ð
ˆð �;‰;�y×!Ò!Ø!(§¡¨YÓ!7ˆG�IÑà�'—+‘+˜iÓ(Ô(Ø!(§¡¨YÓ!7×!=Ñ!=¸cÓ!BÀ1Õ!EˆG�IÑà—+‘+˜eÓ$Ô$¨¯©°U×);Ò);Ø)0¯©°UÓ);ˆGÐ%Ñ&àˆó    zNIC mapping: %sÚ
interfaceszConsidering %sÚmacz3Did not find network interface on system with mac 'z'. Cannot apply configuration: r   z4Found %s interface '%s' with address '%s' (index %d)ÚindexÚphysicalÚnameÚmac_addressÚip_addressesr   ÚsubnetszSetting DNS nameservers to %sÚ
nameserverr   ÚversionÚconfig)ÚcloudnetÚget_interfaces_by_macÚLOGÚdebugr   ÚRuntimeErrorÚappend)r+   r   Únic_configsÚmacs_to_interfacesÚ	raw_ifacer&   Ú
iface_typeÚ
sysfs_nameÚ	interfacer(   Ú
ip_addressÚsub_parts   &           r   Úconvert_to_network_config_v1r:      s‰  € òFð: €KÜ!×7Ò7Ó9ÐÜ‡I�IÐÐ!3Ô4à—Z‘Z Ö-ˆ	Ü�	‰	Ð" IÔ.à—m‘m EÓ*ˆØÔ0Ýó ¢	ð+óð ð —]‘] 6Ó*ˆ
Ø'×+Ñ+¨KÓ8ˆ
ä�	‰	ØBØØØØ�M‰M˜'Ó"ô	
ð �JØ�JØ˜;ð
ˆ	ð ˆØ#Ÿ-™-¨Ö7ˆJÙ)¨*·j±jÀÓ6GÓHˆHØ�N‰N˜8Ö$ñ 8ð  '�)ÑØ×Ñ˜9Ö%ñE .ðH ‡z�z�%×ÒÜ�	‰	Ð1°6·:±:¸eÓ3DÔEØ×ÑØ�\ 9¨f¯j©j¸Ó.?Ð@ô	
ð �q˜( KÐ0Ð0r    c                 ó   € \        V 4      # )N)r:   )r+   s   &r   Úconvert_network_configr<   À   s   € Ü'¨Ó/Ð/r    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Úokr0   ÚjsonÚloadsÚcontentsÚdecode)Úurlr>   r?   r@   Úresponses   &&&& r   Úread_metadatarI   Ä   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ÚUpCloudzsystem-uuidz2system identified via SMBIOS as UpCloud server: %sz¤system identified via SMBIOS as a UpCloud server, but did not provide an ID. Please contact support viahttps://hub.upcloud.com or via email with support@upcloud.comT)FN)r   Úread_dmi_datar.   r/   Úcriticalr0   )Úvendor_nameÚserver_uuidÚmsgs      r   Úread_sysinforQ   Í   sx   € ô ×#Ò#Ð$9Ó:€KØ�iÔØÐä×#Ò# MÓ2€KßÜ�	‰	Ø@À+ô	
ð �ÐÐðLð 	ô
 	�‰�SÔÜ˜3ÓÐr    )é   rR   é   )rC   ÚloggingÚ	cloudinitr   r   r,   r   Ú	getLoggerÚ__name__r.   r:   r<   rI   rQ   © r    r   Ú<module>rY      s<   ðó
 Û å Ý %Ý  à×Ò˜Ó!€òn1òb0ô2ôr    