%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/zoneadm.pyc

�
���^c@@sTdZddlmZmZmZddlZddlZddlZddl	m
Z
eje�Z
dZidd6Zejjjd��Zd	�Zd
�Zeeeed�Zeddd�Zeddd
�Zd�Zeeddd�Zd�Zedd�Zd�Z d�Z!d�Z"d�Z#edd�Z$dd�Z%dS(u
Module for Solaris 10's zoneadm

:maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
:maturity:      new
:platform:      OmniOS,OpenIndiana,SmartOS,OpenSolaris,Solaris 10

.. versionadded:: 2017.7.0

.. warning::
    Oracle Solaris 11's zoneadm is not supported by this module!
i(tabsolute_importtprint_functiontunicode_literalsN(trangeuzoneadmulistu
list_zonescC@sJtddkstStdd�}|dr2tS|ddkrFtStS(u3
    Check if we are running in the globalzone
    ukerneluSunOSucmd.run_alluzonenameuretcodeustdoutuglobal(t
__grains__tFalset__salt__tTrue(tzonename((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pyt_is_globalzone#s
cC@s%t|�dko$|jd�dkS(u*
    Check if zone is actually a UUID
    i$u-i(tlentindex(tzone((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pyt_is_uuid4scC@srt�r_tjjjd�r_tddkr2tStddkr_ttd�d	kr_tSntd
j	t�fS(u�
    We are available if we are have zoneadm and are the global zone on
    Solaris 10, OmniOS, OpenIndiana, OpenSolaris, or Smartos.
    uzoneadmuosuOpenSolarisuSmartOSuOmniOSuOpenIndianauOracle Solarisuosmajorreleasei
u6{0} module can only be loaded in a solaris globalzone.(uOpenSolarisuSmartOSuOmniOSuOpenIndiana(
R	tsalttutilstpathtwhichRt__virtualname__tintRtformat(((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pyt__virtual__;s&c
C@s'i}djd�}tdd�}|ddkr
x�|dj�D]�}|jd�}i}x/tdt|��D]}	||	|||	<qwW|r�|dd	kr�qFn|r�|d
dkr�qFn|r�|d
dkr�qFn|||d<||dd=qFWn|r|St|j��S(
ui
    List all zones

    verbose : boolean
        display additional zone information
    installed : boolean
        include installed zones in output
    configured : boolean
        include configured zones in output
    hide_global : boolean
        do not include global zone

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.list
    u1zoneid:zonename:state:zonepath:uuid:brand:ip-typeu:ucmd.run_alluzoneadm list -p -curetcodeiustdoutuzonenameuglobalustateu	installedu
configured(tsplitRt
splitlinesRR
tsortedtkeys(
tverboset	installedt
configuredthide_globaltzonestheadert	zone_dataRtzone_tti((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pyt
list_zonesMs$cC@s9itd6}d}|r+dj|�}n|rFdj||�}n|radj||�}n|dkr�dj|j��}ntddjd	t|�r�d
j|�ndj|�d|��}|d
dk|d<|dr�|dn|d|d<|djdd�|d<|ddkr5|d=n|S(u�
    Boot (or activate) the specified zone.

    zone : string
        name or uuid of the zone
    single : boolean
        boots only to milestone svc:/milestone/single-user:default.
    altinit : string
        valid path to an alternative executable to be the primordial process.
    smf_options : string
        include two categories of options to control booting behavior of
        the service management facility: recovery options and messages options.

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.boot clementine
        salt '*' zoneadm.boot maeve single=True
        salt '*' zoneadm.boot teddy single=True smf_options=verbose
    ustatusuu-s {0}u
-i {0} {1}u
-m {0} {1}u -- {0}ucmd.run_alluzoneadm {zone} boot{boot_opts}Ru-u {0}u-z {0}t	boot_optsuretcodeiustdoutustderrumessageu	zoneadm: (RRtstripRR
treplace(Rtsingletaltinittsmf_optionstrettboot_optionstres((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytboots&
*"
cC@s9itd6}d}|r+dj|�}n|rFdj||�}n|radj||�}n|dkr�dj|j��}ntddjd	t|�r�d
j|�ndj|�d|��}|d
dk|d<|dr�|dn|d|d<|djdd�|d<|ddkr5|d=n|S(up
    Restart the zone. This is equivalent to a halt boot sequence.

    zone : string
        name or uuid of the zone
    single : boolean
        boots only to milestone svc:/milestone/single-user:default.
    altinit : string
        valid path to an alternative executable to be the primordial process.
    smf_options : string
        include two categories of options to control booting behavior of
        the service management facility: recovery options and messages options.

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.reboot dolores
        salt '*' zoneadm.reboot teddy single=True
    ustatusuu-s {0}u
-i {0} {1}u
-m {0} {1}u -- {0}ucmd.run_allu zoneadm {zone} reboot{boot_opts}Ru-u {0}u-z {0}R$uretcodeiustdoutustderrumessageu	zoneadm: (RRR%RR
R&(RR'R(R)R*R+R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytreboot�s&
*"
cC@s�itd6}tddjdt|�r8dj|�ndj|���}|ddk|d<|dru|d	n|d
|d<|djdd
�|d<|dd
kr�|d=n|S(u�
    Halt the specified zone.

    zone : string
        name or uuid of the zone

    .. note::
        To cleanly shutdown the zone use the shutdown function.

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.halt hector
    ustatusucmd.run_alluzoneadm {zone} haltRu-u {0}u-z {0}uretcodeiustdoutustderrumessageu	zoneadm: u(RRRR
R&(RR*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pythalt�s
0"
cC@sKitd6}d}|r+dj|�}n|rFdj||�}n|radj||�}n|dkr�dj|j��}ntddjd	t|�r�d
j|�ndj|�d|r�d
ndd|��}|ddk|d<|dr|dn|d|d<|djdd�|d<|ddkrG|d=n|S(u�
    Gracefully shutdown the specified zone.

    zone : string
        name or uuid of the zone
    reboot : boolean
        reboot zone after shutdown (equivalent of shutdown -i6 -g0 -y)
    single : boolean
        boots only to milestone svc:/milestone/single-user:default.
    altinit : string
        valid path to an alternative executable to be the primordial process.
    smf_options : string
        include two categories of options to control booting behavior of
        the service management facility: recovery options and messages options.

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.shutdown peter
        salt '*' zoneadm.shutdown armistice reboot=True
    ustatusuu-s {0}u
-i {0} {1}u
-m {0} {1}u -- {0}ucmd.run_allu*zoneadm {zone} shutdown{reboot}{boot_opts}Ru-u {0}u-z {0}R.u -rR$uretcodeiustdoutustderrumessageu	zoneadm: (RRR%RR
R&(RR.R'R(R)R*R+R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytshutdown�s(
*"
cC@s�itd6}tddjdt|�r8dj|�ndj|���}|ddk|d<|dru|d	n|d
|d<|djdd
�|d<|dd
kr�|d=n|S(u�
    Detach the specified zone.

    zone : string
        name or uuid of the zone

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.detach kissy
    ustatusucmd.run_alluzoneadm {zone} detachRu-u {0}u-z {0}uretcodeiustdoutustderrumessageu	zoneadm: u(RRRR
R&(RR*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytdetach2s

0"
c	C@s�itd6}tddjd|d|r/dndd|rJd	j|�nd��}|d
dk|d<|dr~|dn|d
|d<|djdd�|d<|ddkr�|d=n|S(ul
    Attach the specified zone.

    zone : string
        name of the zone
    force : boolean
        force the zone into the "installed" state with no validation
    brand_opts : string
        brand specific options to pass

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.attach lawrence
        salt '*' zoneadm.attach lawrence True
    ustatusucmd.run_allu+zoneadm -z {zone} attach{force}{brand_opts}Rtforceu -Fut
brand_optsu {0}uretcodeiustdoutustderrumessageu	zoneadm: (RRRR&(RR2R3R*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytattachNs
!"
cC@s�itd6}tddjdt|�r8dj|�ndj|���}|ddk|d<|dru|d	n|d
|d<|djdd
�|d<|dd
kr�|d=n|S(u�
    Prepares a zone for running applications.

    zone : string
        name or uuid of the zone

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.ready clementine
    ustatusucmd.run_alluzoneadm {zone} readyRu-u {0}u-z {0}uretcodeiustdoutustderrumessageu	zoneadm: u(RRRR
R&(RR*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytreadyqs

0"
cC@s�itd6}tddjd|��}|ddk|d<|drQ|dn|d|d	<|d	jd
d�|d	<|d	dkr�|d	=n|S(u�
    Check to make sure the configuration of the specified
    zone can safely be installed on the machine.

    zone : string
        name of the zone

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.verify dolores
    ustatusucmd.run_alluzoneadm -z {zone} verifyRuretcodeiustdoutustderrumessageu	zoneadm: u(RRRR&(RR*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytverify�s
"
cC@s�itd6}tddjdt|�r8dj|�ndj|�d|��}|dd	k|d<|dr{|d
n|d|d<|djd
d�|d<|ddkr�|d=n|S(u�
    Move zone to new zonepath.

    zone : string
        name or uuid of the zone
    zonepath : string
        new zonepath

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.move meave /sweetwater/meave
    ustatusucmd.run_alluzoneadm {zone} move {path}Ru-u {0}u-z {0}Ruretcodeiustdoutustderrumessageu	zoneadm: u(RRRR
R&(RtzonepathR*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytmove�s
*"
cC@s�itd6}tddjdt|�r8dj|�ndj|���}|ddk|d<|dru|d	n|d
|d<|djdd
�|d<|dd
kr�|d=n|S(u
    Uninstall the specified zone from the system.

    zone : string
        name or uuid of the zone

    .. warning::
        The -F flag is always used to avoid the prompts when uninstalling.

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.uninstall teddy
    ustatusucmd.run_alluzoneadm {zone} uninstall -FRu-u {0}u-z {0}uretcodeiustdoutustderrumessageu	zoneadm: u(RRRR
R&(RR*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pyt	uninstall�s
0"
c	C@s�itd6}tddjd|d|r/dndd|rJd	j|�nd��}|d
dk|d<|dr~|dn|d
|d<|djdd�|d<|ddkr�|d=n|S(ub
    Install the specified zone from the system.

    zone : string
        name of the zone
    nodataset : boolean
        do not create a ZFS file system
    brand_opts : string
        brand specific options to pass

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.install dolores
        salt '*' zoneadm.install teddy True
    ustatusucmd.run_allu0zoneadm -z {zone} install{nodataset}{brand_opts}Rt	nodatasetu
 -x nodatasetuR3u {0}uretcodeiustdoutustderrumessageu	zoneadm: (RRRR&(RR:R3R*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytinstall�s
!"
c	C@s�itd6}tddjd|d|d|r>dj|�nd��}|d	d
k|d<|drr|dn|d|d
<|d
jdd�|d
<|d
dkr�|d
=n|S(uB
    Install a zone by copying an existing installed zone.

    zone : string
        name of the zone
    source : string
        zone to clone from
    snapshot : string
        optional name of snapshot to use as source

    CLI Example:

    .. code-block:: bash

        salt '*' zoneadm.clone clementine dolores
    ustatusucmd.run_allu*zoneadm -z {zone} clone {snapshot}{source}Rtsourcetsnapshotu-s {0} uuretcodeiustdoutustderrumessageu	zoneadm: (RRRR&(RR<R=R*R,((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pytclones
!"
(&t__doc__t
__future__RRRtloggingtsalt.utils.pathRtsalt.utils.decoratorstsalt.ext.six.movesRt	getLoggert__name__tlogRt__func_alias__Rt
decoratorstmemoizeR	R
RRRR#tNoneR-R.R/R0R1R4R5R6R8R9R;R>(((s8/usr/lib/python2.7/site-packages/salt/modules/zoneadm.pyt<module>
s2
		210	3	#				#

Zerion Mini Shell 1.0