HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_runcmd.cpython-39.pyc
a

��`q�@s�dZddlmZmZddlmZddlmZddlm	Z	ddl
Z
ddlmZegZ
dd	d
ed�e
ed�ged
ddddddid�ddigidddgd�id�	Zee�Zdd�ZdS)zERuncmd: run arbitrary commands at rc.local with output to the console�)�get_schema_doc�validate_cloudconfig_schema)�ALL_DISTROS)�PER_INSTANCE)�utilN)�dedentZ	cc_runcmdZRuncmdzRun arbitrary commandsa�        Run arbitrary commands at a rc.local like level with output to the
        console. Each item can be either a list or a string. If the item is a
        list, it will be properly executed as if passed to ``execve()`` (with
        the first arg as the command). If the item is a string, it will be
        written to a file and interpreted
        using ``sh``.

        .. note::

          all commands must be proper yaml, so you have to quote any characters
          yaml would eat (':' can be problematic)

        .. note::

          when writing files, do not use /tmp dir as it races with
          systemd-tmpfiles-clean LP: #1707222. Use /run/somedir instead.
    a        runcmd:
            - [ ls, -l, / ]
            - [ sh, -xc, "echo $(date) ': hello world!'" ]
            - [ sh, -c, echo "=========hello world'=========" ]
            - ls -l /root
            - [ wget, "http://example.org", -O, /tmp/index.html ]
    �object�runcmd�array�oneOf�type�string)r�itemsF�)rrZadditionalItems�additionalProperties�minItems�required)	�id�name�title�description�distros�examples�	frequencyr�
propertiesc	Cs�d|vr|�d|�dSt|t�tj�|�d�d�}|d}zt�|�}t�	||d�Wn"t
y|t�|d||�Yn0dS)Nr	z:Skipping module named %s, no 'runcmd' key in configuration�scriptsi�z"Failed to shellify %s into file %s)�debugr�schema�os�path�join�	get_ipathr�shellify�
write_file�	Exception�logexc)r�cfg�cloud�log�_args�out_fn�cmd�content�r-�</usr/lib/python3/dist-packages/cloudinit/config/cc_runcmd.py�handleQs�

r/)�__doc__�cloudinit.config.schemarrZcloudinit.distrosr�cloudinit.settingsr�	cloudinitrr�textwraprrrr/r-r-r-r.�<module>	s>	�����1