+
    i>                        ^ RI t ^ RIt^ RIt^ RIHt ^ RIHtHtHtH	t	 ^ RI
Ht ]P                  ! ]4      t ! R R]P                  4      tRR ltRR ltRR	 ltR
 t ! R R]4      t]]P,                  33]]P,                  ]P.                  33.tR t]R8X  dr   ^ RIHt ]P8                  ! ]P:                  R7       ]^,          t]	P>                  ! ]4      w  t t!t"t#]$! R]  24       ]$! R]! 24       ]$! R]" 24       ]$! R]# 24       R# R# )    N)partial)dmi	lifecyclesourcesutil)enic                      a a ] tR t^t oRtR tV 3R ltR tR t]	R 4       t
V3R lR ltR	 tR
 tR t]	R 4       tRtVtV ;t# )DataSourceNoCloudNoCloudc                >   \         P                  P                  WW#4       R V n        \        P
                  P                  VP                  R4      \        P
                  P                  VP                  R4      .V n        R V n        RV n	        R V n
        R V n        R # )Nnocloudnocloud-net)/file://)r   
DataSource__init__seedospathjoinseed_dir	seed_dirssupported_seed_starts_network_config_network_eniselfsys_cfgdistropathss   &&&&E/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceNoCloud.pyr   DataSourceNoCloud.__init__   su    ##D6A	GGLL3GGLL7
 %5"#     c                   < \         SV `  4       R,           V P                  '       d   RV P                   R2MR,           V P                  \        P
                  8w  d   RV P                   R2,           # R,           # )z@append seed and dsmode info when they contain non-default values z[seed=] z[dsmode=)super__str__r   dsmoder   DSMODE_NETWORK)r   	__class__s   &r!   r)   DataSourceNoCloud.__str__&   su     GO(,					{!$r;
 ;;'"8"88 4;;-q)			
 		
r#   c                
   \         P                  ! R 4      pVP                  \         P                  ! R4      4       \         P                  ! RVP                  4       ,          4      pVP                  \         P                  ! RVP	                  4       ,          4      4       VP                  \         P                  ! RV,          4      4       \        \        V4      \        V4      ,          4      pVP                  RR7       V# )z	TYPE=vfatzTYPE=iso9660zLABEL=%szLABEL_FATBOOT=%sT)reverse)r   find_devs_withextendupperlowerlistsetsort)r   labelfslist
