Current File : //proc/self/root/usr/lib/python3/dist-packages/cloudinit/cmd/__pycache__/main.cpython-312.pyc
�

 Nh���z�ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZddlm
Z
mZddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/e0Z1dZ2dZ3e,e-e.d�Z4ddddd �Z5ejle7�Z8dAd!�Z9dBd"�Z:d#�Z;ejxd$�e8jzfd%e
e0gdffd&��Z>d'�Z?d(e$fd)�Z@d*�ZAdCd+�ZBdDd,e	eCe0ffd-�ZDd.�ZEd/�ZFd0eee0eGfd,e	eHe1ffd1�ZId2eej�d,e	eHe1ffd3�ZKd4�ZLd5�ZMd6�ZNd7�ZOd8�ZPd9ej�fd:�ZRd;�ZSd<�ZTdBd=�ZUd>�ZVd?�ZWe7d@k(r#ej�eUej���yy)E�N)�Optional�Tuple�Callable�Union)�features�netinfo)�signal_handler)�sources)�socket)�stages)�
url_helper)�util)�performance)�version)�warnings)�	reporting)�
atomic_helper)�	lifecycle)�handlers)�log_util�loggers)�read_cfg_paths)�cc_set_hostname)�Modules)�validate_cloudconfig_schema)�log_with_downgradable_level)�events)�PER_INSTANCE�
PER_ALWAYS�PER_ONCE�CLOUD_CONFIGzOCloud-init v. {version} running '{action}' at {timestamp}. Up {uptime} seconds.zcloud_%s_modules)�instance�always�oncezLocal Stagez
Network StagezConfig StagezFinal Stage)�
init-local�init�modules-config�
modules-finalc��|r"tjjd|z�tjjd�tjjd�tjtj��tjjd�tjjd�y)N�%s
z<------------------------------------------------------------�
)�file)�sys�stderr�write�	traceback�	print_exc��msgs �4/usr/lib/python3/dist-packages/cloudinit/cmd/main.pyr1r1Tsu��
��
�
����3��(��J�J���X���J�J���T��
���S�Z�Z�(��J�J���X���J�J���T��c�`�|st|�}tjd|zddt��|S)Nr*FT)�consoler.�log)�welcome_formatr�	multi_log�LOG)�actionr3s  r4�welcomer=^s,����V�$�����v��~�u�T�s�K��Jr5c��tjtj�t	j
�t	j�|��S)N)r�uptime�	timestampr<)�WELCOME_MSG_TPL�formatr�version_stringrr?�time_rfc2822�r<s r4r9r9es>���!�!��&�&�(��{�{�}��#�#�%��	"��r5�
Closing stdin�loggerc�d�tjtjj	��sk|d�ttj�5}tj|j	�tjj	��ddd�y|d�y#1swYyxYw)zj
    reopen stdin as /dev/null to ensure no side effects

    logger: a function for logging messages
    rFNz"Not closing stdin, stdin is a tty.)�os�isattyr-�stdin�fileno�open�devnull�dup2)rG�fps  r4�close_stdinrQnsy���9�9�S�Y�Y�%�%�'�(����
�"�*�*�
�	5���G�G�B�I�I�K����!1�!1�!3�4�	5�	5�	�3�4�	5�	5�s
�AB&�&B/c��g}|jrI|jD]:}|jtjj	|j
���<|S�N)�files�appendrI�path�realpath�name)�args�fn_cfgs�fhs   r4�extract_fnsr\}sK���G��z�z��*�*�	6�B�
�N�N�2�7�7�+�+�B�G�G�4�5�	6��Nr5�modsc�N�t|z}|j|�\}}t|�t|�z}|dk(rBd|�d|�d�}tjjd|z�tj|�gStjdt|�t|��|S)NrzNo 'z ' modules to run under section '�'r*zRan %s modules with %s failures)�MOD_SECTION_TPL�run_section�lenr-r.r/r;�debug)r]�action_name�section�full_section_name�	which_ran�failures�total_attemptedr3s        r4�run_module_sectionrj�s���'�7�3�� �,�,�->�?��Y���)�n�s�8�}�4�O��!����
��	�
�
����3��(��	�	�#���	��	�	�-�s�9�~�s�8�}�	
��r5c�p�|jd�r%tj|jd��yy)Nr)�getr�update_configuration)�cfgs r4�apply_reporting_cfgro�s*��
�w�w�{���&�&�s�w�w�{�';�<�r5c�x�tj|�}|D]}||vs�|||fcStd|�d|�d���)Nz	No keys (z) found in string 'r_)r�keyval_str_to_dict�KeyError)�cmdline�names�data�keys    r4�parse_cmdline_urlrw�sH���"�"�7�+�D��"���$�;���S�	�>�!�"��'�5�I�
J�Jr5�returnc��|�tj�}	t|�\}}|j
d�}|rmtjj|�rN|r/d|�d|�d�}tj}|rtj
}||fSd|�d|�d�}tj}||fS|dd	d
d�}|s|rtj}d|d
<ntj
}d|d
<d}	d}
	tjd%i|��}d}|j�r�d
}
t|tj �r<	|t#|j%t'|
����z
}|j
|
�s d}
n|j*j
|
�sd}
|
r|dk(rgt-j.dddd
��S|dk(rtj}ntj}|d|�dt1|
���fS|d|�d|j2�d�fS||j*z}	tj6||	d �!�tjd"|�d#|�d$|��fS#t$rtj
dfcYSwxYw#t($rY��wxYw#tj4$r}|d|�d|��fcYd}~Sd}~wwxYw)&a�Write data from url referenced in command line to path.

    path: a file to write content to if downloaded.
    network: should network access be assumed.
    cmdline: the cmdline to parse for cloud-config-url.

    This is used in MAAS datasource, in "ephemeral" (read-only root)
    environment where the instance netboots to iscsi ro root.
    and the entity that controls the pxe config has to configure
    the maas datasource.

    An attempt is made on network urls even in local datasource
    for case of network set up in initramfs.

    Return value is a tuple of a logger function (logging.DEBUG)
    and a message indicating what happened.
    Nz!No kernel command line url found.)zfile://�/zfile 'zC' existed, possibly from local stage download of command line url 'z'. Not re-writing.zE' existed, possibly from previous boot download of command line url '�
�T)�url�timeout�retries�stream��sec_betweeng�������?s
#cloud-configr5)�
chunk_sizeFr}z!The kernel command line key `url`z22.3zD Please use `cloud-config-url` kernel command line parameter instead��
deprecated�deprecated_version�
extra_message�skip_log�cloud-config-urlz
contents of 'z' did not start with zurl 'z' returned code z. Ignoring.zretrieving url 'z
' failed: i�)�modezwrote cloud-config data from z='z' to �)r�get_cmdlinerwrr�logging�DEBUG�
startswithrIrV�exists�INFO�WARNr
�read_file_or_url�ok�
isinstance�UrlResponse�next�iter_contentrb�
StopIteration�contentsr�	deprecate�str�code�UrlError�
write_file)rV�networkrs�cmdline_namer}�
path_is_local�m�level�kwargsru�header�resp�sniffed_content�is_cloud_cfg�es               r4�attempt_cmdline_urlr��s���&���"�"�$��D�-�g�6���c��N�N�#3�4�M��������-��AE�c�K�
��L�L�E���
�
���q�z���AE�c�K�
��L�L�E��q�z���R�A��
F�F��-����� !��}���
�
�� #��}���D�
�F�*D��*�*�4�V�4�����7�7�9��L��$�
� 6� 6�7��#�t��)�)�S��[�)�A�(��O�
'�1�1�&�9�#(�L��]�]�-�-�f�5�$����5�(�$�.�.�#F�+1�'@�!%��� �#5�5�#�L�L�E�#�L�L�E��#�C�5�(=�c�&�k�]�K����:=�t�y�y�I��
�����.��
	�O�O�D�$�U�+������d�	$����]�D��
�
�B�C�C�D��V%�����>���D��3��B�C�C��D�sg�H-�!AI�%'I�AI�8I�I�+I�-I�
I�	I�I�I�I�J�1	J�:J�Jc��dtjjtjjfz}tj
j
|jjd�d�}tj
j|�rXtj|�}||k7r=tjd�|jd�tj||�yytj
j|jj!d��rtj#d�tj||�y)	z�Purge the cache if python version changed on us.

    There could be changes not represented in our cache (obj.pkl) after we
    upgrade to a new version of python, so at that point clear the cache
    z%d.%druzpython-versionz-Python version change detected. Purging cacheT�obj_pklzMWriting python-version file. Cache compatibility status is currently unknown.N)r-�version_info�major�minorrIrV�join�paths�	get_cpathr�r�load_text_filer;rc�purge_cacher��
get_ipath_cur�info)r&�current_python_version�python_version_path�cached_python_versions    r4�$purge_cache_on_python_version_changer�s��%�����������(����'�'�,�,��
�
���V�$�&6���
�w�w�~�~�)�*� $� 3� 3�4G� H��!�$:�:��I�I�E�F����T�"��O�O�/�1G�H�;�
�7�7�>�>�$�*�*�2�2�9�=�>��H�H�C�
�	
���+�-C�Dr5c�^�tj|jd�ry|jS)N�disable_network_activationF)r�get_cfg_option_boolrn�local)r&rYs  r4�_should_bring_up_interfacesr�5s&��������*F�G���z�z�>�r5�
raw_configc�@�|sytj|j�dd�dk7ry	tj|�}t|t�sy
d|vrG|dD]?}|jd�xsi}|jd
d�}|s�-|jd�r�?y|jd�ry|jdi�jd�ry|jd�ryy#t
$r-}t
tdtjd|f��Yd}~y	d}~wwxYw)a�Determine if our cloud-config requires us to wait

    User data requires us to wait during cloud-init network phase if:
    - We have user data that is anything other than cloud-config
      - This can likely be further optimized in the future to include
        other user data types
    - cloud-config contains:
      - bootcmd
      - random_seed command
      - mounts
      - write_files with source
    )Fzno configuration foundN�*ztext/cloud-config)Tz non-cloud-config user data foundz24.4z'Unexpected failure parsing userdata: %s)rGr�requested_levelr3rY)Tz!failed to parse user data as yaml)Tz(parsed config not in cloud-config format�write_files�source�uri�)rzzfile:)Tz!write_files with source uri found�bootcmd)Tz
bootcmd found�random_seed�command)Tzrandom_seed command found�mounts)Tzmounts found)Fz8cloud-config does not contain network requiring elements)r�type_from_starts_with�strip�yaml�	safe_load�	Exceptionrr;r��WARNINGr��dictrlr�)r��parsed_yamlr��item�source_dict�
source_uris      r4�_should_wait_via_user_datar�;s"���.�	�&�&�z�'7�'7�'9�#�2�'>�?��	�8�
9��n�n�Z�0���k�4�(�?���#��
�.�	A�D��(�(�8�,�2��K�$�����3�J��:�#8�#8��#H�@�		A�
���y�!�$����}�b�)�-�-�i�8�0����x� �#�L��5�9�#���#�O�O�9���	
�9��9�s�C'�'	D�0#D�D�
datasourcec��|syt|j��\}}|rd|�d�fSt|j��\}}|rd|�d�fSt|j��\}}|rd|�d�fSdd|�d|�d	|��fS)
z�Determine if we should wait on network connectivity for cloud-init.

    We need to wait during the cloud-init network phase if:
    - We have no datasource
    - We have user data that may require network access
    )Tzno datasource foundTz
 in user dataz in vendor dataz in vendor data2Fzuser data: z, vendor data: z, vendor data2: )r��get_userdata_raw�get_vendordata_raw�get_vendordata2_raw)r��user_should_wait�user_reason�vendor_should_wait�
vendor_reason�vendor2_should_wait�vendor2_reasons       r4�_should_wait_on_networkr�vs����*�$>��#�#�%�%�!��k����}�M�2�2�2�(B��%�%�'�)�%��
���
��o�6�6�6�*D��&�&�(�+�'������'�'7�8�8�8�	��+��'�)�?�+�+�,�
.��r5c����tjtjg}|jrtjg}t	t
jjdtzd�|j��g�|jrdnd}t|�}tj||j��}|jt|��d}d}	|js2t!�fd��t#j$|j&|�\}}n#t#j(|j&|�\}}|j8r)t.j9d	�t;j<�|js4t;j>|j&�tA|j&�tC||�
�t.jEdtjF�|��D]\}	}t.jI|	|��	|jK�|jL}
tO|�|jrtjPntjR}|tjRk(r�tTjVrgt
jjY|jLj[d
��s/t.j9d�|j\j_�d}t`jbjedtgjh�z�n�d}t#jj|j&dd�}
|
rt.j9d�d}nH|
jmd�}t
jjY|�rt.j9d|�d}|jo�tq||�}	|js|��|tjRk(r>|jtjv|k7r%t.j9d||jt�dgfSt|�|j��}t.j9d||||j���|tjPk(rt�|d d!�"�|j}|��|tjPk(r�tTjVrvt�|jt�\}}|rt.j9d#|�nEt.j9d$|�t#j�|jLj[d
�d%�|jtjv|k7r/t.j9d&||jt�|jtgfSt.j9d'||jt�|j��|j��t�|d(d)�"�	|j��j�d*|j�t�gt��+�\}}|s|j�t��|jLjmd-�}t
jjY|�rXtj�|�j�d.k7r6t�t�j�t#j�|��ddd/�0�nt.j9d1�tA|j&�t�|t|�|j�2�}	|}|}t#j(|j&|�\}}||k7s||k7r:t.j�d3||�t#j$|j&|�\}}t;j>|j&�|j��t�|jt|j&�5�|jtt�|||�fS#t*$rLd}t#j,t.|�t1|��j3t4j6|f�Y���wxYw#t*$rt#j,t.d�Y��/wxYw#tjx$r�|tjPk(rt.j9d�nt#j,t.d�|jzsH|j}|��t.j9d|�|tjPk(rdgfcYSddgfcYSt.j9d|�Y���wxYw#t*$r,t#j,t.d,�|jtd,gfcYSwxYw#t*$rt#j,t.d4�Y��wxYw)6Nz%s.dz91_kernel_cmdline_url.cfg)rVr�r%r&��ds_deps�reporterc�F���jtj|f�SrS)rUr�r�)r3�
early_logss �r4�<lambda>zmain_init.<locals>.<lambda>�s���J�$5�$5�w�}�}�c�6J�$K�r5�#Failed to setup output redirection!�@Logging being reset, this logger may no longer be active shortlyr2�!PID [%s] started cloud-init '%s'.z0Failed to initialize, likely bad things to come!z
.skip-networkz4Will wait for network connectivity before continuing�trustr*�check�manual_cache_cleanFz"manual cache clean set from config�manual_clean_markerz(manual cache clean found from marker: %s��existingz)[%s] Exiting. datasource %s in local modezNo local datasource foundz8No instance datasource found! Likely bad things to come!)�bring_upz[%s] Exiting without datasourcezNo instance datasource found.z2[%s] barreling on in force mode without datasourcez5[%s] %s will now be targeting instance id: %s. new=%sr�r�)�stage�retry_stagezTNetwork connectivity determined necessary for cloud-init's network stage. Reason: %szVNetwork connectivity determined unnecessary for cloud-init's network stage. Reason: %sr�z.[%s] Exiting. datasource %s not in local mode.z6[%s] %s is in local mode, will apply init modules now.zinit-netzmodules:config�consume_data)rY�freqzConsuming user data failed!�cloud_configrT)�config�strict�log_details�log_deprecationsz2Skipping user-data validation. No user-data found.�r�z#Stdout, stderr changing to (%s, %s)z'Failed to re-adjust output redirection!)r�rn)Wr
�DEP_FILESYSTEM�DEP_NETWORKr�r�rIrVr�r!r9r�Initr��read_cfgr\�skip_log_setuprQr�fixup_outputrn�get_output_cfgr��logexcr;r1rUr�r�rcr�
reset_logging�
setup_loggingror=r��getppidr8�
initializer�r��DSMODE_LOCAL�DSMODE_NETWORKr�MANUAL_NETWORK_WAITr��get_runpath�distro�wait_for_networkr-r.r/r�
debug_infor�r�r�r��fetchr��dsmode�DataSourceNotFoundException�force�apply_network_config�_maybe_persist_instance_data�
instancify�is_new_instance�_maybe_set_hostnamer�r��setup_datasource�update�cloudify�runr�rr�stat�st_sizerr�r�r�r�warning�activate_datasource�di_report_warnrj)rXrY�deps�bootstage_name�w_msgr&�outfmt�errfmtr3�lvl�path_helperr�r��mcfg�mfile�bring_up_interfaces�iid�should_wait�reason�ran�_results�cloud_cfg_pathr]�outfmt_orig�errfmt_origr�s                         @r4�	main_initr7�sw����"�"�G�$7�$7�8�D��z�z��&�&�'��	��������%�'B���
�
�N�		
��J�,&*�Z�Z�\�V�N��>�*�E��;�;�t�d�m�m�<�D��M�M�+�d�#�$�
�F�
�F�
/��"�"��K�L�!�.�.�t�x�x��>�N�F�F�!�0�0����4�@�N�F�F��z�z��	�	�N�	
�	����������d�h�h�'��D�H�H�%�
�D�e���H�H�
0�"�*�*�,��O�����S�����S���M������*�*�K�(��.�#'�:�:�7���7�3I�3I�D��w�%�%�%��'�'�������J�J�"�"�?�3�1
�
�I�I�L�M��K�K�(�(�*����
�
����7�#5�#5�#7�8�9����'�'����2F��N����I�I�:�;��H��-�-�.C�D�E��w�w�~�~�e�$��	�	�D�e�L�"������6�d�D�A����
�
�H�
�%��7�)�)�)�d�o�o�.D�.D��.L��I�I�;�����
�
�"�:��.!��&�
�/�/�
�C��I�I�?����������w�#�#�#�	�D��Y�G����':��;��w�#�#�#��'�'�"9�$�/�/�"J��K����	�	�=����	�	�=���
����
�
� 6� 6�� G��L��?�?�!�!�T�)��I�I�@�����
�
�O�O�R�(�(��I�I�H�����
�	�����K�K�M���J�<L�M�B��-�-�/�-�-��������	.�
���h��
���j�)��Z�Z�-�-�n�=�N�	�w�w�~�~�n�%�"�'�'�.�*A�*I�*I�Q�*N�#��>�>�$�"5�"5�n�"E�F���!�		
�	�	�	�F�G�����!��4��T�*�T�]�]�C�D�D������.�.�t�x�x��>�����&� �K�6�$9��K�K�=�v�v�N�#�0�0����4�@��V�V����$�(�(�#�	�����d�o�o�4�8�8�<�
�O�O�/��d�D�A�B�B��Y�/�3�����C����#�����7�<�<��-�.�	/��8�M����C�K�L�M��T�.�.���7�'�'�'��I�I�1�2��K�K��O�
��z�z��%�%�/B�%�C��I�I�7��>��w�+�+�+��b�z�!��>�?�@�@��I�I�D�d�
�%��@�B����C�6�7����"?�!@�A�A�B��8�D����C�B�C�D�sl�A!_�`�;A"a�Ad�2A+e�A`�`�#a�a�B!d�+d�2d�d�2e�e�#e.�-e.c��d|vrtjd�y|d}|�tjd�yt|t�stj	d|�y|jd�}|�tj	d�yt|t�stj	d|�y|jjd�d	}|jtj�r|ttj�d}ntj	d
||�||vrtjd|||�ytjd||t|��
�y)N�	di_reportzno di_report found in config.zdi_report was None.z%di_report config not a dictionary: %s�datasource_listz(no 'datasource_list' found in di_report.z(di_report/datasource_list not a list: %s�.r|z1Datasource '%s' came from unexpected module '%s'.z:used datasource '%s' from '%s' was in di_report's list: %s�dsid_missing_source)r��dslist)r;rcr�r�r"rl�list�
__module__�
rpartitionr�r
�	DS_PREFIXrbr�show_warningr�)r�rn�dicfgr=�modnames     r4r$r$�s7���#���	�	�1�2�����E��}�	�	�	�'�(���e�T�"����;�U�C��
�Y�Y�(�
)�F�
�~����>�?��
���
%����>��G���#�#�.�.�s�3�A�6�G����'�+�+�,��#�g�/�/�0�2�3�����?���	
��&���	�	�H����		
�	�����s�7�3�v�;�r5c�H�|j}|�d|��}t|�}tjg|j��}|jt
|��	|jd��t|�t!|t
|�|j��}	|j"s*t%�tj&|j(|�|j,r)tj-d�t/j0�|j"s4t/j2|j(�t5|j(�t7||�	�tj9d
t;j<�|�|dk(rt?j@dd
d��tC|||�S#tj$r?d|z}tjt|�t|�|js|gcYSY���wxYw#t*$rtjtd�Y��PwxYw)N�:r�r�r�zGCan not apply stage %s, no datasource found! Likely bad things to come!r�r�r�r2r�r&z
`--mode init`�24.1�Use `cloud-init init` instead.)r�r�r�)"r�r9rrr�rr\rr
rrrr;r1rrrrrQrrnr�rcrrr	ror=r�rIr
rr�rj)rdrYrXr&r'r&r3r]s        r4�main_modulesrI�s����9�9�D�!,�T�2�N��>�*�E��;�;�r�D�M�M�:�D��M�M�+�d�#�$���
�
�G�
�$�!��&��4��T�*�T�]�]�C�D�@��"�"��M����d�h�h��-��z�z��	�	�N�	
�	����������d�h�h�'��D�H�H�%��D�e���H�H�
0�"�*�*�,��O��v�~����&�%�:�	
��d�D�$�/�/��U�.�.�	�
� $�
%�	�	
���C����#���z�z��7�N��	��$�@����C�>�?�@�s%�F%�6G:�%AG7�6G7�:#H!� H!c��|j}t|�}tjg|j��}|jt
|��	|jd��t|�t!|t
|�|j��}|j"}|rtj%d|�|j&}|r+tj%d|�t(j+|�}	t-�tj.|j0d�|j$r)tj%d
�t5j6�t5j8|j0�t;|j0�t=||��|j?|||�\}}	|	rtjAd|�y|stjAd
|�yy#tj$r7tjtd�td�|jsYyY���wxYw#t2$rtjtd	�Y��2wxYw)Nr�r�r�z;Failed to fetch your datasource, likely bad things to come!r�r�zUsing passed in arguments %szUsing passed in frequency %sr�r�r2zRan %s but it failed!zDid not run %s, does it exist?r)!rXr9rrr�rr\rr
rrrr;r1rrr�module_argsrc�	frequency�FREQ_SHORT_NAMESrlrQrrnr�rrr	ror=�
run_singler")
rXrY�mod_namer'r&r]�mod_args�mod_freqrgrhs
          r4�main_singlerRs����y�y�H��4� �E��;�;�r�D�M�M�:�D��M�M�+�d�#�$�
