File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/vboxmanage.cpython-310.pyc
Back
o ;j09 � @ s d Z ddlZddlZddlZddlZddlZddlm Z e� e�Ze� d�d��Ze� d�d��Zdd� Zdd � Zd d� Zdd � Zdd� Zdd� Zdd� Zdd� Zdd� Zd(dd�Zdd� Z d)dd�Z d*d!d"�Z d+d#d$�Zd,d&d'�ZdS )-aY Support for VirtualBox using the VBoxManage command .. versionadded:: 2016.3.0 If the ``vboxdrv`` kernel module is not loaded, this module can automatically load it by configuring ``autoload_vboxdrv`` in ``/etc/salt/minion``: .. code-block:: yaml autoload_vboxdrv: True The default for this setting is ``False``. :depends: virtualbox � N)�CommandExecutionErrorz[^{}]za-zA-Z0-9._-c C s6 t � rt�dd�du rtd d�std d� dS dS )z9 Only load the module if VBoxManage is installed Zautoload_vboxdrvFTzkmod.is_loadedZvboxdrvz kmod.load)FzMThe vboxmanaged execution module failed to load: VBoxManage is not installed.)�vboxcmdZ__opts__�getZ__salt__� r r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/vboxmanage.py�__virtual__$ s r c C s t jj�d�S )z� Return the location of the VBoxManage command CLI Example: .. code-block:: bash salt '*' vboxmanage.vboxcmd Z VBoxManage)�salt�utils�path�whichr r r r r 3 s r c C � t ddd�S )z{ List the available OS Types CLI Example: .. code-block:: bash salt '*' vboxmanage.list_ostypes �ostypesT�ID�� list_itemsr r r r �list_ostypes@ � r c C sV i } t � � d�}tjj�|��� D ]}|�� sq|�� }|d �dd�}d| |<