404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.238.184: ~ $
3

\�me�.�@s�ddlZddlZddlmZddlmZddlmZmZm	Z	m
Z
ddlmZm
Z
mZmZddlmZddlmZddlmZdd	lmZdd
lmZeje�ZdZGdd
�d
e	�Zdd�Zdd�Z ee!e"d�dd�Z#Gdd�d�Z$dS)�N)�	signature)�
ModuleType)�Dict�List�
NamedTuple�Optional)�config�importer�
type_utils�util)�ALL_DISTROS)�ConfigMerger)�ReportEventStack)�FREQUENCIES)�InitZcc_c@s"eZdZUeeeee	dS)�
ModuleDetailsN)
�__name__�
__module__�__qualname__r�module�str�name�	frequencyr�run_args�rr�/usr/lib/python3.6/modules.pyrs
rcCsX|jdd�}|j�jd�r.|dt|�d�}|j�}|s>dS|jt�sTdt|f}|S)N�-�_z.pyr�z%s%s)�replace�lower�endswith�len�strip�
startswith�
MOD_PREFIX)rZ
canon_namerrr�form_module_name&s
r&cCs�t|d�s d|jks d|jkr6td|�d|�d���|jdtkrftd|�d|�d|jd�d���t|d	�r�td|�d|�d
���dS)N�metar�distroszModule 'z
' with name 'z4' MUST have a 'meta' attribute of type 'MetaSchema'.z' has an invalid frequency �.ZschemazX' has a JSON 'schema' attribute defined. Please define schema in cloud-init-schema,json.)�hasattrr'�
ValueErrorr)�modrrrr�validate_module2s

 
r-)�module_details�cfg�returncCs2t|jjjdi��}|sdS|j|j��s.dSdS)NZactivate_by_schema_keysTF)�	frozensetrr'�get�intersection�keys)r.r/Zactivate_by_schema_keys_keysrrr�
_is_activeHsr5c@sxeZdZded�dd�Zeejd�dd��Ze	e
d�dd	�Ze	ed�d
d�Z
e	ed�d
d�Zddd�Zdd�ZdS)�ModulesN)�initcCs2||_||_d|_|dkr(tdddd�}||_dS)Nzmodule-reporterzmodule-descF)r�descriptionZreporting_enabled)r7�	cfg_files�_cached_cfgr�reporter)�selfr7r9r;rrr�__init__TszModules.__init__)r0cCs<|jdkr0t|jj|jj|j|jjd�}|j|_tj|j�S)N)�paths�
datasourceZadditional_fnsZbase_cfg)	r:r
r7r>r?r9r/�copy�deepcopy)r<Zmergerrrrr/as
zModules.cfgcCshg}||jkr|S|jj|�}|s&|S�x:|D�]0}|s:q.t|t�rX|jd|j�i�q.t|t�r�i}t|�dkr�|dj�|d<t|�dkr�|dj�|d<t|�dkr�|dd�|d<|r�|j|�q.t|t��rJi}d	}d
|k�r�|d
j�|d<d}d|k�r|dj�|d<d|k�r2|d�p,g|d<|�r`|�r`|j|�q.t	d
|t
j|�f��q.W|S)aURead the modules from the config file given the specified name.

        Returns a list of module definitions. E.g.,
        [
            {
                "mod": "bootcmd",
                "freq": "always",
                "args": "some_arg",
            }
        ]

        Note that in the default case, only "mod" will be set.
        r,�r��freqrN�argsFrTrz3Failed to read '%s' item in config, unknown type %s)r/r2�
isinstancer�appendr#�listr"�dict�	TypeErrorr
�obj_name)r<rZmodule_listZcfg_mods�item�contentsZvalidrrr�
_read_modulesosL





zModules._read_modulescCs�g}x�|D]�}|d}|jd�}|jd�p,g}t|�}|s<q
|rZ|tkrZtjd||�d}tj|dtjt	�gdg�\}}	|s�tjd||	�q
tj
|d	�}
t|
|�|dkr�|
jd
}|j
t|
|||d��q
W|S)z�Convert list of returned from _read_modules() into new format.

        Invalid modules and arguments are ignored.
        Also ensures that the module has the required meta fields.
        r,rDrEz6Config specified module %s has an unknown frequency %sN��handlez,Could not find module named %s (searched %s)rr)rrrr)r2r&r�LOGZwarningr	�find_moduler
rKr�
import_moduler-r'rGr)r<�raw_mods�mostly_modsZraw_modZraw_namerDr�mod_nameZmod_locsZlooked_locsr,rrr�_fixup_modules�sB