��
�
�G�
�$�!��&��4��T�*�T�]�]�C�D����H���	�	�0�(�;��~�~�H���	�	�0�(�;�#�'�'��1��@��
����$�(�(�D�)��z�z��	�	�N�	
�	�������$�(�(�#�����!��D�e��!�O�O�H�h��I��Y������+�X�6��
����4�h�?����e�.�.��	
����N�	
�	�I�	
��z�z�����4�@����C�>�?�@�s%�G�0*H&�AH#�"H#�&#I
�I
c
��t�}|jd�}tjj	|j
�}tjj
|d�}tjj
|d�}tjj
|d�}tjj
|d�}tj�}	tj||f�|j\}
}|dk(r|jrd}n&d}n#|dk(rd|jz}ntd|z��|tvrtd	j!|���giddd
�}
dd|
j#�|
j#�|
j#�|
j#�d�i}|dk(r!||||fD]}tj$|��n)	t'j(tj*|��}||dvr|
j#�|d|<|d}||d
<||dr%||dst.j1dt|�t3tj4��||d<t7t9d�|	j:��}|j=�}t?j@||�tjBtjjE||�|d��	|||�}|dvr|\}}|�tG|�|d<n|}||djI|D�cgc]
}tG|���c}�t3tj4��||d<d|d
<|j=�}|jU�|jW�D];}||vr'tYt[||||z��||d|<�.||||d|<�=t?j@||�|dk(r�g}|jW�D]O}t]||t^�s�||jad�s�,|jI||jadg���Qt?j@|d|d|d�i�tjBtjjE||�|d��tc||d�S#t,$rY���wxYwcc}w#t,$rO}t.jKd|�tMd|z�||djOtG|��Yd}~���d}~wtP$ri}|jRrRt.jKd|�tMd|z�||djOdtG|jR��d��Yd}~��Rd}~wwxYw#t3tj4��||d<d|d
<|j=�}|jU�|jW�D];}||vr'tYt[||||z��||d|<�.||||d|<�=t?j@||�wxYw)Nruzstatus.jsonzresult.jsonr&r%�modules�
modules-%szunknown name: %sz'Invalid cloud init mode specified '{0}')�errors�recoverable_errors�start�finished�v1)r�r&r%r'r(r�rXrYz=Unexpected start time found for %s. Was this stage restarted?c�6�t|tj�SrS)r�r�LogExporter)�hs r4r�z status_wrapper.<locals>.<lambda>�s��j��G�$7�$7�8�r5T)r)r&r%r�rVzfailed stage %szfailed run of stage %sz	sys.exit(z) calledrWr()r�rV)2rr�rIrV�normpath�run_dirr�r��	getLoggerr�ensure_dirsr<r�r��
ValueError�
STAGE_NAMErB�copy�del_file�json�loadsr�r�r;r"�floatr?r��filterr�export_logsr�
write_json�sym_link�relpathr��extend�	exceptionr1rU�
SystemExitr��
clean_logs�keysr>�setr�r�rlrb)rXrYr��data_d�link_d�status_path�status_link�result_path�result_link�root_logger�_name�functorr��
nullstatus�status�frZ�handler�preexisting_recoverable_errors�retr�rVr��new_recoverable_errorsrvr�s                          r4�status_wrapperr�Ls����E�
�_�_�V�
$�F�
�W�W�
�
�e�m�m�
,�F��'�'�,�,�v�}�5�K��'�'�,�,�v�}�5�K��'�'�,�,�v�}�5�K��'�'�,�,�v�}�5�K��#�#�%�K������	
���{�{��U�G��v�~��:�:��D��D�	
��	��d�i�i�'���+�d�2�3�3��:���5�<�<�T�B�
�	
�
� ���	�J�	
���O�O�%�$�/�/�+�(�o�o�/�'�_�_�.�
��F��|���{�K��E�	�A��M�M�!��	�	��Z�Z�� 3� 3�K� @�A�F��6�$�<��'�_�_�.��t��T��	���B��B�w�K�	�$�x����D��*�!5����K��t��	
�
�d�k�k�m�,�B�t�H�W����8�+�:N�:N�	
��G�
&-�%8�%8�%:�"����[�&�1��M�M�
������V�,�k���16��d�D�!���)�)�#&� �Z���%�#&�z�?��<� ��F�
�4����!�!�6�":�a�3�q�6�":�;�( %�T�[�[�]�3��4������7��")�!4�!4�!6������)�.�.�0�	�C��4�4�6:��6�s�;�0��5�6��7��4��-�.�s�3�7M��7��4��-�.�s�3�	�	� � ��f�5����������	7�A��"�Q�%��&�2�a�5�9�9�X�+>��
�
�b��e�i�i��"�5�6�	7�	� � ��
�"�\�"2�f�E�F�	
�	
�
�
��G�G�O�O�K��0�+�T�	
��r�$�x��!�"�"��A�	��	��N#;���*��
�
�'��.��*�T�1�2�
�4����!�!�#�a�&�)�)���	I�
�6�6�
�M�M�+�T�2��.��5�6��t�H�X��%�%�	�#�a�f�f�+��h�&G�H���	I�� %�T�[�[�]�3��4������7��")�!4�!4�!6������)�.�.�0�	�C��4�4�6:��6�s�;�0��5�6��7��4��-�.�s�3�7M��7��4��-�.�s�3�	�	� � ��f�5�sc�(R4�':S	�!S�3S	�4	S�S�S	�		V�AT�V�V�(AV�V�V�V�B.Yr&c���|jre|jrX|jjd�}tj
j
|�s|jjd��yyyy)zCWrite instance-data.json file if absent and datasource is restored.�
instance_dataF)�write_cacheN)r��ds_restoredr�rrIrVr��persist_instance_data)r&�instance_data_files  r4rr�sX�����4�+�+�!�Z�Z�3�3�O�D���w�w�~�~�0�1��O�O�1�1�e�1�D�2�,�r5c	�>�|j�}tj|j|d��\}}}|r$	t	j
d|j|d�yy#tj$r+}tjd||t|��Yd}~yd}~wwxYw)z�Call set_hostname if metadata, vendordata or userdata provides it.

    @param stage: String representing current stage in which we are running.
    @param retry_stage: String represented logs upon error setting hostname.
    T)�
