%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyc

�
���^c@@swdZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
eje�ZdZdZdZd�Zd	�Zd
�Zejd��Zd�Zd
�Zd�Zd�Zd�Zd�Zed��Zd�Z d�Z!d�Z"d�Z#ed��Z$d�Z%d�Z&dd�Z(d�Z)dS(u&
VirtualBox Guest Additions installer
i(tabsolute_importtprint_functiontunicode_literalsN(tsixu
vbox_guestuVBoxGuestAdditionsuvboxsfcC@s&tjdd�dkr"tdfStS(u3
    Set the vbox_guest module if the OS Linux
    ukerneluuLinuxuPThe vbox_guest execution module failed to load: only available on Linux systems.(uLinux(t
__grains__tgettFalset__virtualname__(((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt__virtual__s
cC@s?tj�}td|d�}|tkr/|St|��dS(uH
    Mount VirtualBox Guest Additions CD to the temp directory.

    To connect VirtualBox Guest Additions via VirtualBox graphical interface
    press 'Host+D' ('Host' is usually 'Right Ctrl').

    CLI Example:

    .. code-block:: bash

        salt '*' vbox_guest.additions_mount

    :return: True or OSError exception
    umount.mountu
/dev/cdromN(ttempfiletmkdtempt__salt__tTruetOSError(tmount_pointtret((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pytadditions_mount#s
cC@s*td|�}|r&tj|�n|S(u
    Unmount VirtualBox Guest Additions CD from the temp directory.

    CLI Example:

    .. code-block:: bash

        salt '*' vbox_guest.additions_umount

    :param mount_point: directory VirtualBox Guest Additions is mounted to
    :return: True or an string with error
    umount.umount(Rtostrmdir(RR((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pytadditions_umount:s
cc@st�}|Vt|�dS(N(RR(R((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_mountedMs	c@s"tj���fd��}|S(Nc@s5y�||�SWntk
r0}tj|�SXdS(N(R
Rt	text_type(targstkwargste(tf(s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pytwrapperUs(t	functoolstwraps(RR((Rs;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_return_mount_errorTscC@s8tjj|idd6dd6dd6tjdd��S(	NuVBoxLinuxAdditions.runuLinuxuVBoxSolarisAdditions.pkguSolarisuVBoxWindowsAdditions.exeuWindowsukernelu(RtpathtjoinRR(R((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_install_program_path^s
cK@sMtjddtjdd��}dj|�}tddddd|g�S(	Nu^(\d|\.|-)*uu
kernelreleaseukernel-{0}-develu
pkg.installedtpkgsumakeugcc(tretsubRRtformatt
__states__tNone(Rtkernel_typetkernel_devel((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_install_opensusefscK@stddddg�S(Nu
pkg.installedR!udkms(R%R&(R((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_install_ubuntumscK@stdddddg�S(Nu
pkg.installedR!udkmsugcc(R%R&(R((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_install_fedoraqscK@sH|jdt�}|jdt�}|jdt�}|rJtd�ntjdd�}|dkrut|�nB|dkr�t|�n)|d	kr�t|�ntj	d
|�t
|�}td|�}|ddkr|r�td�n|rtd��nt�S|ddkr<dj
tjj|��S|dSdS(Nurebooturestart_x11u
upgrade_osupkg.upgradeuosuuopenSUSEuubuntuufedorau%s is not fully supported yet.ucmd.run_alluretcodeiiu
system.rebootu$Restarting x11 is not supported yet.iu127ui'{0}' not found on CD. Make sure that VirtualBox Guest Additions CD is attached to the CD IDE Controller.ustderr(ii(iu127(tpopRRRRR)R*R+tlogtwarningR tNotImplementedErrortadditions_versionR$RRtbasename(RRtreboottrestart_x11t
upgrade_ostguest_ostinstaller_patht
installer_ret((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_install_linuxus2


cK@sAt��2}tjdd�}|dkr7t||�SWdQXdS(u!
    Install VirtualBox Guest Additions. Uses the CD, connected by VirtualBox.

    To connect VirtualBox Guest Additions via VirtualBox graphical interface
    press 'Host+D' ('Host' is usually 'Right Ctrl').

    See https://www.virtualbox.org/manual/ch04.html#idp52733088 for more details.

    CLI Example:

    .. code-block:: bash

        salt '*' vbox_guest.additions_install
        salt '*' vbox_guest.additions_install reboot=True
        salt '*' vbox_guest.additions_install upgrade_os=True

    :param reboot: reboot computer to complete installation
    :type reboot: bool
    :param upgrade_os: upgrade OS (to ensure the latests version of kernel and developer tools are installed)
    :type upgrade_os: bool
    :return: version of VirtualBox Guest Additions or string with error
    ukerneluuLinuxN(RRRR8(RRtkernel((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pytadditions_install�scC@sFd}tjtjj|t�d�}|r6|dStd��dS(Nu/optu*iu)No VirtualBox Guest Additions dirs found!(tglobRRRt_additions_dir_prefixtEnvironmentError(troottdirs((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_dir�s
"cC@std|�}|ddkS(Nucmd.run_alluretcodei(i(R(tcmdtuninstaller_ret((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_remove_linux_run�scK@s9y ttjjt�d��SWntk
r4tSXdS(Nuuninstall.sh(RCRRRR@R=R(R((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_remove_linux�s

cK@sM|jdt�}d}|r+|d7}ntdjdt|�d|��S(Nuforceuu--forceu{program} uninstall {args}tprogramR(R,RRCR$R (RRtforceR((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_remove_linux_use_cd�s
cK@sAt��2}tjdd�}|dkr7t||�SWdQXdS(uZ
    Remove VirtualBox Guest Additions.

    It uses the CD, connected by VirtualBox.
    ukerneluuLinuxN(RRRRG(RRR9((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt_additions_remove_use_cd�scK@sCtjdd�}|dkr*t�}n|s?t|�}n|S(u
    Remove VirtualBox Guest Additions.

    Firstly it tries to uninstall itself by executing
    '/opt/VBoxGuestAdditions-VERSION/uninstall.run uninstall'.
    It uses the CD, connected by VirtualBox if it failes.

    CLI Example:

    .. code-block:: bash

        salt '*' vbox_guest.additions_remove
        salt '*' vbox_guest.additions_remove force=True

    :param force: force VirtualBox Guest Additions removing
    :type force: bool
    :return: True if VirtualBox Guest Additions were removed successfully else False

    ukerneluuLinux(RRRDRH(RR9R((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pytadditions_remove�scC@soy
t�}Wntk
r!tSX|rkttj|��dkrktjdjt	�dtj
j|��StS(u�
    Check VirtualBox Guest Additions version.

    CLI Example:

    .. code-block:: bash

        salt '*' vbox_guest.additions_version

    :return: version of VirtualBox Guest Additions or False if they are not installed
    iu^{0}-u(R@R=RtlenRtlistdirR"R#R$R<RR1(td((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyR0s

!cC@ss|dkr|g}ntdtdj|��r8|Stdt�sbtsRdSdjt�Sn
djt�SdS(uc
    Grant access to auto-mounted shared folders to the users.

    User is specified by it's name. To grant access for several users use argument `users`.
    Access will be denied to the users not listed in `users` argument.

    See https://www.virtualbox.org/manual/ch04.html#sf_mount_auto for more details.

    CLI Example:

    .. code-block:: bash

        salt '*' vbox_guest.grant_access_to_shared_folders_to fred
        salt '*' vbox_guest.grant_access_to_shared_folders_to users ['fred', 'roman']

    :param name: name of the user to grant access to auto-mounted shared folders to
    :type name: str
    :param users: list of names of users to grant access to auto-mounted shared folders to (if specified, `name` will not be taken into account)
    :type users: list of str
    :return: list of users who have access to auto-mounted shared folders
    u
group.membersu,u
group.infou�VirtualBox Guest Additions are not installed. Ιnstall them firstly. You can do it with the help of command vbox_guest.additions_install.u�VirtualBox Guest Additions seems to be installed, but group '{0}' not found. Check your installation and fix it. You can uninstall VirtualBox Guest Additions with the help of command :py:func:`vbox_guest.additions_remove <salt.modules.vbox_guest.additions_remove> (it has `force` argument to fix complex situations; use it with care) and then install it again. You can do it with the help of :py:func:`vbox_guest.additions_install <salt.modules.vbox_guest.additions_install>`.u*Cannot replace members of the '{0}' group.N(R&Rt_shared_folders_groupRR0R$(tnametusers((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt!grant_access_to_shared_folders_tos	
cC@s/ytdt�dSWntk
r*gSXdS(uG
    List users who have access to auto-mounted shared folders.

    See https://www.virtualbox.org/manual/ch04.html#sf_mount_auto for more details.

    CLI Example:

    .. code-block:: bash

        salt '*' vbox_guest.list_shared_folders_users

    :return: list of users who have access to auto-mounted shared folders
    u
group.infoumembersN(RRMtKeyError(((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pytlist_shared_folders_usersIs
(*t__doc__t
__future__RRRt
contextlibRR;tloggingRR"R	tsalt.extRt	getLoggert__name__R-RR<RMRRRtcontextmanagerRRR R)R*R+R8R:R@RCRDRGRHRIR0R&RPRR(((s;/usr/lib/python2.7/site-packages/salt/modules/vbox_guest.pyt<module>sB					
					&								1

Zerion Mini Shell 1.0