zModules._fixup_modules)rUcCsF|jj�}g}g}�x(|D�]\}}}}y�tjd|||�|j|�d|��}	d|	|f}
t|	|
|jd�}||j||d�}|�pt|j	�}
|
j
}t|�dkr�tj
ddd	�|jd
ti�|j|	|j	||d�\}}|r�d|	|_n
d
|	|_WdQRXWqtk
�r8}z$tjtd||�|j||f�WYdd}~XqXqW||fS)Nz(Running module %s (%s) with frequency %szconfig-zrunning %s with frequency %s)rr8�parent)rr/ZcloudrE�z%Config modules with a `log` parameterz23.2)Z
deprecatedZdeprecated_version�log)rDz%s ran successfullyz%s previously ranzRunning module %s (%s) failed)r7ZcloudifyrQ�debugrGrr;r/rrPZ
parametersr"rZ	deprecate�updateZrun�message�	ExceptionZlogexc)r<rUZccZfailuresZ	which_ranr,rrDrEZrun_nameZdescZmyrepZ	func_argsZfunc_signatureZfunc_paramsZranZ_r�errr�_run_modules�sB



$zModules._run_modulescCs&|||d�}|g}|j|�}|j|�S)N)r,rErD)rWr`)r<rVrErDZ	mod_to_berTrUrrr�
run_singles
zModules.run_singlecCs|j|�}|j|�}|jjj}g}g}|jjdg�}g}g}	x�|D]�}
|
\}}}
}|dkr\qB|jd}t|
|j�s~|j	|�qB|r�|t
gkr�||kr�||kr�|j	|�qB|j	|�|	j	|||
|g�qBW|r�tjddj
|��|r�tjddj
|�|�|�rtjddj
|��|j|	�S)	z�Runs all modules in the given section.

        section_name - One of the modules lists as defined in
          /etc/cloud/cloud.cfg. One of:
         - cloud_init_modules
         - cloud_config_modules
         - cloud_final_modules
        Zunverified_modulesNr(z?Skipping modules '%s' because no applicable config is provided.�,zSkipping modules '%s' because they are not verified on distro '%s'.  To run anyway, add them to 'unverified_modules' in config.z running unverified_modules: '%s'z, )rNrWr7Zdistrorr/r2r'r5rGrrQ�info�joinr`)r<Zsection_namerTrUZdistro_nameZskippedZforcedZ
overriddenZinapplicable_modsZactive_modsr.r,rZ_freqZ_argsZworked_distrosrrr�run_sectionsF	