metadata_only�set_hostnameNzGFailed setting hostname in %s stage. Will retry in %s stage. Error: %s.)
rr�get_hostname_fqdnrnr�handle�SetHostnameErrorr;rcr�)r&r�r��cloud�hostname�_fqdn�_r�s        r4rr�s���
�M�M�O�E��1�1����%�t���X�u�a��		��"�"�>�4�8�8�U�D�I����/�/�	��I�I�1����A��
�
��	�s�"A�B�1!B�Bc��tjjdjt	t
j��dz�y)Nr+)r-�stdoutr/r��sortedr�FEATURES)rXrYs  r4�
main_featuresr�s-���J�J���T�Y�Y�v�g�&6�&6�7�8�4�?�@r5c
�h	�tj�|stj}t	j
|j
d���}|jddddtj�zd��|jd	d
ddd
��|jddddd
��|jddddd
��|jd��|jdd��}|jdd��}|jdddd d
��|jd!d"d#d$d%t	jd&��'�|jdtf�(�|jd)d*��}tj d+d,d-d.�/�j"}|jd0d1d2d3|��d4d5�6�|jd!d"d#d$d%t	jd&��'�|jd)t$f�(�|jd7d8��}|jd9d:d2d;d.�<�|jd=d2d>d
t't(j+���?�|jd@ddAd
�<�|jdBdCdDdE�F�|jd!d"d#d$d%t	jd&��'�|jd7t,f�(�|jdGdH��}|jdIdJ��}|jdIt.f�(�|jdKdL��}	|jdMdN��}
|jdOdP��}|jdQdR��}|jdSdT��}
|jdUdV��}|�rt1dW�|D�d�}|dKk(rddXlm}||	�n�|dMk(rddXlm}||
�n�|dOk(r&ddYlm}m}||�Z�|jdO|f�(�n�|dQk(r%dd[lm}m}||�|jdQ|f�(�n�|dGk(r%dd\l m}m!}||�|jd]|f�(�ne|dUk(r%dd^l"m}m#}||�|jdU|f�(�n;|dSk(r6dd_l$m}m%}||
�|
jdS|f�(�n|jMd`�|jO|�a�}tQ|dbd
�|jRstU|�StS|�S)cNr)�progz	--versionz-vrz	%(prog)s z'Show program's version number and exit.)r<r�helpz--debugz-d�
store_truez:Show additional pre-action logging (default: %(default)s).F)r<r��defaultz--forcezDForce running even if no datasource is found (use at your own risk).r)r<r��destr�z--all-stages�
all_stageszsRun cloud-init's stages under a single process using a syncronization protocol. This is not intended for CLI usage.)r�r<r�r�r��Subcommands�
subcommand)�titler�r&z2Initialize cloud-init and perform initial modules.)r��--localz-lz+Start in local mode (default: %(default)s).z--filez-frUrTz(Use additional yaml configuration files.�rb)r<r�r��typerErTz1Activate modules using a given configuration key.z`init`rGrHTr�z--modez-m�storez9Module configuration name to use (default: %(default)s). r�)r&r��final)r<r�r��choices�singlezRun a single module.z--namez-nzModule name to run.)r<r��requiredz--frequencyzModule frequency for this run.)r<r�r�r�z--reportzEnable reporting.rK�*�argumentz0Any additional arguments to pass to this module.)�nargs�metavarr��queryz;Query standardized instance metadata from the command line.rzList defined features.�analyzez-Devel tool: Analyze cloud-init logs and data.�develzRun development tools.zcollect-logsz*Collect and tar all cloud-init debug info.�cleanz3Remove logs and artifacts so cloud-init can re-run.r~z/Report cloud-init status or wait on completion.�schemaz-Validate cloud-config files using jsonschema.c3�DK�|]}|jd�r�|���y�w)�-N)r�)�.0�posargs  r4�	<genexpr>zmain.<locals>.<genexpr>�s����J��6�3D�3D�S�3I�V�J�s� � )�
get_parser)r��handle_collect_logs_args)�parser)r��handle_clean_args)r��handle_args�render)r��handle_schema_args)r��handle_status_argsza subcommand is required�rYr)+r�configure_root_loggerr-�argv�argparse�ArgumentParser�pop�add_argumentrrC�set_defaults�add_subparsers�
add_parser�FileTyper7rr��messagerIr>rMrrrRr�r��cloudinit.analyzer��cloudinit.cmd.devel.parser�cloudinit.cmd.devel.logsr��cloudinit.cmd.cleanr��cloudinit.cmd.queryr��cloudinit.config.schemar��cloudinit.cmd.statusr��error�
parse_args�setattrr��sub_main)�	sysv_argsr��
subparsers�parser_init�
parser_mod�
extra_help�
parser_single�parser_query�parser_features�parser_analyze�parser_devel�parser_collect_logs�parser_clean�
parser_status�
parser_schemar��analyze_parser�devel_parser�logs_parserr��clean_parserr��query_parser�handle_query_args�
schema_parserr��
status_parserr�rYs                             r4�mainr�
s����!�!�#���H�H�	�
�
$�
$�)�-�-��*:�
;�F��������w�5�5�7�8�
6���������
I���������
-����	�����
��
K���	������&��&�&�]��&�N�J��'�'��I�(��K�������
:����������
�
7�
�
�
�t�
$�
�����V�Y�$7��8��&�&��K�'��J��$�$��!�6��	�
�g����������|�
��+��
�������
�
7�
�
�
�t�
$�
�����I�|�#<��=��)�)��-�*��M�������
"���������
-���%�*�*�,�-��������
 ��	��������
?�	��������
�
7�
�
�
�t�
$�
�����x��&=��>��(�(��
J�)��L�
!�+�+��1�,��O�� � ��]�(C� �D��*�*��G�+��N��(�(��.�)��L�%�/�/��I�0����(�(��K�)��L��)�)��H�*��M��)�)��F�*��M���J�)�J��
�
���"�F�
�>�*�
�7�
"�M�
��&�
�>�
)�
�

�2�3��,�,�&�(@�A�
-�
��7�
"�
�

��&��%�%�g�7H�-I�%�J�
�7�
"�
�

��&��%�%�h�8I�-J�%�K�
�8�
#�
�

�-�(��&�&�x�9K�.L�&�M�
�8�
#�
�

�-�(��&�&�x�9K�.L�&�M����/�0����)��,�D��D�"�E�*��?�?���~���f��r5c���tjd�tjdddd�}tjd�|d�5|jddg�	�}d
|_t|�|_ddd�|d�5|jdg�	�}d|_t|�|_ddd�|d�5|jd
dg�	�}d|_t|�|_ddd�|d�5|jd
dg�	�}d|_t|�|_ddd�|jrLd}|jrd|j��}tjd|�d��tjd�ytjd�tjd�y#1swY��@xYw#1swY��xYw#1swY��xYw#1swY��xYw)z>Run all stages in a single process using an ordering protocol.z*Running cloud-init in single process mode.r�r�r�r�zREADY=1r&r�r�FNTrTz
--mode=configz--mode=finalz%a stage of cloud-init exited non-zerozfirst exception received: zSTATUS=Completed with failure, z2. Run 'cloud-init status --long' for more details.z
STOPPING=1r�zSTATUS=Completed)r;r�r�
SocketSync�	sd_notifyr�rr��systemd_exit_code�experienced_any_error�first_exception)r��syncrYr�s    r4r�r��s����H�H�
9�:����W�i��7�C�D����Y��	
�g��0�� � �v�y�&9� �:��#���!)�$����0�
�i��0�� � �v�h� �/��"���!)�$����0�
�h��0�� � �y�/�&B� �C��"���!)�$����0�
�g��0�� � �y�.�&A� �B��"���!)�$����0��!�!�9�����2�4�3G�3G�2H�I�G����-�g�Y�7)�
)�	
�	����&�����+�,�����&�[0�0��0�0��0�0��0�0�s0�,F5�+G�,G�>,G�5F?�G�G�G$c��|j\}}|dvr@tj|jrtj
ntj�n |jrtj�tj�d|k(sd|k(rd|jk7rt}d}d}|dk(r|jrd\}}ncd\}}n]|dk(rd|jzd|jz}}n9|d	k(r+d
|jzd|jz}}|j}n	|}d|z}d
}tj|||��|_|j 5t#j$d|�d��5|||�}ddd�ddd�t'j(�d|k(rd|jk(rt+�}S#1swY�FxYw#1swY�JxYw)N)r&rTr&rTT)r%zsearching for local datasources)zinit-networkz!searching for network datasourcesrUzrunning modules for %sr�z	single/%szrunning single module %szrunning 'cloud-init %s'F)�reporting_enabledzcloud-init stage: 'r_)r<r�setup_basic_loggingrcr�r�r�r	�attach_handlersr�r�r�rX�reportr�ReportEventStackr�r�Timedr�flush_eventsrb)rYrXr|�rname�	report_on�rdesc�retvals       r4r�r�7s����k�k�O�T�7��&�&��#�#�!�Z�Z�G�M�M�W�_�_�	
�
����#�#�%��"�"�$�
��~�)�t�+��$�)�)�0C� ���E��I��v�~��:�:�L�L�E�5��L�E�5�
��	��4�9�9�$�$�t�y�y�0���
��	��$�)�)�#�&����2����K�K�	���)�D�0���	��+�+�
�u�	��D�M�
���)�
�
�
�!4�U�G�1�=�
>�	)��T�4�(�F�	)�)������D��V�t�y�y�0��V����M�	)�	)��)�)�s$�G�(
F7�2G�7G	�<G�G�__main__)r�rS))r�r})TN)Zr�rfrIr-r0r�r��typingrrrr�	cloudinitrrr	r
rrr
rrrrrrrr�
cloudinit.logrr�cloudinit.cmd.develr�cloudinit.configr�cloudinit.config.modulesrr�r�cloudinit.lifecycler�cloudinit.reportingr�cloudinit.settingsrrr r!r��ReasonrAr`rMrcr`�__name__r;r1r=r9�timedrcrQr\rjrorw�intr�r�r��bytes�boolr��
DataSourcer�r7r$rIrRr�rrrr�r�r�r��exitr�r�r5r4�<module>rs����	�
����3�3�'�$���� ��!����#���+�.�,�,�?�;�&���

��(��%��
����� ��$�"�	�
��g����!��
�������?�#�03�	�	�5��#����-�5�$�5�
��W��&=�
K�j�U�3��8�_�j�ZE�<�8M���s�E�z�*�+�8M�
�4��<��8M�v"���+�+�,�"�
�4��<��"�JuC�p/�d>0�BC�LX#�vE�v�{�{�E��.A�o�d8'�vB�J�z���C�H�H�T�#�(�(�^��r5
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!