%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/win_task.pyo

�
���^c@@sJdZddlmZmZmZddlmZddlZddlZddlZ	ddl
Z	y"ddlZddlZ
eZWnek
r�eZnXddlmZeje�ZdZdZdZdZd	ZdZd
ZdZdZd
Z dZ!d
Z"dZ#dZ$dZ%dZ&dZ'd
Z(dZ)dZ*dZ+d
Z,dZ-dZ.d
Z/dZ0dZ1dZ2d
Z3dZ4d
Z5dZ6dZ7d
Z8dZ9d
Z:dZ;dZ<d
Z=dZ>dZ?d	Z@dZAdZBdZCidd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d0gd16d2d3gd46d5d66d7d86d9d:6d;d<6ZDied=6ed>6ed?6ZEie9d@6e:dA6e;dB6e<dC6e=dD6e>dE6e?dF6e@dG6eAdH6eBdI6eCdJ6ZFidKe46dLe56dMe66dNe76dOe86ZGie'dP6e(dQ6e)dR6e*dS6ZHidTd6dUd
6dVd6dWdX6dYdZ6d[d\6d]d^6d_d`6dadb6dcdd6dedf6dgdh6didj6dkdl6dmdn6dodp6ZIdq�ZJdr�ZKds�ZLdt�ZMdu�ZNdv�ZOdwdx�ZPdwdy�ZQdwdz�ZRdwd{�ZSdwd|eTed}�ZUdweTeTd|eTd~�ZVdwd�ZWeTdweTeTeTeTeTeTeTeTeTeTeTeTeTeTeTeTeTeTeTdeTeTeTeTd��ZXdwd��ZYdwd��ZZdwd��Z[dwd��Z\dwd��Z]dwd��Z^dwd��Z_eTdwd=d��Z`dwd��ZaeTdweTeeTeTeTeTeTeTeTeeTeTd��Zbdwd��ZcdS(�u�
Windows Task Scheduler Module
.. versionadded:: 2016.3.0

A module for working with the Windows Task Scheduler.
You can add and edit existing tasks.
You can add and clear triggers and actions.
You can list all tasks, folders, triggers, and actions.
i(tabsolute_importtprint_functiontunicode_literals(tdatetimeN(trangeutaskiiiiiiiiii i	iuPT0MuImmediatelyuIndefinitelyuDo not waituPT15Su
15 secondsuPT30Su
30 secondsuPT1Mu1 minuteuPT5Mu	5 minutesuPT10Mu
10 minutesuPT15Mu
15 minutesuPT30Mu
30 minutesuPT1Hu1 houruPT2Hu2 hoursuPT4Hu4 hoursuPT8Hu8 hoursuPT12Hu12 hoursuP1DuPT24Hu1 dayuP3DuPT72Hu3 daysuP30Du30 daysuP90Du90 daysuP180Du180 daysuP365Du365 daysuExecuteuEmailuMessageuEventuOnceuDailyuWeeklyuMonthlyu
MonthlyDayuOnIdleuOnTaskCreationuOnBootuOnLogonuOnSessionChangeuUnknownuDisableduQueueduReadyuRunninguParalleluQueueuNo New Instanceu
Stop Existingu$The operation completed successfullyu$Incorrect or unknown function calleduFile not founduThe environment is incorrecti
u/Task is ready to run at its next scheduled timeiuTask is currently runningiuTask is disablediuTask has not yet runiu.There are no more runs scheduled for this taskiuTask was terminated by the useriuCredentials became corruptedI�u+An instance of this task is already runningI�u7The service is not available (Run only when logged in?)I��u5The operator or administrator has refused the requestI��u0The application terminated as a result of CTRL+CI:�uUnknown software exceptionI~m�cC@s9tjjj�r/ts+tjdt�ntStdfS(u'
    Only works on Windows systems
    u"Could not load dependencies for %su5Module win_task: module only works on Windows systems(	tsalttutilstplatformt
is_windowstHAS_DEPENDENCIEStlogtwarningt__virtualname__tFalse(((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt__virtual__�s
c
C@shddddddddd	d
g
}x=|D]5}ytj||�|SWq+tk
r_q+q+Xq+WtS(u�
    Copied from win_system.py (_get_date_time_format)

    Function that detects the date/time format for the string passed.

    :param str dt_string:
        A date/time string

    :return: The format of the passed dt_string
    :rtype: str
    u%I:%M:%S %pu%I:%M %pu%H:%M:%Su%H:%Mu%Y-%m-%du%m-%d-%yu%m-%d-%Yu%m/%d/%yu%m/%d/%Yu%Y/%m/%d(Rtstrptimet
ValueErrorR
(t	dt_stringt
valid_formatst	dt_format((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt_get_date_time_format�s"
	

cC@s*ydj|�SWntk
r%dSXdS(u&
    Function for dealing with PyTime values with invalid dates. ie: 12/30/1899
    which is the windows task scheduler value for Never

    :param obj date: A PyTime object

    :return: A string value representing the date or the word "Never" for
    invalid date strings
    :rtype: str
    u{0}uNeverN(tformatR(tdate((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt_get_date_value�s
cC@sxd}xat|j��D]M\}}t|�tkrP||krf|}Pqfq||kr|}PqqWt|�|S(u
    Lookup the key in a dictionary by it's value. Will return the first match.

    :param dict dictionary: The dictionary to search

    :param str value: The value to search for.

    :return: Returns the first key to match the value
    :rtype: str
    i����(t	enumeratetvaluesttypetlist(t
dictionarytvaluetvalue_indextidxt
dict_value((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt_reverse_lookup�scC@s,||}t|�tkr$|dS|SdS(u 
    Lookup the first value given a key. Returns the first value if the key
    refers to a list or the value itself.

    :param dict dictionary: The dictionary to search

    :param str key: The key to get

    :return: Returns the first value available for the key
    :rtype: str
    iN(RR(RtkeyR((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt
_lookup_first�s
c
C@s�y$|j||t|||�tSWn�tjk
r�}|j\}}}	}
idd6dd6dd6dd6d	d
6}y||	d}Wn tk
r�dj|�}nXtj	d
|�dj|�SXdS(u
    Internal function to save the task definition.

    :param str name: The name of the task.

    :param str task_folder: The object representing the folder in which to save
    the task

    :param str task_definition: The object representing the task to be saved

    :param str user_name: The user_account under which to run the task

    :param str password: The password that corresponds to the user account

    :param int logon_type: The logon type for the task.

    :return: True if successful, False if not
    :rtype: bool
    uAThe filename, directory name, or volume label syntax is incorrecti{�u)The system cannot find the file specifiedi�u%Required element or attribute missingi�u+Value incorrectly formatted or out of rangei�u
Access deniedi�iuUnknown Failure: {0}uFailed to modify task: %suFailed to modify task: {0}N(
tRegisterTaskDefinitiontTASK_CREATE_OR_UPDATEtTruet	pythoncomt	com_errortargstKeyErrorRR
tdebug(
tnamettask_folderttask_definitiont	user_nametpasswordt
logon_typeterrorthrtmsgtexctargtfctfailure_code((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt_save_task_definition
s*	


u\cC@s~tjjj��tjjd�}WdQX|j�|j|�}|j	d�}g}x|D]}|j
|j�q`W|S(uv
    List all tasks located in a specific location in the task scheduler.

    Args:

        location (str):
            A string value representing the folder from which you want to list
            tasks. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of tasks

    CLI Example:

    .. code-block:: bash

        # List all tasks in the default location
        salt 'minion-id' task.list_tasks

        # List all tasks in the Microsoft\XblGameSave Directory
        salt 'minion-id' task.list_tasks Microsoft\XblGameSave
    uSchedule.ServiceNi(RRtwinapitComtwin32comtclienttDispatchtConnectt	GetFoldertGetTaskstappendtName(tlocationttask_serviceR-ttaskstretttask((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt
list_tasksBs

cC@s~tjjj��tjjd�}WdQX|j�|j|�}|j	d�}g}x|D]}|j
|j�q`W|S(uk
    List all folders located in a specific location in the task scheduler.

    Args:

        location (str):
            A string value representing the folder from which you want to list
            tasks. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of folders.

    CLI Example:

    .. code-block:: bash

        # List all folders in the default location
        salt 'minion-id' task.list_folders

        # List all folders in the Microsoft directory
        salt 'minion-id' task.list_folders Microsoft
    uSchedule.ServiceNi(RRR:R;R<R=R>R?R@t
GetFoldersRBRC(RDRER-tfoldersRGtfolder((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytlist_foldersjs

cC@s�tjjj��tjjd�}WdQX|j�|j|�}|j	|�j
}|j}g}x|D]}|j|j
�qlW|S(u
    List all triggers that pertain to a task in the specified location.

    Args:

        name (str):
            The name of the task for which list triggers.

        location (str):
            A string value representing the location of the task from which to
            list triggers. Default is ``\`` which is the root for the task
            scheduler (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of triggers.

    CLI Example:

    .. code-block:: bash

        # List all triggers for a task in the default location
        salt 'minion-id' task.list_triggers <task_name>

        # List all triggers for the XblGameSaveTask in the Microsoft\XblGameSave
        # location
        salt '*' task.list_triggers XblGameSaveTask Microsoft\XblGameSave
    uSchedule.ServiceN(RRR:R;R<R=R>R?R@tGetTaskt
DefinitiontTriggersRBtId(R,RDRER-R.ttriggersRGttrigger((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt
list_triggers�s
	
cC@s�tjjj��tjjd�}WdQX|j�|j|�}|j	|�j
}|j}g}x|D]}|j|j
�qlW|S(u
    List all actions that pertain to a task in the specified location.

    Args:

        name (str):
            The name of the task for which list actions.

        location (str):
            A string value representing the location of the task from which to
            list actions. Default is ``\`` which is the root for the task
            scheduler (``C:\Windows\System32\tasks``).

    Returns:
        list: Returns a list of actions.

    CLI Example:

    .. code-block:: bash

        # List all actions for a task in the default location
        salt 'minion-id' task.list_actions <task_name>

        # List all actions for the XblGameSaveTask in the Microsoft\XblGameSave
        # location
        salt 'minion-id' task.list_actions XblGameSaveTask Microsoft\XblGameSave
    uSchedule.ServiceN(RRR:R;R<R=R>R?R@RNROtActionsRBRQ(R,RDRER-R.tactionsRGtaction((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytlist_actions�s
	
uSystemc	K@s
|t|�kr&|r&dj|�Stjjj��tjjd�}WdQX|j	�|j
d�}td|d|d||�td||�t
d||�|j|�}td|d	|d|d|jjd|d
|jj�|t|�krtStSdS(uA
    Create a new task in the designated location. This function has many keyword
    arguments that are not listed here. For additional arguments see:

        - :py:func:`edit_task`
        - :py:func:`add_action`
        - :py:func:`add_trigger`

    Args:

        name (str):
            The name of the task. This will be displayed in the task scheduler.

        location (str):
            A string value representing the location in which to create the
            task. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

        user_name (str):
            The user account under which to run the task. To specify the
            'System' account, use 'System'. The password will be ignored.

        password (str):
            The password to use for authentication. This should set the task to
            run whether the user is logged in or not, but is currently not
            working.

        force (bool):
            If the task exists, overwrite the existing task.

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.create_task <task_name> user_name=System force=True action_type=Execute cmd='del /Q /S C:\\Temp' trigger_type=Once start_date=2016-12-1 start_time=01:00
    u{0} already existsuSchedule.ServiceNiR.R/R0R,R-R1(RIRRRR:R;R<R=R>R?tNewTaskt	edit_taskt
add_actiontadd_triggerR@R9t	PrincipaltUserIDt	LogonTypeR&R
(	R,RDR/R0tforcetkwargsRER.R-((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytcreate_task�s,.


c	C@s�|t|�krdj|�S|r1|r1dStjjj��tjjd�}WdQX|j	�|ru|}n|j
|�}|r�|j�dkr�t}d}d}q�|r�t}q�t}nd}y |j||t|||�Wn�tjk
r|}	|	j\}
}}}
idd6d	d
6dd6}y||d
}Wn tk
rhdj|	�}nXtjd|�nX|t|�kr�tStSdS(u
    Create a task based on XML. Source can be a file or a string of XML.

    Args:

        name (str):
            The name of the task. This will be displayed in the task scheduler.

        location (str):
            A string value representing the location in which to create the
            task. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

        xml_text (str):
            A string of xml representing the task to be created. This will be
            overridden by ``xml_path`` if passed.

        xml_path (str):
            The path to an XML file on the local system containing the xml that
            defines the task. This will override ``xml_text``

        user_name (str):
            The user account under which to run the task. To specify the
            'System' account, use 'System'. The password will be ignored.

        password (str):
            The password to use for authentication. This should set the task to
            run whether the user is logged in or not, but is currently not
            working.

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt '*' task.create_task_from_xml <task_name> xml_path=C:\task.xml
    u{0} already existsu(Must specify either xml_text or xml_pathuSchedule.ServiceNusystemuSYSTEMu%Required element or attribute missingi�u+Value incorrectly formatted or out of rangei�u
Access deniedi�iuUnknown Failure: {0}uFailed to create task: %s(RIRRRR:R;R<R=R>R?R@tlowertTASK_LOGON_SERVICE_ACCOUNTtNonetTASK_LOGON_PASSWORDtTASK_LOGON_INTERACTIVE_TOKENtRegisterTasktTASK_CREATER'R(R)R*R
R+R&R
(R,RDtxml_texttxml_pathR/R0RER-R1R2R3R4R5R6R7R8((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytcreate_task_from_xmlDsN.

					


cC@s�|t|�krdj|�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�|t|�kr�tSt
SdS(u@
    Create a folder in which to create tasks.

    Args:

        name (str):
            The name of the folder. This will be displayed in the task
            scheduler.

        location (str):
            A string value representing the location in which to create the
            folder. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.create_folder <folder_name>
    u{0} already existsuSchedule.ServiceN(RMRRRR:R;R<R=R>R?R@tCreateFolderR&R
(R,RDRER-((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt
create_folder�s


c K@st}|jdt�r*|jd�}n�t}|s:dS|t|�kr�tjjj��tj	j
d�}WdQX|j�|j|�}|j
|�j}n
dj|�S|r�d|j_d|j_n|dk	r�||j_n|ro|j�dkrt}d	}d}n!||j_|r6t}nt}||j_||j_||j_t|j_nd}d}|dk	r�||j _!n|dk	r�||j _"n|dk	r�||j _#n|j j#r�|
dk	r�|
|j j$_%n|dk	r||j j$_&n|dk	rN|t'krGt(t'|�|j j$_)qNd
Sn|	dk	r�|	t'kr�t(t'|	�|j j$_*q�dSq�n|dk	r�||j _+n|
dk	r�|
|j _,n|dk	r�||j _-n|dk	r�||j _.n|j j.r6|r||j j/_n|r6||j j/_0q6n|dk	rQ||j _1n|dk	rl||j _2n|dk	r�|tkr�d|j _3q�|t'kr�t(t'|�|j _3q�d
Sn|j j3r|dk	r|t4dd�kr�||j _5qdSqn|dk	rV|tkr+d|j _6qV|t'krOt(t'|�|j _6qVdSn|dk	rq||j _7n|dk	r�|tkr�d|j _8n|t'kr�t(t'|�|j _8q�dSn|dk	r�t9||j _:n|rt;d|d|d|d|d|d|jj�SdS(u�
    Edit the parameters of a task. Triggers and Actions cannot be edited yet.

    Args:

        name (str):
            The name of the task. This will be displayed in the task scheduler.

        location (str):
            A string value representing the location in which to create the
            task. Default is ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

        user_name (str):
            The user account under which to run the task. To specify the
            'System' account, use 'System'. The password will be ignored.

        password (str):
            The password to use for authentication. This should set the task to
            run whether the user is logged in or not, but is currently not
            working.

            .. note::

                The combination of user_name and password determine how the
                task runs. For example, if a username is passed without at
                password the task will only run when the user is logged in. If a
                password is passed as well the task will run whether the user is
                logged on or not. If you pass 'System' as the username the task
                will run as the system account (the password parameter is
                ignored).

        description (str):
            A string representing the text that will be displayed in the
            description field in the task scheduler.

        enabled (bool):
            A boolean value representing whether or not the task is enabled.

        hidden (bool):
            A boolean value representing whether or not the task is hidden.

        run_if_idle (bool):
            Boolean value that indicates that the Task Scheduler will run the
            task only if the computer is in an idle state.

        idle_duration (str):
            A value that indicates the amount of time that the computer must be
            in an idle state before the task is run. Valid values are:

                - 1 minute
                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour

        idle_wait_timeout (str):
            A value that indicates the amount of time that the Task Scheduler
            will wait for an idle condition to occur. Valid values are:

                - Do not wait
                - 1 minute
                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour
                - 2 hours

        idle_stop_on_end (bool):
            Boolean value that indicates that the Task Scheduler will terminate
            the task if the idle condition ends before the task is completed.

        idle_restart (bool):
            Boolean value that indicates whether the task is restarted when the
            computer cycles into an idle condition more than once.

        ac_only (bool):
            Boolean value that indicates that the Task Scheduler will launch the
            task only while on AC power.

        stop_if_on_batteries (bool):
            Boolean value that indicates that the task will be stopped if the
            computer begins to run on battery power.

        wake_to_run (bool):
            Boolean value that indicates that the Task Scheduler will wake the
            computer when it is time to run the task.

        run_if_network (bool):
            Boolean value that indicates that the Task Scheduler will run the
            task only when a network is available.

        network_id (guid):
            GUID value that identifies a network profile.

        network_name (str):
            Sets the name of a network profile. The name is used for display
            purposes.

        allow_demand_start (bool):
            Boolean value that indicates that the task can be started by using
            either the Run command or the Context menu.

        start_when_available (bool):
            Boolean value that indicates that the Task Scheduler can start the
            task at any time after its scheduled time has passed.

        restart_every (str):
            A value that specifies the interval between task restart attempts.
            Valid values are:

                - False (to disable)
                - 1 minute
                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour
                - 2 hours

        restart_count (int):
            The number of times the Task Scheduler will attempt to restart the
            task. Valid values are integers 1 - 999.

        execution_time_limit (bool, str):
            The amount of time allowed to complete the task. Valid values are:

                - False (to disable)
                - 1 hour
                - 2 hours
                - 4 hours
                - 8 hours
                - 12 hours
                - 1 day
                - 3 days

        force_stop (bool):
            Boolean value that indicates that the task may be terminated by
            using TerminateProcess.

        delete_after (bool, str):
            The amount of time that the Task Scheduler will wait before deleting
            the task after it expires. Requires a trigger with an expiration
            date. Valid values are:

                - False (to disable)
                - Immediately
                - 30 days
                - 90 days
                - 180 days
                - 365 days

        multiple_instances (str):
            Sets the policy that defines how the Task Scheduler deals with
            multiple instances of the task. Valid values are:

                - Parallel
                - Queue
                - No New Instance
                - Stop Existing

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt '*' task.edit_task <task_name> description='This task is awesome'
    utask_definitionu$Required parameter "name" not passeduSchedule.ServiceNu
{0} not founduSalt MinionuSalt Minion DaemonusystemuSYSTEMu!Invalid value for "idle_duration"u%Invalid value for "idle_wait_timeout"uu!Invalid value for "restart_every"ii�u1"restart_count" must be a value between 1 and 999uPT0Su(Invalid value for "execution_time_limit"u Invalid value for "delete_after"R,R-R.R/R0R1(<R
tgetR&RIRRR:R;R<R=R>R?R@RNRORtRegistrationInfotAuthortSourceRetDescriptionRcRdR]RQRfRgR^tDisplayNameR_tTASK_RUNLEVEL_HIGHESTtRunLeveltSettingstEnabledtHiddent
RunOnlyIfIdletIdleSettingst
StopOnIdleEndt
RestartOnIdletdurationR#tIdleDurationtWaitTimeouttDisallowStartIfOnBatteriestStopIfGoingOnBatteriest	WakeToRuntRunOnlyIfNetworkAvailabletNetworkSettingsRCtAllowDemandStarttStartWhenAvailabletRestartIntervalRtRestartCounttExecutionTimeLimittAllowHardTerminatetDeleteExpiredTaskAftert	instancestMultipleInstancesR9( R,RDR/R0tdescriptiontenabledthiddentrun_if_idlet
idle_durationtidle_wait_timeouttidle_stop_on_endtidle_restarttac_onlytstop_if_on_batteriestwake_to_runtrun_if_networkt
network_idtnetwork_nametallow_demand_starttstart_when_availablet
restart_everyt
restart_counttexecution_time_limitt
force_stoptdelete_aftertmultiple_instancesRatsave_definitionR.RER-R1((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyRZ�s��

		

cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|d�|t|�kr�tSt
SdS(u�
    Delete a task from the task scheduler.

    Args:
        name (str):
            The name of the task to delete.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.delete_task <task_name>
    u{0} not found in {1}uSchedule.ServiceNi(RIRRRR:R;R<R=R>R?R@t
DeleteTaskR&R
(R,RDRER-((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytdelete_taskJs
cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|d�|t|�kr�tSt
SdS(u
    Delete a folder from the task scheduler.

    Args:

        name (str):
            The name of the folder to delete.

        location (str):
            A string value representing the location of the folder.  Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.delete_folder <folder_name>
    u{0} not found in {1}uSchedule.ServiceNi(RMRRRR:R;R<R=R>R?R@tDeleteFolderR&R
(R,RDRER-((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt
delete_folderus
cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�}y|jd�t
SWntjk
r�tSXdS(u�
    Run a scheduled task manually.

    Args:

        name (str):
            The name of the task to run.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.list_run <task_name>
    u{0} not found in {1}uSchedule.ServiceNu(RIRRRR:R;R<R=R>R?R@RNtRunR&R'R(R
(R,RDRER-RH((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytrun�s

cC@s@|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�}|jt
kr�dSy$|jd�tjd�t}Wntjk
r�tSXxu|r;t}yH|jd�}|jrx)|D]}|j|kr�t}q�q�WnWq�tjk
r7t}q�Xq�WtS(u
    Run a scheduled task and return when the task finishes

    Args:

        name (str):
            The name of the task to run.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.list_run_wait <task_name>
    u{0} not found in {1}uSchedule.ServiceNuTask already runninguii(RIRRRR:R;R<R=R>R?R@RNtStatetTASK_STATE_RUNNINGR�ttimetsleepR&R'R(R
tGetRunningTaskstCountRC(R,RDRER-RHtrunningt
running_taskstitem((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytrun_wait�s4



		
cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�}y|jd�t
SWntjk
r�tSXdS(u�
    Stop a scheduled task.

    Args:

        name (str):
            The name of the task to stop.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.list_stop <task_name>
    u{0} not found in {1}uSchedule.ServiceNi(RIRRRR:R;R<R=R>R?R@RNtStopR&R'R(R
(R,RDRER-RH((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytstop
s

cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�}t|j
S(u�
    Determine the status of a task. Is it Running, Queued, Ready, etc.

    Args:

        name (str):
            The name of the task for which to return the status

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        str: The current status of the task. Will be one of the following:

            - Unknown
            - Disabled
            - Queued
            - Ready
            - Running

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.list_status <task_name>
    u{0} not found in {1}uSchedule.ServiceN(RIRRRR:R;R<R=R>R?R@RNtstatesR�(R,RDRER-RH((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytstatus5s
cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�}i|jd6t
|j�d6t|jd6|jd6t
|j�d6t|jd	6}|jj}i|jd
6|jd6}|jdkr
t|d
<n2|jdkr)d|d
<ntt|j�|d
<|jdkr[t|d<ntt|j�|d<tt|j�|d<|j dkr�t|d<ntt|j �|d<|dr�|j!|d<n|j"|d<|j#|d<i|j$d6|j%d6|j&d6|j'd6}|dre|j(}	|	j)|d<|	j*|d<|	j+|d<|	j,|d<n|dr�|j-}
|
j.|d<|
j/|d<ng}x�|jj0D]w}itt1|j2�d 6}
|j3r�|j3|
d!<n|j4r�|j4|
d"<n|j5r|j5|
d#<n|j6|
�q�Wg}x[|jj7D]M}itt8|j2�d$6}|jrwtt|j�|d<n|j9r�|j9j:d%d&�\}}||d'<||d(<n|j;r�|j;j:d%d&�\}}||d)<||d*<n|j|d<t<|d+�r8|j=r+tt|j=�|d,<q8t|d,<nt<|d-�rv|j>ritt|j>�|d.<qvt|d.<n|j6|�q6W||d/<||d0<||d1<||d2<|}|S(3u
    Get the details about a task in the task scheduler.

    Args:

        name (str):
            The name of the task for which to return the status

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        dict: A dictionary containing the task configuration

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.info <task_name>
    u{0} not found in {1}uSchedule.ServiceNuenabledulast_runulast_run_resultumissed_runsunext_runustatusuallow_demand_startu
force_stopuudelete_afteruPT0SuImmediatelyuexecution_time_limitumultiple_instancesurestart_intervalu
restart_countustop_if_on_batteriesuwake_to_runuac_onlyurun_if_idleurun_if_networkustart_when_availableu
idle_durationuidle_restartuidle_stop_on_enduidle_wait_timeoutu
network_idunetwork_nameuaction_typeucmdu	argumentsuworking_dirutrigger_typeuTiu
start_dateu
start_timeuend_dateuend_timeuRandomDelayurandom_delayuDelayudelayusettingsu
conditionsuactionsutriggers(?RIRRRR:R;R<R=R>R?R@RNRxRtLastRunTimetresultstLastTaskResulttNumberOfMissedRunstNextRunTimeR�R�RORwR�R�R�R
R!R~R�R�R�R�R�R�R�R�RzR�R�R{RR}R|R�R�RQRCRUtaction_typestTypetPatht	ArgumentstWorkingDirectoryRBRPt
trigger_typest
StartBoundarytsplittEndBoundarythasattrtRandomDelaytDelay(R,RDRER-RHt
propertiestdef_settsettingst
conditionstidle_settnet_setRVt	actionObjRWRRt
triggerObjRSt
start_datet
start_timetend_datetend_timeRG((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytinfobs�
















	



	
					

	


	
	




c	K@s�t}|jdt�r*|jd�}n�t}|s:dS|t|�kr�tjjj��tj	j
d�}WdQX|j�|j|�}|j
|�j}n
dj|�S|jjt|�}t|tkr9d|_|jdt�r|jd�|_ndS|jd	d
�|_|jdd
�|_nt|tkr�d|_|jd
t�ry|jd
�|_ndS|jdt�r�|jd�|_ndS|jdt�s�|jdt�r|jd�r�|jd�|_n|jd�r|jd�|_qndS|jd�r?|jd�|_n|jd�rc|jd�|_n|jd�r�|jd�|_n|jd�r�|jd�|_ n|jd�rD|jd�|_!qDnrt|t"krDd|_|jdt�r|jd�|_#ndS|jdt�r=|jd�|_$qDdSn|r�t%d|d|d |d!|j&j'd"dd#|j&j)�SdS($u�

    Add an action to a task.

    Args:

        name (str):
            The name of the task to which to add the action.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

        action_type (str):
            The type of action to add. There are three action types. Each one
            requires its own set of Keyword Arguments (kwargs). Valid values
            are:

                - Execute
                - Email
                - Message

    Required arguments for each action_type:

    **Execute**

        Execute a command or an executable

            cmd (str):
                (required) The command or executable to run.

            arguments (str):
                (optional) Arguments to be passed to the command or executable.
                To launch a script the first command will need to be the
                interpreter for the script. For example, to run a vbscript you
                would pass ``cscript.exe`` in the ``cmd`` parameter and pass the
                script in the ``arguments`` parameter as follows:

                    - ``cmd='cscript.exe' arguments='c:\scripts\myscript.vbs'``

                Batch files do not need an interpreter and may be passed to the
                cmd parameter directly.

            start_in (str):
                (optional) The current working directory for the command.

    **Email**

        Send and email. Requires ``server``, ``from``, and ``to`` or ``cc``.

            from (str): The sender

            reply_to (str): Who to reply to

            to (str): The recipient

            cc (str): The CC recipient

            bcc (str): The BCC recipient

            subject (str): The subject of the email

            body (str): The Message Body of the email

            server (str): The server used to send the email

            attachments (list):
                A list of attachments. These will be the paths to the files to
                attach. ie: ``attachments="['C:\attachment1.txt',
                'C:\attachment2.txt']"``

    **Message**

        Display a dialog box. The task must be set to "Run only when user is
        logged on" in order for the dialog box to display. Both parameters are
        required.

            title (str):
                The dialog box title.

            message (str):
                The dialog box message body

    Returns:
        dict: A dictionary containing the task configuration

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.add_action <task_name> cmd='del /Q /S C:\\Temp'
    utask_definitionu$Required parameter "name" not passeduSchedule.ServiceNu
{0} not founduExecute_ID1ucmdu"Required parameter "cmd" not foundu	argumentsuustart_inu	Email_ID1userveru%Required parameter "server" not foundufromu#Required parameter "from" not foundutouccu)Required parameter "to" or "cc" not foundureply_toubccusubjectubodyuattachmentsuMessage_ID1utitleu$Required parameter "title" not foundumessageu&Required parameter "message" not foundR,R-R.R/R0R1(*R
RoR&RIRRR:R;R<R=R>R?R@RNRORRUtCreateR�tTASK_ACTION_EXECRQR�R�R�tTASK_ACTION_SEND_EMAILtServertFromtTotCctReplyTotBcctSubjecttBodytAttachmentstTASK_ACTION_SHOW_MESSAGEtTitletMessageBodyR9R]R^ReR_(	R,RDtaction_typeRaR�R.RER-ttask_action((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyR[�sx`

		$	cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�j}|j
}|j�td|d|d|d|jjddd	|jj�S(
us
    Remove all actions from the task.

    :param str name: The name of the task from which to clear all actions.

    :param str location: A string value representing the location of the task.
    Default is ``\`` which is the root for the task scheduler
    (``C:\Windows\System32\tasks``).

    :return: True if successful, False if unsuccessful
    :rtype: bool
    u{0} not found in {1}uSchedule.ServiceNR,R-R.R/R0R1(RIRRRR:R;R<R=R>R?R@RNRORUtClearR9R]R^ReR_(R,RDRER-R.RV((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt_clear_actions�s
	
c&K@s>	|rdSnidd6dd6dd6dd	6d
d6dd
6}i dd6dd6dd6dd6dd6dd6dd
6dd6dd6dd6dd6dd6dd6dd6d d!6d"d6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d06d1d26d3d46d5d66d7d86d9d:6d;d<6d=d>6d?d@6dAdB6}iddC6ddD6ddE6ddF6ddG6ddH6ddI6}iddJ6ddK6ddL6ddM6}iddN6ddO6ddP6ddQ6ddR6ddS6ddT6ddU6ddV6ddW6ddX6ddY6}|rt|�}|rtj||�}ndZSntj�}|rKt|�}|rDtj||�}nd[Sntjd\d]�}d^j|jd_�|jd]��}t}|r�t|�}|r�tj||�}nd`Sn|r�t|�}|r�tj||�}ndaSntjd\d]�}t}|o|r:d^j|jd_�|jd]��}nt}|jdbt�rd|jdb�}n�t	}|rxdcSn|t
|�kr�tjj
j��tjjdd�}WdeQX|j�|j|�}|j|�j}n
dfj|�S|jjt|�}||_|
r*tt|
�|_n|rEtt|�|_n|	r�tt|	�|j_|
r~tt|
�|j_ n||j_!n|r�tt|�|_"n|r�||_#n||_$t|t%kr
|jdgt�rdh|_&|jdg�|_'ndiSn�t|t(kr&dj|_&n�t|t)krWdk|_&|jdld�|_*n�t|t+kr�dm|_&|jdnd�|_,|jdot�r�dp}x%|jdo�D]} ||| O}q�W||_-ndqSn"t|t.kr�dr|_&|jdst�r=dp}!x%|jds�D]}"|!||"O}!qW|!|_/ndtS|jdut�pb|jdvt�r�|jdut�r�dp}x%|jdu�D]}#|||#O}q�W||_0n|jdvt�|_1ndwSn*t|t2krdx|_&|jdst�r5dp}!x%|jds�D]}"|!||"O}!qW|!|_/ndtS|jdyt�pZ|jdzt�r�|jdyt�r�dp}$x%|jdy�D]}%|$||%O}$q�W|$|_3n|jdzt�|_4nd{S|jdot�rdp}x%|jdo�D]} ||| O}q�W||_-ndqSn�t|t5kr4d||_&n�t|t6krPd}|_&n�t|t7krld~|_&n�t|t8kr�d|_&nrt|t9kr�d�|_&|jd�t�r�|jd��|_:n|jd�t�r�||jd��|_;nd�Sn|r:	t<d�|d�|d�|d�|j=j>d�td�|j=j?�SndeS(�u�&
    Add a trigger to a Windows Scheduled task

    .. note::

        Arguments are parsed by the YAML loader and are subject to
        yaml's idiosyncrasies. Therefore, time values in some
        formats (``%H:%M:%S`` and ``%H:%M``) should to be quoted.
        See `YAML IDIOSYNCRASIES`_ for more details.

    .. _`YAML IDIOSYNCRASIES`: https://docs.saltstack.com/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html#time-expressions

    Args:

        name (str):
            The name of the task to which to add the trigger.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

        trigger_type (str):
            The type of trigger to create. This is defined when the trigger is
            created and cannot be changed later. Options are as follows:

                - Event
                - Once
                - Daily
                - Weekly
                - Monthly
                - MonthlyDay
                - OnIdle
                - OnTaskCreation
                - OnBoot
                - OnLogon
                - OnSessionChange

        trigger_enabled (bool):
            Boolean value that indicates whether the trigger is enabled.

        start_date (str):
            The date when the trigger is activated. If no value is passed, the
            current date will be used. Can be one of the following formats:

                - %Y-%m-%d
                - %m-%d-%y
                - %m-%d-%Y
                - %m/%d/%y
                - %m/%d/%Y
                - %Y/%m/%d

        start_time (str):
            The time when the trigger is activated. If no value is passed,
            midnight will be used. Can be one of the following formats:

                - %I:%M:%S %p
                - %I:%M %p
                - %H:%M:%S
                - %H:%M

        end_date (str):
            The date when the trigger is deactivated. The trigger cannot start
            the task after it is deactivated. Can be one of the following
            formats:

                - %Y-%m-%d
                - %m-%d-%y
                - %m-%d-%Y
                - %m/%d/%y
                - %m/%d/%Y
                - %Y/%m/%d

        end_time (str):
            The time when the trigger is deactivated. If this is not passed
            with ``end_date`` it will be set to midnight. Can be one of the
            following formats:

                - %I:%M:%S %p
                - %I:%M %p
                - %H:%M:%S
                - %H:%M

        random_delay (str):
            The delay time that is randomly added to the start time of the
            trigger. Valid values are:

                - 30 seconds
                - 1 minute
                - 30 minutes
                - 1 hour
                - 8 hours
                - 1 day

            .. note::

                This parameter applies to the following trigger types

                    - Once
                    - Daily
                    - Weekly
                    - Monthly
                    - MonthlyDay

        repeat_interval (str):
            The amount of time between each restart of the task. Valid values
            are:

                - 5 minutes
                - 10 minutes
                - 15 minutes
                - 30 minutes
                - 1 hour

        repeat_duration (str):
            How long the pattern is repeated. Valid values are:

                - Indefinitely
                - 15 minutes
                - 30 minutes
                - 1 hour
                - 12 hours
                - 1 day

        repeat_stop_at_duration_end (bool):
            Boolean value that indicates if a running instance of the task is
            stopped at the end of the repetition pattern duration.

        execution_time_limit (str):
            The maximum amount of time that the task launched by the trigger is
            allowed to run. Valid values are:

                - 30 minutes
                - 1 hour
                - 2 hours
                - 4 hours
                - 8 hours
                - 12 hours
                - 1 day
                - 3 days (default)

        delay (str):
            The time the trigger waits after its activation to start the task.
            Valid values are:

                - 15 seconds
                - 30 seconds
                - 1 minute
                - 30 minutes
                - 1 hour
                - 8 hours
                - 1 day

            .. note::

                This parameter applies to the following trigger types:

                    - OnLogon
                    - OnBoot
                    - Event
                    - OnTaskCreation
                    - OnSessionChange

    **kwargs**

    There are optional keyword arguments determined by the type of trigger
    being defined. They are as follows:

    *Event*

        The trigger will be fired by an event.

            subscription (str):
                An event definition in xml format that fires the trigger. The
                easiest way to get this would is to create an event in Windows
                Task Scheduler and then copy the xml text.

    *Once*

        No special parameters required.

    *Daily*

        The task will run daily.

            days_interval (int):
                The interval between days in the schedule. An interval of 1
                produces a daily schedule. An interval of 2 produces an
                every-other day schedule. If no interval is specified, 1 is
                used. Valid entries are 1 - 999.

    *Weekly*

        The task will run weekly.

            weeks_interval (int):
                The interval between weeks in the schedule. An interval of 1
                produces a weekly schedule. An interval of 2 produces an
                every-other week schedule. If no interval is specified, 1 is
                used. Valid entries are 1 - 52.

            days_of_week (list):
                Sets the days of the week on which the task runs. Should be a
                list. ie: ``['Monday','Wednesday','Friday']``. Valid entries are
                the names of the days of the week.

    *Monthly*

        The task will run monthly.

            months_of_year (list):
                Sets the months of the year during which the task runs. Should
                be a list. ie: ``['January','July']``. Valid entries are the
                full names of all the months.

            days_of_month (list):
                Sets the days of the month during which the task runs. Should be
                a list. ie: ``[1, 15, 'Last']``. Options are all days of the
                month 1 - 31 and the word 'Last' to indicate the last day of the
                month.

            last_day_of_month (bool):
                Boolean value that indicates that the task runs on the last day
                of the month regardless of the actual date of that day.

                .. note::

                    You can set the task to run on the last day of the month by
                    either including the word 'Last' in the list of days, or
                    setting the parameter 'last_day_of_month' equal to ``True``.

    *MonthlyDay*

        The task will run monthly an the specified day.

            months_of_year (list):
                Sets the months of the year during which the task runs. Should
                be a list. ie: ``['January','July']``. Valid entries are the
                full names of all the months.

            weeks_of_month (list):
                Sets the weeks of the month during which the task runs. Should
                be a list. ie: ``['First','Third']``. Valid options are:

                    - First
                    - Second
                    - Third
                    - Fourth

            last_week_of_month (bool):
                Boolean value that indicates that the task runs on the last week
                of the month.

            days_of_week (list):
                Sets the days of the week during which the task runs. Should be
                a list. ie: ``['Monday','Wednesday','Friday']``.  Valid entries
                are the names of the days of the week.

    *OnIdle*

        No special parameters required.

    *OnTaskCreation*

        No special parameters required.

    *OnBoot*

        No special parameters required.

    *OnLogon*

        No special parameters required.

    *OnSessionChange*

        The task will be triggered by a session change.

            session_user_name (str):
                Sets the user for the Terminal Server session. When a session
                state change is detected for this user, a task is started. To
                detect session status change for any user, do not pass this
                parameter.

            state_change (str):
                Sets the kind of Terminal Server session change that would
                trigger a task launch. Valid options are:

                    - ConsoleConnect: When you connect to a user session (switch
                      users)
                    - ConsoleDisconnect: When you disconnect a user session
                      (switch users)
                    - RemoteConnect: When a user connects via Remote Desktop
                    - RemoteDisconnect: When a user disconnects via Remote
                      Desktop
                    - SessionLock: When the workstation is locked
                    - SessionUnlock: When the workstation is unlocked

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.add_trigger <task_name> trigger_type=Once trigger_enabled=True start_date=2016/12/1 start_time='"12:01"'
    u/Required parameter "trigger_type" not specifiediuConsoleConnectiuConsoleDisconnectiu
RemoteConnectiuRemoteDisconnectiuSessionLockiu
SessionUnlockiii ii@i�ii	ii
iiiiii
i ii@ii�iiiiiiiiiii ii@ii�iiiiiiiiiiii ii@iI�uLastuSundayuMondayuTuesdayu	WednesdayuThursdayuFridayuSaturdayuFirstuSeconduThirduFourthuJanuaryuFebruaryuMarchuApriluMayuJuneuJulyuAugustu	SeptemberuOctoberuNovemberuDecemberuInvalid start_dateuInvalid start_timeu00:00:00u%H:%M:%Su{0}T{1}u%Y-%m-%duInvalid end_dateuInvalid end_timeutask_definitionu$Required parameter "name" not passeduSchedule.ServiceNu
{0} not foundusubscriptionu	Event_ID1u,Required parameter "subscription" not passeduOnce_ID1u	Daily_ID1u
days_intervalu
Weekly_ID1uweeks_intervaludays_of_weekiu,Required parameter "days_of_week" not passeduMonthly_ID1umonths_of_yearu.Required parameter "months_of_year" not passedu
days_of_monthulast_day_of_monthuJMonthly trigger requires "days_of_month" or "last_day_of_month" parametersuMonthly_DOW_ID1uweeks_of_monthulast_week_of_monthuPMonthly DOW trigger requires "weeks_of_month" or "last_week_of_month" parametersu
OnIdle_ID1uOnTaskCreation_ID1u
OnBoot_ID1uOnLogon_ID1uOnSessionStateChange_ID1usession_user_nameustate_changeu,Required parameter "state_change" not passedR,R-R.R/R0R1(@RRRtnowRtstrftimeReR
RoR&RIRRR:R;R<R=R>R?R@RNRORPR�R�R�R#R~R�R�t
RepetitiontIntervaltDurationtStopAtDurationEndR�R�RxtTASK_TRIGGER_EVENTRQtSubscriptiontTASK_TRIGGER_TIMEtTASK_TRIGGER_DAILYtDaysIntervaltTASK_TRIGGER_WEEKLYt
WeeksIntervalt
DaysOfWeektTASK_TRIGGER_MONTHLYtMonthsOfYeartDaysOfMonthtRunOnLastDayOfMonthtTASK_TRIGGER_MONTHLYDOWtWeeksOfMonthtRunOnLastWeekOfMonthtTASK_TRIGGER_IDLEtTASK_TRIGGER_REGISTRATIONtTASK_TRIGGER_BOOTtTASK_TRIGGER_LOGONt!TASK_TRIGGER_SESSION_STATE_CHANGEtUserIdtStateChangeR9R]R^R_(&R,RDttrigger_typettrigger_enabledR�R�R�R�trandom_delaytrepeat_intervaltrepeat_durationtrepeat_stop_at_duration_endR�tdelayRat
state_changestdaystweekdaystweekstmonthstdate_formattdt_objttime_formatttm_objtstart_boundarytend_boundaryR�R.RER-RSt	bits_daystweekdaytbits_monthstmonthtdayt
bits_weekstweek((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyR\�s��C











									cC@s�|t|�kr"dj||�Stjjj��tjjd�}WdQX|j	�|j
|�}|j|�j}|j
}|j�td|d|d|d|jjddd	|jj�S(
u

    Remove all triggers from the task.

    Args:

        name (str):
            The name of the task from which to clear all triggers.

        location (str):
            A string value representing the location of the task. Default is
            ``\`` which is the root for the task scheduler
            (``C:\Windows\System32\tasks``).

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt 'minion-id' task.clear_trigger <task_name>
    u{0} not found in {1}uSchedule.ServiceNR,R-R.R/R0R1(RIRRRR:R;R<R=R>R?R@RNRORPR�R9R]R^ReR_(R,RDRER-R.RR((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pytclear_triggers?	s
	
(dt__doc__t
__future__RRRRtloggingR�tsalt.utils.platformRtsalt.utils.winapiR'twin32com.clientR<R&R	tImportErrorR
tsalt.ext.six.movesRt	getLoggert__name__R
RR�tTASK_ACTION_COM_HANDLERR�R�tTASK_COMPATIBILITY_ATtTASK_COMPATIBILITY_V1tTASK_COMPATIBILITY_V2tTASK_COMPATIBILITY_V3tTASK_VALIDATE_ONLYRitTASK_UPDATER%tTASK_DISABLEtTASK_DONT_ADD_PRINCIPAL_ACEt!TASK_IGNORE_REGISTRATION_TRIGGERStTASK_INSTANCES_PARALLELtTASK_INSTANCES_QUEUEtTASK_INSTANCES_IGNORE_NEWtTASK_INSTANCES_STOP_EXISTINGtTASK_LOGON_NONERftTASK_LOGON_S4URgtTASK_LOGON_GROUPRdt(TASK_LOGON_INTERACTIVE_TOKEN_OR_PASSWORDtTASK_RUNLEVEL_LUARutTASK_STATE_UNKNOWNtTASK_STATE_DISABLEDtTASK_STATE_QUEUEDtTASK_STATE_READYR�R�R�R�R�R�R�RRRRRR~R�R�R�R�R�RRRR!R#R9RIRMRTRXReRbRlRnRZR�R�R�R�R�R�R�R[R�R\R (((s9/usr/lib/python2.7/site-packages/salt/modules/win_task.pyt<module>s�
















		!				5((-.Ug-�R+-+=+-��,��V

Zerion Mini Shell 1.0