label_listdevlists   &&   r!   _get_devicesDataSourceNoCloud._get_devices3   s    $$[1d)).9:((ekkm)CD
$--j5;;=.HIJ$--.@5.HIJs6{S_45T"r#   c                v
   R RRV P                   /p. pR/ RRRRRR/p / p\        P                  ! R	4      pV'       d1   \        WE4      '       d    VP	                  R
4       \        VRV/4      p / p\        T4      '       d    TP	                  R4       \        TRT/4      pRRR.RRR./pT P                   FM  p \        P                  ! T3/ TB pTP	                  T4       \        P                  RT4       \        Y84      p M	  T P                  P                  R4      '       d/   TP	                  R4       T P                  R,          TR,          R&   RT P                  9   d8   RT P                  9   d'   \        Y0P                  4      pTP	                  R4       R p	T P                  P                  RR4      p
T
ez   T P!                  T
4       Fd  p \        P                  RT4        \        P"                  ! YT4      p\        Y84      p\        P                  RT4       TP	                  T4        M	  T'       g   R# RTR,          9   d   TR,          R,          pRpT P.                   F  pTP1                  T4      '       g   K  Tp M	  T'       g   T P3                  T4       R# \        P4                  ! T4      p\        P6                  ! TRR7      w  pppp\        P                  RT4       \        P8                  ! TR,          T.4      TR&   TTR&   TTR&   TTR&   TP	                  T4       \        P8                  ! TR,          T.4      TR&   T P;                  TR,          P                  R4      .4      T n         T P                   \<        P>                  8X  d#   \        P                  RY P                   4       R# RPA                  T4      T n!        TR,          T n"        TR,          T n#        TR,          T n$        TR,          T n%        TR,          P                  R 4      T n&        R!#   \         d     \        P                  ! \        R4        R# i ; i  \         d     \        P                  ! \        R4        R# i ; i  \         d     EK  i ; i  \         d    \        P%                  RTT
4        EK  i ; i  \&         d-   pTP(                  \(        P*                  8w  d   h  Rp?EK,  Rp?i\        P,                   d"    \        P                  ! \        RT4        EKd  i ; i)"instance-idr   r*   	meta-data	user-datar'   vendor-datanetwork-configNsystem-serial-numberr   zUnable to parse dmi dataFcmdlinez!Unable to parse command line datarequiredoptionalzUsing seeded data from %sseedfromds_config_seedfrom	ds_configc                 0    \         P                  ! V 3/ VB # N)r   pathprefix2dict)mpdatas   &&r!   _pp2d_callback3DataSourceNoCloud._get_data.<locals>._pp2d_callback   s    ''3d33r#   fs_labelcidatazAttempting to use data from %sz)device %s with label=%s not a valid seed.zUsing data from %sz(Failed to mount %s when looking for data)timeoutzUsing seeded cache data from %sz&%s: not claiming datasource, dsmode=%s,znetwork-interfacesT)'r*   r   read_dmi_dataload_cmdline_dataappend_merge_new_seed	Exceptionr   logexcLOGr   rL   debug
ValueErrords_cfggetr;   mount_cbwarningOSErrorerrnoENOENTMountFailedErrorr   
startswith_log_unusable_seedfromsub_dmi_varsread_seededmergemanydict_determine_dsmoder   DSMODE_DISABLEDr   r   metadatauserdata_rawvendordata_rawr   r   )r   defaultsfoundmydatamdserialpp2d_kwargsr   seededrO   r7   deverG   	seedfoundprotomd_seedudvdnetworks   &                   r!   	_get_dataDataSourceNoCloud._get_data?   s   9dkk

 2d	

	 B&&'=>F+B77U#(+r1BC
	B $$Y'(+r1BC k2(89

 NND--dBkBT"		5t<(8 # ;;??:&&LL-..2kk*.EF;
+ $++%+*D$V[[9FLL%	4 
H5((/II>D
!!%" -V<FII2C8LL%) 0>  ,,k*:6HI33&&u-- %I 4 ++H5 ''1H (,'7'7$'O$GRWII7B #'"4"4$g.#F; #%F;$&F=!'.F#$LL" #00K (+
{ ,,K $$X./
 ;;'111II8$ HHUO	{+";/$]3%&67";/334HIO  	KK78	  	KK@A	"  : & !G!
 !!  ww%,,. /,, KKG s   P6 0P6 /2Q# ;A	RS.R#2S6&Q Q #&RRR R #"S
S	S

ST8 S??T8T87T8c                    V P                   '       g%   \        P                  ! 4       '       d   R MRV n         V P                   # )lxdr   )_platform_typer   is_lxdr   s   &r!   platform_typeDataSourceNoCloud.platform_type   s.    """+/;;==%iD"""r#   c                    < V ^8  d   QhRS[ /#    rG   str)format__classdict__s   "r!   __annotate__DataSourceNoCloud.__annotate__   s     
 
s 
r#   c                J    \         P                  RV V P                  V4       R# )!Stage-specific level and message.zN%s only uses seeds starting with %s - will try to use %s in the network stage.N)r[   infor   r   rG   s   &&r!   rg   (DataSourceNoCloud._log_unusable_seedfrom   s"    $&&	
r#   c                "    \         P                  # )z=Return unknown when 'cloud-name' key is absent from metadata.)r   METADATA_UNKNOWNr   s   &r!   _get_cloud_name!DataSourceNoCloud._get_cloud_name   s    '''r#   c                v    V P                   P                  R4      '       d   RpMRpV: RV P                   : R2# )z/Return the subplatform metadata source details.z/devzconfig-diskzseed-dirz ())r   rf   )r   subplatform_types   & r!   _get_subplatform"DataSourceNoCloud._get_subplatform   s2    99'',),dii88r#   c                    V P                  4       pV'       g   R # \        V RV P                  .4      p\        VR7      pV'       g   R # WB8H  # )Nr   )dirs)get_instance_idgetattrr   _quick_read_instance_id)r   r   currentr   quick_ids   &&   r!   check_instance_id#DataSourceNoCloud.check_instance_id   sG     &&( t[4==/:*5""r#   c                    V P                   fM   V P                  e?   \        P                  ! RRRR7       \        P
                  ! V P                  4      V n         V P                   # )Nz$Eni network configuration in NoCloudz24.3z,You can use network v1 or network v2 instead
deprecateddeprecated_versionextra_message)r   r   r   	deprecater   convert_eni_datar   s   &r!   network_config DataSourceNoCloud.network_config	  sX    '  ,##E'-F	 (+';';D<M<M'N$###r#   )r   r   r   r*   rm   r   r   r   r   rn   ro   )__name__
__module____qualname____firstlineno__dsnamer   r)   r;   r   propertyr   rg   r   r   r   r   __static_attributes____classdictcell____classcell__)r,   r   s   @@r!   r
   r
      sf     F
!

]~ # #

 
(9# $ $ $r#   r
   c                 <   V f   . p Rp/ p\        V4      '       d   W9   d	   W!,          # V  FZ  pVf   K	   \        P                  ! VR.R7      p\        P                  ! VR,          4      pV'       d   W9   d   WQ,          u # KZ  K\  	  R #   \         d     Kn  i ; i)Nr>   r?   )rE   )rV   r   rL   	load_yamlr]   )r   iid_keyfilldrN   rs   s   &     r!   r   r     s    |GD7?}9	''[MBD[ 12Bgm{" $r    		s   =B4BBBc                    R \         P                  3R\         P                  3.pV F  w  r4\        W0V4      '       g   K  RV 9   d    R# V P	                  R4      pV'       d[   VP                  R4      '       d   \         P                  V R&    R# VP                  R4      '       d   \         P                  V R&    R# W@R&    R# 	  R# )z
ds=nocloudzds=nocloud-netr*   TrG   Fhttp://zhttps://zftp://zftps://)r   r   )r   DSMODE_LOCALr+   parse_cmdline_datar_   rf   )r   rD   pairsidstrr*   rG   s   &&    r!   rV   rV   /  s    	w++,	7112E !%w77t 88J'""<  ")!7!7X  $$%566!(!5!5X  $N' ( r#   c                 "   Vf   \         P                  ! 4       pRV,          pRV ,          V9   g   RV ,          V9   g   R# RpVP                  4        F.  pVP                  V 4      '       g   K  VP                  R^4      pK0  	  V^,          P                  R4      p\	        V4      ^8  d   VR,          pMRpRR	R
RRR/pV F3  pVR8X  d   K   VP                  R^4      w  rW9   d	   Wy,          p	WV	&   K5  	  R#   \
         d    Tp	R p
 L)i ; i)Nz %s z %s;Fr'   =;:   NNhzlocal-hostnameir>   srG   T )r   get_cmdlinesplitrf   lenrY   )ds_idr   rD   arglinetoktmpkvpairss2litemkvs   &&&        r!   r   r   P  s   ""$wGUNg%%7)BG }}>>%  iiQ'G  !*

3
C
3x!|b'  #}c:
FC2:	ZZQ'FQ 8AQ    	AA	s   C<<DDc                    V P                  4       pVP                  R / 4      p\        VR ,          \        4      '       g   \        P
                  ! VR ,          4      p\        P                  ! V R ,          V.4      VR &   VP                  R4      '       d)   \        P
                  ! VP                  R4      4      VR&   RV9   d   VR,          VR&   RV9   d   VR,          VR&   V# )r?   rB   r@   rA   )copyr_   
isinstancedictr   r   rj   )currv   retnewmds   &&  r!   rX   rX   x  s    
((*CJJ{B'Ef[)400vk23))3{+;U*CDCzz"## $vzz:J/K Lf!+.K#M2MJr#   c                   >   a  ] tR tRt o R tV 3R lR ltR tRtV tR# )DataSourceNoCloudNeti  c                @    \         P                  WW#4       RV n        R# )r   Nr   )r
   r   r   r   s   &&&&r!   r   DataSourceNoCloudNet.__init__  s    ""4&@&
"r#   c                    < V ^8  d   QhRS[ /# r   r   )r   r   s   "r!   r   !DataSourceNoCloudNet.__annotate__  s     
 
s 
r#   c                J    \         P                  RV V P                  V4       R# )r   z6%s only uses seeds starting with %s - %s is not valid.N)r[   ra   r   r   s   &&r!   rg   +DataSourceNoCloudNet._log_unusable_seedfrom  s     D&&		
r#   c                H   \        \        P                  RRRR7      pR\        P                  ! 4       8X  d
   V! 4        R# \        P
                  ! \        P                  ! R4      ;'       g    R4      P                  4       pW P                  P                  4       R39   d'   \        P                  R	V 4       VR8X  d   V! 4        R# V P                  P                  R
/ 4      P                  R/ 4      P                  R4      '       d   \        P                  RV 4       R# R# )zCheck dmi and kernel command line for dsname

NoCloud historically used "nocloud-net" as its dsname
for network timeframe (DEP_NETWORK), which supports http(s) urls.
For backwards compatibility, check for that dsname.
z!The 'nocloud-net' datasource namez24.1zhUse 'nocloud' instead, which uses the seedfrom protocolscheme (http:// or file://) to decide how to run.r   r   TrC   r'   zJMachine is configured by dmi serial number to run on single datasource %s.
datasourcer   rG   zMMachine is configured by system configuration to run on single datasource %s.F)r   r   r   r   parse_cmdlineparse_cmdline_or_dmir   rU   r3   r   r[   r\   r   r_   )r   log_deprecatedrt   s   &  r!   	ds_detectDataSourceNoCloudNet.ds_detect  s     !:%D
 G1133--45;;

%' 	 kk'')=99II(
 & LL\2.SBS_ II(
 r#   )r   N)	r   r   r   r   r   rg   r   r   r   )r   s   @r!   r   r     s     

 
- -r#   r   c                 8    \         P                  ! V \        4      # rK   )r   list_from_dependsdatasources)dependss   &r!   get_datasource_listr     s    $$Wk::r#   __main__)argv)levelzseeded: zud: zvd: z	network: rK   )%rc   loggingr   	functoolsr   	cloudinitr   r   r   r   cloudinit.netr   	getLoggerr   r[   r   r
   r   rV   r   rX   r   DEP_FILESYSTEMDEP_NETWORKr   r   sysr   basicConfigDEBUGrG   ri   r{   r|   r}   r~   printr   r#   r!   <module>r     s     	  3 3 !$** $D.B%P$@, @J //12G22G4G4GHI; zgmm,AwH#//9GRW	HWI
	D+	D+	IgY
  r#   