zModules.run_section)NN)NN)rrrrr=�propertyrZConfigr/rrrNrrWr`rarerrrrr6Ss

;02
r6)%r@Zlogging�inspectr�typesrZtypingrrrrZ	cloudinitrr	r
rZcloudinit.distrosrZcloudinit.helpersr
Zcloudinit.reporting.eventsrZcloudinit.settingsrZcloudinit.stagesrZ	getLoggerrrQr%rr&r-rI�boolr5r6rrrr�<module>	s"


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 128 B 0644
__init__.cpython-36.pyc File 128 B 0644
cc_ansible.cpython-36.opt-1.pyc File 8.63 KB 0644
cc_ansible.cpython-36.pyc File 8.63 KB 0644
cc_apk_configure.cpython-36.opt-1.pyc File 4.51 KB 0644
cc_apk_configure.cpython-36.pyc File 4.51 KB 0644
cc_apt_configure.cpython-36.opt-1.pyc File 30.42 KB 0644
cc_apt_configure.cpython-36.pyc File 30.42 KB 0644
cc_apt_pipelining.cpython-36.opt-1.pyc File 2.44 KB 0644
cc_apt_pipelining.cpython-36.pyc File 2.44 KB 0644
cc_bootcmd.cpython-36.opt-1.pyc File 2.51 KB 0644
cc_bootcmd.cpython-36.pyc File 2.51 KB 0644
cc_byobu.cpython-36.opt-1.pyc File 3.04 KB 0644
cc_byobu.cpython-36.pyc File 3.04 KB 0644
cc_ca_certs.cpython-36.opt-1.pyc File 7.05 KB 0644
cc_ca_certs.cpython-36.pyc File 7.05 KB 0644
cc_chef.cpython-36.opt-1.pyc File 9.13 KB 0644
cc_chef.cpython-36.pyc File 9.13 KB 0644
cc_disable_ec2_metadata.cpython-36.opt-1.pyc File 1.72 KB 0644
cc_disable_ec2_metadata.cpython-36.pyc File 1.72 KB 0644
cc_disk_setup.cpython-36.opt-1.pyc File 23.1 KB 0644
cc_disk_setup.cpython-36.pyc File 23.1 KB 0644
cc_fan.cpython-36.opt-1.pyc File 2.74 KB 0644
cc_fan.cpython-36.pyc File 2.74 KB 0644
cc_final_message.cpython-36.opt-1.pyc File 3.07 KB 0644
cc_final_message.cpython-36.pyc File 3.07 KB 0644
cc_growpart.cpython-36.opt-1.pyc File 15.91 KB 0644
cc_growpart.cpython-36.pyc File 15.91 KB 0644
cc_grub_dpkg.cpython-36.opt-1.pyc File 4.92 KB 0644
cc_grub_dpkg.cpython-36.pyc File 4.92 KB 0644
cc_install_hotplug.cpython-36.opt-1.pyc File 3.25 KB 0644
cc_install_hotplug.cpython-36.pyc File 3.25 KB 0644
cc_keyboard.cpython-36.opt-1.pyc File 1.98 KB 0644
cc_keyboard.cpython-36.pyc File 1.98 KB 0644
cc_keys_to_console.cpython-36.opt-1.pyc File 3.11 KB 0644
cc_keys_to_console.cpython-36.pyc File 3.11 KB 0644
cc_landscape.cpython-36.opt-1.pyc File 4.71 KB 0644
cc_landscape.cpython-36.pyc File 4.71 KB 0644
cc_locale.cpython-36.opt-1.pyc File 1.58 KB 0644
cc_locale.cpython-36.pyc File 1.58 KB 0644
cc_lxd.cpython-36.opt-1.pyc File 13.04 KB 0644
cc_lxd.cpython-36.pyc File 13.04 KB 0644
cc_mcollective.cpython-36.opt-1.pyc File 4.24 KB 0644
cc_mcollective.cpython-36.pyc File 4.24 KB 0644
cc_migrator.cpython-36.opt-1.pyc File 2.92 KB 0644
cc_migrator.cpython-36.pyc File 2.92 KB 0644
cc_mounts.cpython-36.opt-1.pyc File 14.08 KB 0644
cc_mounts.cpython-36.pyc File 14.08 KB 0644
cc_ntp.cpython-36.opt-1.pyc File 13.15 KB 0644
cc_ntp.cpython-36.pyc File 13.15 KB 0644
cc_package_update_upgrade_install.cpython-36.opt-1.pyc File 3.78 KB 0644
cc_package_update_upgrade_install.cpython-36.pyc File 3.78 KB 0644
cc_phone_home.cpython-36.opt-1.pyc File 4.1 KB 0644
cc_phone_home.cpython-36.pyc File 4.1 KB 0644
cc_power_state_change.cpython-36.opt-1.pyc File 6.24 KB 0644
cc_power_state_change.cpython-36.pyc File 6.24 KB 0644
cc_puppet.cpython-36.opt-1.pyc File 9.46 KB 0644
cc_puppet.cpython-36.pyc File 9.46 KB 0644
cc_reset_rmc.cpython-36.opt-1.pyc File 3.59 KB 0644
cc_reset_rmc.cpython-36.pyc File 3.59 KB 0644
cc_resizefs.cpython-36.opt-1.pyc File 7.02 KB 0644
cc_resizefs.cpython-36.pyc File 7.02 KB 0644
cc_resolv_conf.cpython-36.opt-1.pyc File 4.27 KB 0644
cc_resolv_conf.cpython-36.pyc File 4.27 KB 0644
cc_rh_subscription.cpython-36.opt-1.pyc File 12.06 KB 0644
cc_rh_subscription.cpython-36.pyc File 12.06 KB 0644
cc_rightscale_userdata.cpython-36.opt-1.pyc File 2.77 KB 0644
cc_rightscale_userdata.cpython-36.pyc File 2.77 KB 0644
cc_rsyslog.cpython-36.opt-1.pyc File 10.34 KB 0644
cc_rsyslog.cpython-36.pyc File 10.34 KB 0644
cc_runcmd.cpython-36.opt-1.pyc File 2.43 KB 0644
cc_runcmd.cpython-36.pyc File 2.43 KB 0644
cc_salt_minion.cpython-36.opt-1.pyc File 4.36 KB 0644
cc_salt_minion.cpython-36.pyc File 4.36 KB 0644
cc_scripts_per_boot.cpython-36.opt-1.pyc File 1.4 KB 0644
cc_scripts_per_boot.cpython-36.pyc File 1.4 KB 0644
cc_scripts_per_instance.cpython-36.opt-1.pyc File 1.57 KB 0644
cc_scripts_per_instance.cpython-36.pyc File 1.57 KB 0644
cc_scripts_per_once.cpython-36.opt-1.pyc File 1.51 KB 0644
cc_scripts_per_once.cpython-36.pyc File 1.51 KB 0644
cc_scripts_user.cpython-36.opt-1.pyc File 1.58 KB 0644
cc_scripts_user.cpython-36.pyc File 1.58 KB 0644
cc_scripts_vendor.cpython-36.opt-1.pyc File 2.04 KB 0644
cc_scripts_vendor.cpython-36.pyc File 2.04 KB 0644
cc_seed_random.cpython-36.opt-1.pyc File 4.07 KB 0644
cc_seed_random.cpython-36.pyc File 4.07 KB 0644
cc_set_hostname.cpython-36.opt-1.pyc File 4 KB 0644
cc_set_hostname.cpython-36.pyc File 4 KB 0644
cc_set_passwords.cpython-36.opt-1.pyc File 8.4 KB 0644
cc_set_passwords.cpython-36.pyc File 8.4 KB 0644
cc_snap.cpython-36.opt-1.pyc File 5.94 KB 0644
cc_snap.cpython-36.pyc File 5.94 KB 0644
cc_spacewalk.cpython-36.opt-1.pyc File 2.87 KB 0644
cc_spacewalk.cpython-36.pyc File 2.87 KB 0644
cc_ssh.cpython-36.opt-1.pyc File 11.02 KB 0644
cc_ssh.cpython-36.pyc File 11.02 KB 0644
cc_ssh_authkey_fingerprints.cpython-36.opt-1.pyc File 3.54 KB 0644
cc_ssh_authkey_fingerprints.cpython-36.pyc File 3.54 KB 0644
cc_ssh_import_id.cpython-36.opt-1.pyc File 3.85 KB 0644
cc_ssh_import_id.cpython-36.pyc File 3.85 KB 0644
cc_timezone.cpython-36.opt-1.pyc File 1.24 KB 0644
cc_timezone.cpython-36.pyc File 1.24 KB 0644
cc_ubuntu_advantage.cpython-36.opt-1.pyc File 12.42 KB 0644
cc_ubuntu_advantage.cpython-36.pyc File 12.42 KB 0644
cc_ubuntu_autoinstall.cpython-36.opt-1.pyc File 3.89 KB 0644
cc_ubuntu_autoinstall.cpython-36.pyc File 3.89 KB 0644
cc_ubuntu_drivers.cpython-36.opt-1.pyc File 3.63 KB 0644
cc_ubuntu_drivers.cpython-36.pyc File 3.63 KB 0644
cc_update_etc_hosts.cpython-36.opt-1.pyc File 4.3 KB 0644
cc_update_etc_hosts.cpython-36.pyc File 4.3 KB 0644
cc_update_hostname.cpython-36.opt-1.pyc File 3.01 KB 0644
cc_update_hostname.cpython-36.pyc File 3.01 KB 0644
cc_users_groups.cpython-36.opt-1.pyc File 7.58 KB 0644
cc_users_groups.cpython-36.pyc File 7.58 KB 0644
cc_wireguard.cpython-36.opt-1.pyc File 8.39 KB 0644
cc_wireguard.cpython-36.pyc File 8.39 KB 0644
cc_write_files.cpython-36.opt-1.pyc File 5.61 KB 0644
cc_write_files.cpython-36.pyc File 5.61 KB 0644
cc_write_files_deferred.cpython-36.opt-1.pyc File 1.73 KB 0644
cc_write_files_deferred.cpython-36.pyc File 1.73 KB 0644
cc_yum_add_repo.cpython-36.opt-1.pyc File 6.03 KB 0644
cc_yum_add_repo.cpython-36.pyc File 6.03 KB 0644
cc_zypper_add_repo.cpython-36.opt-1.pyc File 5.66 KB 0644
cc_zypper_add_repo.cpython-36.pyc File 5.66 KB 0644
modules.cpython-36.opt-1.pyc File 7.31 KB 0644
modules.cpython-36.pyc File 7.31 KB 0644
schema.cpython-36.opt-1.pyc File 39.45 KB 0644
schema.cpython-36.pyc File 39.45 KB 0644