403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_migrator.cpython-36.pyc
3

��bC�@sPdZddlZddlZddlmZmZddlmZeZdd�Z	dd�Z
d	d
�ZdS)a!
Migrator
--------
**Summary:** migrate old versions of cloud-init data to new

This module handles moving old versions of cloud-init data to newer ones.
Currently, it only handles renaming cloud-init's per-frequency semaphore files
to canonicalized name and renaming legacy semaphore names to newer ones. This
module is enabled by default, but can be disabled by specifying ``migrate:
false`` in config.

**Internal name:** ``cc_migrator``

**Module frequency:** always

**Supported distros:** all

**Config keys**::

    migrate: <true/false>
�N)�helpers�util)�
PER_ALWAYSc
Cs�|jjd�|jjd�f}d}x�|D]�}|s"tjj|�r<q"xttj|�D]f}tjj||�}tjj|�rHtjj	|�\}}t
j|�}||krHtjj|||�}	tj
||	�|d7}qHWq"W|S)N�semr�)�paths�	get_ipath�	get_cpath�os�path�exists�listdir�join�isfile�splitextr�canon_sem_name�shutilZmove)
�cloudrZam_adjusted�sem_path�p�	full_path�nameZextZ
canon_name�new_path�r�!/usr/lib/python3.6/cc_migrator.py�_migrate_canon_sems&s

rc
Cs&dddgi}|jjd�|jjd�f}x�|D]�}|s*tjj|�rDq*tj|�}x�|j�D]�\}}|tj	|�g}g}	x@tj
|�D]2}
tjj|
�\}}||kr~tjj|
�r~|	j
|
�q~Wxd|	D]\}
tjtjj||
��tjj|
�\}
}x2|D]*}|jd|
|�|j||��WdQRXq�Wq�WqXWq*WdS)Nzapt-update-upgradez
apt-configurezpackage-update-upgrade-installrz*Migrating %s => %s with the same frequency)rrr	r
rrrZFileSemaphores�itemsrr
rr�appendrZdel_filer�debug�lock)r�logZ
legacy_adjustrrZ
sem_helperZmod_nameZ
migrate_toZ	possiblesZ
old_existsrrZ_ext�_nameZfreq�mrrr�_migrate_legacy_sems8s.




r#cCsJtj|dd�}tj|�s(|jd|�dSt|�}|jd|�t||�dS)NZmigrateTz,Skipping module named %s, migration disabledz8Migrated %s semaphore files to there canonicalized names)rZget_cfg_option_strZtranslate_boolrrr#)rZcfgrr Z_argsZ
do_migrateZ
sems_movedrrr�handleVs
r$)�__doc__r
rZ	cloudinitrrZcloudinit.settingsrZ	frequencyrr#r$rrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit