+
    €DAiL  ã                   ó¨   € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^RI	H
t
 ^RIHt ^RIHt ^RIHt ^xt ! R R]P"                  4      tR# )znetplan try command lineN)ÚConfigManager)Úutils)ÚNetplanApply)Úterminalc                   ó~   a a€ ] tR t^'t oV 3R lt]R 4       tR tR tR t	R t
R tR tR	 tR
 tR tR tRtVtV ;t# )Ú
NetplanTryc                ó<  <€ \         SV `  R RRR7       RV n        RV n        RV n        RV n        RV n        RV n        \        P                  P                  RR4      V n        \        P                  P                  V P                  V P                  4      V n        R# )ÚtryzLTry to apply a new netplan config to running system, with automatic rollbackT)Ú
command_idÚdescriptionÚleafFNÚDBUS_TEST_NETPLAN_ROOTÚ/)ÚsuperÚ__init__Úconfiguration_changedÚnew_interfacesÚconfig_fileÚ_config_managerÚ
t_settingsÚtÚosÚenvironÚgetÚ_rootdirÚpathÚjoinÚtry_ready_stampÚ_netplan_try_stamp)ÚselfÚ	__class__s   &€Ú:/usr/share/netplan/netplan_cli/cli/commands/try_command.pyr   ÚNetplanTry.__init__)   sˆ   ø€ Ü‰Ñ Eð&Gà"ð 	ô 	$ð &+ˆÔ"Ø"ˆÔØˆÔØ#ˆÔØˆŒØˆŒÜŸ
™
Ÿ™Ð'?ÀÓEˆŒÜ"$§'¡'§,¡,¨t¯}©}¸d×>RÑ>RÓ"SˆÖó    c                ót   € V P                   '       g   \        V P                  R 7      V n         V P                   # ))Úprefix)r   r   r   ©r   s   &r!   Úconfig_managerÚNetplanTry.config_manager7   s+   € à×#×#Ð#Ü#0¸¿¹Ô#FˆDÔ Ø×#Ñ#Ð#r#   c                ó¨   € \         P                  P                  V P                  4      '       d#   \         P                  ! V P                  4       R # R# )TF)r   r   Úisfiler   Úremover&   s   &r!   Úclear_ready_stampÚNetplanTry.clear_ready_stamp=   s3   € Ü�7‰7�>‰>˜$×1Ñ1×2Ò2Ü�IŠI�d×-Ñ-Ô.ÙÙr#   c                ó¢   € \         P                  ! V P                  R ,           RRR7       \        V P                  R4      P                  4        R# )z/run/netplaniÀ  T)ÚmodeÚexist_okÚwN)r   Úmakedirsr   Úopenr   Úcloser&   s   &r!   Útouch_ready_stampÚNetplanTry.touch_ready_stampC   s4   € Ü
�Š�D—M‘M NÕ2¸ÈÕNÜˆT×$Ñ$ cÓ*×0Ñ0Ö2r#   c                ó*  € V P                   P                  R RR7       V P                   P                  R\        \        RR7       V P                   P                  RRR7       V P                  V n        V P                  4        V P                  4        R# )	z--config-filezGApply the config file in argument in addition to current configuration.)Úhelpz	--timeoutz=Maximum number of seconds to wait for the user's confirmation)ÚtypeÚdefaultr8   z--statez0Directory containing previous YAML configurationN)ÚparserÚadd_argumentÚintÚDEFAULT_INPUT_TIMEOUTÚcommand_tryÚfuncÚ
parse_argsÚrun_commandr&   s   &r!   ÚrunÚNetplanTry.runG   s†   € Ø�‰× Ñ  Ø&oð 	!ô 	qà�‰× Ñ  Ü&)Ô3HØ&eð 	!ô 	gð 	�‰× Ñ  Ø&Xð 	!ô 	Zð ×$Ñ$ˆŒ	à�‰ÔØ×ÑÖr#   c                ó‚  € V P                  4       '       g%   \        P                  ! \        P                  4        \        P
                  P                  4       p\        P                  ! V4      V n	        V P                  P                  V P                  4       \        P                  ! \        P                  V P                  4       \        P                  ! \        P                  V P                  4       V P!                  4        V P#                  4        \%        4       P'                  R R RV P(                  R7       V P+                  4        V P                  P-                  V P.                  R7       V P                  '       d&   V P                  P;                  V P                  4       V P=                  4        V P?                  4        R#   \        P0                   d    \3        R4       T P5                  4         L‹\        P6                   d    \3        R4        L¬\8         d8   p\3        RT,          4       \3        R4       T P5                  4         Rp?LèRp?ii ; i  T P                  '       d&   T P                  P;                  T P                  4       T P=                  4        T P?                  4        i ; i)TF©Úrun_generateÚsyncÚexit_on_errorÚ	state_dir)Útimeoutz
Reverting.z
Configuration accepted.z
An error occurred: %sN) Úis_revertableÚsysÚexitr   Ú	EX_CONFIGÚstdinÚfilenor   ÚTerminalr   Úsaver   ÚsignalÚSIGINTÚ_signal_handlerÚSIGUSR1ÚbackupÚsetupr   Úcommand_applyÚstater5   Úget_confirmation_inputrK   ÚInputRejectedÚprintÚrevertÚInputAcceptedÚ	ExceptionÚresetÚcleanupr,   )r   ÚfdÚes   &  r!   r?   ÚNetplanTry.command_tryU   s¼  € Ø×!Ñ!×#Ò#Ü�HŠH”R—\‘\Ô"ð	%Ü—‘×!Ñ!Ó#ˆBÜ×&Ò& rÓ*ˆDŒFØ�F‰F�K‰K˜Ÿ™Ô(ô �MŠMœ&Ÿ-™-¨×)=Ñ)=Ô>Ü�MŠMœ&Ÿ.™.¨$×*>Ñ*>Ô?à�K‰KŒMØ�J‰JŒLä‹N×(Ñ(°dÀÐUZÐfj×fpÑfpÐ(Ôqð ×"Ñ"Ô$Ø�F‰F×)Ñ)°$·,±,Ð)Ô?ð �v�vˆvØ—‘—‘˜TŸ_™_Ô-Ø�L‰LŒNØ×"Ñ"Ö$øô ×%Ñ%ô 	Ü�.Ô!Ø�K‰KŽMÜ×%Ñ%ô 	/ÜÐ-Ö.Üô 	ÜÐ+¨aÕ/Ô0Ü�.Ô!Ø�K‰K�M‰Mûð	ûð
 �v�vˆvØ—‘—‘˜TŸ_™_Ô-Ø�L‰LŒNØ×"Ñ"Õ$úsO   ¼D9G Ç0I"Ç>I% È I"ÈI"ÈI% È!I"È*I"È+-IÉI% ÉI"É"I% É%AJ>c                ój   € R pV P                   '       d   RpV P                  P                  VR7       R# )FT)Úbackup_config_dirN)r   r'   rX   )r   rh   s   & r!   rX   ÚNetplanTry.backupz   s2   € Ø!ÐØ××ÐØ $ÐØ×Ñ×"Ñ"Ð5FÐ"ÖGr#   c                óÀ  € V P                   '       dÅ   \        P                  P                  R RR4      p\        P                  P	                  V P                   4      P                  R4      p\        P                  ! 4       p\        P                  P                  VRP                  W#4      4      pV P                  P                  V P                   V/4       RV n
        R# )r   ÚetcÚnetplanz.yamlz
{}.{}.yamlTN)r   r   r   r   ÚbasenameÚrstripÚtimeÚformatr'   Úaddr   )r   Údest_dirÚ	dest_nameÚdest_suffixÚ	dest_paths   &    r!   rY   ÚNetplanTry.setup€   sš   € Ø××ÐÜ—w‘w—|‘| C¨°	Ó:ˆHÜŸ™×(Ñ(¨×)9Ñ)9Ó:×AÑAÀ'ÓJˆIÜŸ)š)›+ˆKÜŸ™Ÿ™ X¨|×/BÑ/BÀ9Ó/ZÓ[ˆIØ×Ñ×#Ñ# T×%5Ñ%5°yÐ$AÔBØ%)ˆÖ"r#   c                ót  € \         P                  ! 4       p\        P                  P	                  VR R4      p\        P
                  ! V4       V P                  P                  RVRR7       V P                  P                  4        \        4       P                  RRRVR7       \        P                  ! V4       R# )rk   rl   z/etc/netplanT)Údirs_exist_okFrF   N)ÚtempfileÚmkdtempr   r   r   r2   r'   Ú	copy_treer_   r   rZ   ÚshutilÚrmtree)r   ÚtempdirÚconfdirs   &  r!   r_   ÚNetplanTry.revert‰   s†   € ä×"Ò"Ó$ˆÜ—'‘'—,‘,˜w¨¨yÓ9ˆÜ
�Š�GÔØ×Ñ×%Ñ% n°gÈTÐ%ÔRà×Ñ×"Ñ"Ô$Ü‹×$Ñ$°%¸dÐRWÐcjÐ$Ôkä�Š�gÖr#   c                ó:   € V P                   P                  4        R # ©N)r'   rc   r&   s   &r!   rc   ÚNetplanTry.cleanup•   s   € Ø×Ñ×#Ñ#Ö%r#   c                óØ  € . pV P                   '       d   VP                  V P                   4       Rp V P                  P                  VR7      p. p/ pVP                  VP                  4       VP                  VP                  4       VP                  4        F6  pVP                   '       d   K  RpVP                  VP"                  V34       K8  	  V'       d3   V F  w  r‡\%        RP'                  W‡4      4       K!  	  \%        R4       R# R#   \        P
                   dF   p\        P                  ! T4       \        P                  ! \        P                  4        Rp?ELRp?ii ; i)aÃ  
Check if the configuration is revertable, if it doesn't contain bits
that we know are likely to render the system unstable if we apply it,
or if we revert.

Returns True if the parsed config is "revertable", meaning that we
can actually rely on backends to re-apply /all/ of the relevant
configuration to interfaces when their config changes.

Returns False if the parsed config contains options that are known
to not cleanly revert via the backend.
N)Úextra_configzBreverting custom parameters for bridges and bonds is not supportedz{}: {}zL
Please carefully review the configuration and use 'netplan apply' directly.FT)r   Úappendr'   Úparser   Úconfig_errorsÚloggingÚerrorrM   rN   r   rO   ÚupdateÚbridgesÚbondsÚvaluesÚ_is_trivial_compound_itfÚidr^   rp   )	r   r…   Únp_statere   Úrevert_unsupportedÚmulti_ifaceÚitfÚreasonÚifnames	   &        r!   rL   ÚNetplanTry.is_revertable˜   s$  € ð ˆØ××ÐØ×Ñ × 0Ñ 0Ô1Øˆð	#Ø×*Ñ*×0Ñ0¸lÐ0ÓKˆHð
  Ðð 9;ˆØ×Ñ˜8×+Ñ+Ô,Ø×Ñ˜8Ÿ>™>Ô*Ø×%Ñ%Ö'ˆCØ×/×/Ò/Ø]�Ø"×)Ñ)¨3¯6©6°6Ð*:Ö;ñ (÷
 Û"4‘�Ü�h—o‘o fÓ5Ö6ñ #5äÐaÔbÙÙøô/ ×"Ñ"ô 	#Ü�MŠM˜!ÔÜ�HŠH”R—\‘\×"Ò"ûð	#ús   ³D ÄE)Ä$:E$Å$E)c                ó¨   € V\         P                  8X  d   \        P                  ! 4       hV P                  '       d   \        P
                  ! 4       hR # r‚   )rT   rW   r   r`   r   r]   )r   ÚsigÚframes   &&&r!   rV   ÚNetplanTry._signal_handlerÅ   s=   € Ø”&—.‘.Ô Ü×(Ò(Ó*Ð*à×)×)Ð)Ü×,Ò,Ó.Ð.ñ *r#   )	r   r   r   r   r   r@   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   Úpropertyr'   r,   r5   rC   r?   rX   rY   r_   rc   rL   rV   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r    Ú__classdict__s   @@r!   r   r   '   sY   ù‡ € õTð ñ$ó ð$ò
ò3òò#%òJHò*ò
ò&ò+÷Z/ò /r#   r   )Ú__doc__r‰   rl   r   ro   r|   rT   rM   ry   Úconfigmanagerr   Ú r   Úapplyr   r   r>   ÚNetplanCommandr   © r#   r!   Ú<module>r«      sJ   ðñ$ ã Û Û 	Û Û Û Û 
Û å *Ý Ý Ý ð Ð ôc/�×%Ñ%ö c/r#   