partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
query
Make a web call to a Parallels provider
salt/cloud/clouds/parallels.py
def query(action=None, command=None, args=None, method='GET', data=None): ''' Make a web call to a Parallels provider ''' path = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) auth_handler = _HTTPBasicAuthHandler() auth_handler.add_pa...
def query(action=None, command=None, args=None, method='GET', data=None): ''' Make a web call to a Parallels provider ''' path = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) auth_handler = _HTTPBasicAuthHandler() auth_handler.add_pa...
[ "Make", "a", "web", "call", "to", "a", "Parallels", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L368-L432
[ "def", "query", "(", "action", "=", "None", ",", "command", "=", "None", ",", "args", "=", "None", ",", "method", "=", "'GET'", ",", "data", "=", "None", ")", ":", "path", "=", "config", ".", "get_cloud_config_value", "(", "'url'", ",", "get_configured...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_image
Show the details from Parallels concerning an image
salt/cloud/clouds/parallels.py
def show_image(kwargs, call=None): ''' Show the details from Parallels concerning an image ''' if call != 'function': raise SaltCloudSystemExit( 'The show_image function must be called with -f or --function.' ) items = query(action='template', command=kwargs['image']) ...
def show_image(kwargs, call=None): ''' Show the details from Parallels concerning an image ''' if call != 'function': raise SaltCloudSystemExit( 'The show_image function must be called with -f or --function.' ) items = query(action='template', command=kwargs['image']) ...
[ "Show", "the", "details", "from", "Parallels", "concerning", "an", "image" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L449-L466
[ "def", "show_image", "(", "kwargs", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_image function must be called with -f or --function.'", ")", "items", "=", "query", "(", "action", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Show the details from Parallels concerning an instance
salt/cloud/clouds/parallels.py
def show_instance(name, call=None): ''' Show the details from Parallels concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) items = query(action='ve', command=name) ret = {} ...
def show_instance(name, call=None): ''' Show the details from Parallels concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) items = query(action='ve', command=name) ret = {} ...
[ "Show", "the", "details", "from", "Parallels", "concerning", "an", "instance" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L469-L494
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "items", "=", "query", "(", "action", "=", "'v...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wait_until
Wait until a specific state has been reached on a node
salt/cloud/clouds/parallels.py
def wait_until(name, state, timeout=300): ''' Wait until a specific state has been reached on a node ''' start_time = time.time() node = show_instance(name, call='action') while True: if node['state'] == state: return True time.sleep(1) if time.time() - start...
def wait_until(name, state, timeout=300): ''' Wait until a specific state has been reached on a node ''' start_time = time.time() node = show_instance(name, call='action') while True: if node['state'] == state: return True time.sleep(1) if time.time() - start...
[ "Wait", "until", "a", "specific", "state", "has", "been", "reached", "on", "a", "node" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L497-L509
[ "def", "wait_until", "(", "name", ",", "state", ",", "timeout", "=", "300", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "node", "=", "show_instance", "(", "name", ",", "call", "=", "'action'", ")", "while", "True", ":", "if", "node", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine
salt/cloud/clouds/parallels.py
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' )...
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' '-a or --action.' )...
[ "Destroy", "a", "node", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L512-L564
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__", "[", "'cloud.fire_event'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine
salt/cloud/clouds/parallels.py
def start(name, call=None): ''' Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) data = query(action='ve',...
def start(name, call=None): ''' Start a node. CLI Example: .. code-block:: bash salt-cloud -a start mymachine ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) data = query(action='ve',...
[ "Start", "a", "node", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/parallels.py#L567-L587
[ "def", "start", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "data", "=", "query", "(", "action", "=", "'ve'", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
returner
Send a Telegram message with the data. :param ret: The data to be sent. :return: Boolean if message was sent successfully.
salt/returners/telegram_return.py
def returner(ret): ''' Send a Telegram message with the data. :param ret: The data to be sent. :return: Boolean if message was sent successfully. ''' _options = _get_options(ret) chat_id = _options.get('chat_id') token = _options.get('token') if not chat_id: log...
def returner(ret): ''' Send a Telegram message with the data. :param ret: The data to be sent. :return: Boolean if message was sent successfully. ''' _options = _get_options(ret) chat_id = _options.get('chat_id') token = _options.get('token') if not chat_id: log...
[ "Send", "a", "Telegram", "message", "with", "the", "data", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/telegram_return.py#L67-L99
[ "def", "returner", "(", "ret", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "chat_id", "=", "_options", ".", "get", "(", "'chat_id'", ")", "token", "=", "_options", ".", "get", "(", "'token'", ")", "if", "not", "chat_id", ":", "log", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_walk_through
Walk though the jid dir and look for jobs
salt/returners/local_cache.py
def _walk_through(job_dir): ''' Walk though the jid dir and look for jobs ''' serial = salt.payload.Serial(__opts__) for top in os.listdir(job_dir): t_path = os.path.join(job_dir, top) if not os.path.exists(t_path): continue for final in os.listdir(t_path): ...
def _walk_through(job_dir): ''' Walk though the jid dir and look for jobs ''' serial = salt.payload.Serial(__opts__) for top in os.listdir(job_dir): t_path = os.path.join(job_dir, top) if not os.path.exists(t_path): continue for final in os.listdir(t_path): ...
[ "Walk", "though", "the", "jid", "dir", "and", "look", "for", "jobs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L56-L84
[ "def", "_walk_through", "(", "job_dir", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", ")", "for", "top", "in", "os", ".", "listdir", "(", "job_dir", ")", ":", "t_path", "=", "os", ".", "path", ".", "join", "(", "j...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
prep_jid
Return a job id and prepare the job id directory. This is the function responsible for making sure jids don't collide (unless it is passed a jid). So do what you have to do to make sure that stays the case
salt/returners/local_cache.py
def prep_jid(nocache=False, passed_jid=None, recurse_count=0): ''' Return a job id and prepare the job id directory. This is the function responsible for making sure jids don't collide (unless it is passed a jid). So do what you have to do to make sure that stays the case ''' if recurse_cou...
def prep_jid(nocache=False, passed_jid=None, recurse_count=0): ''' Return a job id and prepare the job id directory. This is the function responsible for making sure jids don't collide (unless it is passed a jid). So do what you have to do to make sure that stays the case ''' if recurse_cou...
[ "Return", "a", "job", "id", "and", "prepare", "the", "job", "id", "directory", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L88-L130
[ "def", "prep_jid", "(", "nocache", "=", "False", ",", "passed_jid", "=", "None", ",", "recurse_count", "=", "0", ")", ":", "if", "recurse_count", ">=", "5", ":", "err", "=", "'prep_jid could not store a jid after {0} tries.'", ".", "format", "(", "recurse_count"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
returner
Return data to the local job cache
salt/returners/local_cache.py
def returner(load): ''' Return data to the local job cache ''' serial = salt.payload.Serial(__opts__) # if a minion is returning a standalone job, get a jobid if load['jid'] == 'req': load['jid'] = prep_jid(nocache=load.get('nocache', False)) jid_dir = salt.utils.jid.jid_dir(load['...
def returner(load): ''' Return data to the local job cache ''' serial = salt.payload.Serial(__opts__) # if a minion is returning a standalone job, get a jobid if load['jid'] == 'req': load['jid'] = prep_jid(nocache=load.get('nocache', False)) jid_dir = salt.utils.jid.jid_dir(load['...
[ "Return", "data", "to", "the", "local", "job", "cache" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L133-L184
[ "def", "returner", "(", "load", ")", ":", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", ")", "# if a minion is returning a standalone job, get a jobid", "if", "load", "[", "'jid'", "]", "==", "'req'", ":", "load", "[", "'jid'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
save_load
Save the load to the specified jid minions argument is to provide a pre-computed list of matched minions for the job, for cases when this function can't compute that list itself (such as for salt-ssh)
salt/returners/local_cache.py
def save_load(jid, clear_load, minions=None, recurse_count=0): ''' Save the load to the specified jid minions argument is to provide a pre-computed list of matched minions for the job, for cases when this function can't compute that list itself (such as for salt-ssh) ''' if recurse_count >=...
def save_load(jid, clear_load, minions=None, recurse_count=0): ''' Save the load to the specified jid minions argument is to provide a pre-computed list of matched minions for the job, for cases when this function can't compute that list itself (such as for salt-ssh) ''' if recurse_count >=...
[ "Save", "the", "load", "to", "the", "specified", "jid" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L187-L238
[ "def", "save_load", "(", "jid", ",", "clear_load", ",", "minions", "=", "None", ",", "recurse_count", "=", "0", ")", ":", "if", "recurse_count", ">=", "5", ":", "err", "=", "(", "'save_load could not write job cache file after {0} retries.'", ".", "format", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
save_minions
Save/update the serialized list of minions for a given job
salt/returners/local_cache.py
def save_minions(jid, minions, syndic_id=None): ''' Save/update the serialized list of minions for a given job ''' # Ensure we have a list for Python 3 compatability minions = list(minions) log.debug( 'Adding minions for job %s%s: %s', jid, ' from syndic master \'{0}\''....
def save_minions(jid, minions, syndic_id=None): ''' Save/update the serialized list of minions for a given job ''' # Ensure we have a list for Python 3 compatability minions = list(minions) log.debug( 'Adding minions for job %s%s: %s', jid, ' from syndic master \'{0}\''....
[ "Save", "/", "update", "the", "serialized", "list", "of", "minions", "for", "a", "given", "job" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L241-L289
[ "def", "save_minions", "(", "jid", ",", "minions", ",", "syndic_id", "=", "None", ")", ":", "# Ensure we have a list for Python 3 compatability", "minions", "=", "list", "(", "minions", ")", "log", ".", "debug", "(", "'Adding minions for job %s%s: %s'", ",", "jid", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_load
Return the load data that marks a specified jid
salt/returners/local_cache.py
def get_load(jid): ''' Return the load data that marks a specified jid ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) load_fn = os.path.join(jid_dir, LOAD_P) if not os.path.exists(jid_dir) or not os.path.exists(load_fn): return {} serial = salt.payload.S...
def get_load(jid): ''' Return the load data that marks a specified jid ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) load_fn = os.path.join(jid_dir, LOAD_P) if not os.path.exists(jid_dir) or not os.path.exists(load_fn): return {} serial = salt.payload.S...
[ "Return", "the", "load", "data", "that", "marks", "a", "specified", "jid" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L292-L333
[ "def", "get_load", "(", "jid", ")", ":", "jid_dir", "=", "salt", ".", "utils", ".", "jid", ".", "jid_dir", "(", "jid", ",", "_job_dir", "(", ")", ",", "__opts__", "[", "'hash_type'", "]", ")", "load_fn", "=", "os", ".", "path", ".", "join", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_jid
Return the information returned when the specified job id was executed
salt/returners/local_cache.py
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) serial = salt.payload.Serial(__opts__) ret = {} # Check to see if the jid is real, if not return the empty dict if no...
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) serial = salt.payload.Serial(__opts__) ret = {} # Check to see if the jid is real, if not return the empty dict if no...
[ "Return", "the", "information", "returned", "when", "the", "specified", "job", "id", "was", "executed" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L336-L371
[ "def", "get_jid", "(", "jid", ")", ":", "jid_dir", "=", "salt", ".", "utils", ".", "jid", ".", "jid_dir", "(", "jid", ",", "_job_dir", "(", ")", ",", "__opts__", "[", "'hash_type'", "]", ")", "serial", "=", "salt", ".", "payload", ".", "Serial", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_jids
Return a dict mapping all job ids to job information
salt/returners/local_cache.py
def get_jids(): ''' Return a dict mapping all job ids to job information ''' ret = {} for jid, job, _, _ in _walk_through(_job_dir()): ret[jid] = salt.utils.jid.format_jid_instance(jid, job) if __opts__.get('job_cache_store_endtime'): endtime = get_endtime(jid) ...
def get_jids(): ''' Return a dict mapping all job ids to job information ''' ret = {} for jid, job, _, _ in _walk_through(_job_dir()): ret[jid] = salt.utils.jid.format_jid_instance(jid, job) if __opts__.get('job_cache_store_endtime'): endtime = get_endtime(jid) ...
[ "Return", "a", "dict", "mapping", "all", "job", "ids", "to", "job", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L374-L387
[ "def", "get_jids", "(", ")", ":", "ret", "=", "{", "}", "for", "jid", ",", "job", ",", "_", ",", "_", "in", "_walk_through", "(", "_job_dir", "(", ")", ")", ":", "ret", "[", "jid", "]", "=", "salt", ".", "utils", ".", "jid", ".", "format_jid_in...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_jids_filter
Return a list of all jobs information filtered by the given criteria. :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs
salt/returners/local_cache.py
def get_jids_filter(count, filter_find_job=True): ''' Return a list of all jobs information filtered by the given criteria. :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs ''' keys = [] ret = [] for jid,...
def get_jids_filter(count, filter_find_job=True): ''' Return a list of all jobs information filtered by the given criteria. :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs ''' keys = [] ret = [] for jid,...
[ "Return", "a", "list", "of", "all", "jobs", "information", "filtered", "by", "the", "given", "criteria", ".", ":", "param", "int", "count", ":", "show", "not", "more", "than", "the", "count", "of", "most", "recent", "jobs", ":", "param", "bool", "filter_...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L390-L410
[ "def", "get_jids_filter", "(", "count", ",", "filter_find_job", "=", "True", ")", ":", "keys", "=", "[", "]", "ret", "=", "[", "]", "for", "jid", ",", "job", ",", "_", ",", "_", "in", "_walk_through", "(", "_job_dir", "(", ")", ")", ":", "job", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clean_old_jobs
Clean out the old jobs from the job cache
salt/returners/local_cache.py
def clean_old_jobs(): ''' Clean out the old jobs from the job cache ''' if __opts__['keep_jobs'] != 0: jid_root = _job_dir() if not os.path.exists(jid_root): return # Keep track of any empty t_path dirs that need to be removed later dirs_to_remove = set() ...
def clean_old_jobs(): ''' Clean out the old jobs from the job cache ''' if __opts__['keep_jobs'] != 0: jid_root = _job_dir() if not os.path.exists(jid_root): return # Keep track of any empty t_path dirs that need to be removed later dirs_to_remove = set() ...
[ "Clean", "out", "the", "old", "jobs", "from", "the", "job", "cache" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L413-L466
[ "def", "clean_old_jobs", "(", ")", ":", "if", "__opts__", "[", "'keep_jobs'", "]", "!=", "0", ":", "jid_root", "=", "_job_dir", "(", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "jid_root", ")", ":", "return", "# Keep track of any empty t_path ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_endtime
Update (or store) the end time for a given job Endtime is stored as a plain text string
salt/returners/local_cache.py
def update_endtime(jid, time): ''' Update (or store) the end time for a given job Endtime is stored as a plain text string ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) try: if not os.path.exists(jid_dir): os.makedirs(jid_dir) with salt...
def update_endtime(jid, time): ''' Update (or store) the end time for a given job Endtime is stored as a plain text string ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) try: if not os.path.exists(jid_dir): os.makedirs(jid_dir) with salt...
[ "Update", "(", "or", "store", ")", "the", "end", "time", "for", "a", "given", "job" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L469-L482
[ "def", "update_endtime", "(", "jid", ",", "time", ")", ":", "jid_dir", "=", "salt", ".", "utils", ".", "jid", ".", "jid_dir", "(", "jid", ",", "_job_dir", "(", ")", ",", "__opts__", "[", "'hash_type'", "]", ")", "try", ":", "if", "not", "os", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_endtime
Retrieve the stored endtime for a given job Returns False if no endtime is present
salt/returners/local_cache.py
def get_endtime(jid): ''' Retrieve the stored endtime for a given job Returns False if no endtime is present ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) etpath = os.path.join(jid_dir, ENDTIME) if not os.path.exists(etpath): return False with salt...
def get_endtime(jid): ''' Retrieve the stored endtime for a given job Returns False if no endtime is present ''' jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type']) etpath = os.path.join(jid_dir, ENDTIME) if not os.path.exists(etpath): return False with salt...
[ "Retrieve", "the", "stored", "endtime", "for", "a", "given", "job" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L485-L497
[ "def", "get_endtime", "(", "jid", ")", ":", "jid_dir", "=", "salt", ".", "utils", ".", "jid", ".", "jid_dir", "(", "jid", ",", "_job_dir", "(", ")", ",", "__opts__", "[", "'hash_type'", "]", ")", "etpath", "=", "os", ".", "path", ".", "join", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
save_reg
Save the register to msgpack files
salt/returners/local_cache.py
def save_reg(data): ''' Save the register to msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: if not os.path.exists(reg_dir): os.makedirs(reg_dir) except OSError as exc: if exc.errno == errno.EEXIST: pass ...
def save_reg(data): ''' Save the register to msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: if not os.path.exists(reg_dir): os.makedirs(reg_dir) except OSError as exc: if exc.errno == errno.EEXIST: pass ...
[ "Save", "the", "register", "to", "msgpack", "files" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L507-L526
[ "def", "save_reg", "(", "data", ")", ":", "reg_dir", "=", "_reg_dir", "(", ")", "regfile", "=", "os", ".", "path", ".", "join", "(", "reg_dir", ",", "'register'", ")", "try", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "reg_dir", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
load_reg
Load the register from msgpack files
salt/returners/local_cache.py
def load_reg(): ''' Load the register from msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: with salt.utils.files.fopen(regfile, 'r') as fh_: return salt.utils.msgpack.load(fh_) except Exception: log.error('Could not write to...
def load_reg(): ''' Load the register from msgpack files ''' reg_dir = _reg_dir() regfile = os.path.join(reg_dir, 'register') try: with salt.utils.files.fopen(regfile, 'r') as fh_: return salt.utils.msgpack.load(fh_) except Exception: log.error('Could not write to...
[ "Load", "the", "register", "from", "msgpack", "files" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/local_cache.py#L529-L540
[ "def", "load_reg", "(", ")", ":", "reg_dir", "=", "_reg_dir", "(", ")", "regfile", "=", "os", ".", "path", ".", "join", "(", "reg_dir", ",", "'register'", ")", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "regfile", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
merge_recursive
Merge obj_b into obj_a.
salt/serializers/yamlex.py
def merge_recursive(obj_a, obj_b, level=False): ''' Merge obj_b into obj_a. ''' return aggregate(obj_a, obj_b, level, map_class=AggregatedMap, sequence_class=AggregatedSequence)
def merge_recursive(obj_a, obj_b, level=False): ''' Merge obj_b into obj_a. ''' return aggregate(obj_a, obj_b, level, map_class=AggregatedMap, sequence_class=AggregatedSequence)
[ "Merge", "obj_b", "into", "obj_a", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L427-L433
[ "def", "merge_recursive", "(", "obj_a", ",", "obj_b", ",", "level", "=", "False", ")", ":", "return", "aggregate", "(", "obj_a", ",", "obj_b", ",", "level", ",", "map_class", "=", "AggregatedMap", ",", "sequence_class", "=", "AggregatedSequence", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Loader.construct_yaml_omap
Build the SLSMap
salt/serializers/yamlex.py
def construct_yaml_omap(self, node): ''' Build the SLSMap ''' sls_map = SLSMap() if not isinstance(node, MappingNode): raise ConstructorError( None, None, 'expected a mapping node, but found {0}'.format(node.id), ...
def construct_yaml_omap(self, node): ''' Build the SLSMap ''' sls_map = SLSMap() if not isinstance(node, MappingNode): raise ConstructorError( None, None, 'expected a mapping node, but found {0}'.format(node.id), ...
[ "Build", "the", "SLSMap" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L214-L252
[ "def", "construct_yaml_omap", "(", "self", ",", "node", ")", ":", "sls_map", "=", "SLSMap", "(", ")", "if", "not", "isinstance", "(", "node", ",", "MappingNode", ")", ":", "raise", "ConstructorError", "(", "None", ",", "None", ",", "'expected a mapping node,...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Loader.construct_sls_str
Build the SLSString.
salt/serializers/yamlex.py
def construct_sls_str(self, node): ''' Build the SLSString. ''' # Ensure obj is str, not py2 unicode or py3 bytes obj = self.construct_scalar(node) if six.PY2: obj = obj.encode('utf-8') return SLSString(obj)
def construct_sls_str(self, node): ''' Build the SLSString. ''' # Ensure obj is str, not py2 unicode or py3 bytes obj = self.construct_scalar(node) if six.PY2: obj = obj.encode('utf-8') return SLSString(obj)
[ "Build", "the", "SLSString", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L254-L263
[ "def", "construct_sls_str", "(", "self", ",", "node", ")", ":", "# Ensure obj is str, not py2 unicode or py3 bytes", "obj", "=", "self", ".", "construct_scalar", "(", "node", ")", "if", "six", ".", "PY2", ":", "obj", "=", "obj", ".", "encode", "(", "'utf-8'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Loader.construct_sls_int
Verify integers and pass them in correctly is they are declared as octal
salt/serializers/yamlex.py
def construct_sls_int(self, node): ''' Verify integers and pass them in correctly is they are declared as octal ''' if node.value == '0': pass elif node.value.startswith('0') \ and not node.value.startswith(('0b', '0x')): node.value...
def construct_sls_int(self, node): ''' Verify integers and pass them in correctly is they are declared as octal ''' if node.value == '0': pass elif node.value.startswith('0') \ and not node.value.startswith(('0b', '0x')): node.value...
[ "Verify", "integers", "and", "pass", "them", "in", "correctly", "is", "they", "are", "declared", "as", "octal" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/yamlex.py#L265-L279
[ "def", "construct_sls_int", "(", "self", ",", "node", ")", ":", "if", "node", ".", "value", "==", "'0'", ":", "pass", "elif", "node", ".", "value", ".", "startswith", "(", "'0'", ")", "and", "not", "node", ".", "value", ".", "startswith", "(", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure the DynamoDB table exists. Table throughput can be updated after table creation. Global secondary indexes (GSIs) are managed with some exceptions: - If a GSI deletion is detected, a failure will occur (deletes should be done manually in the AWS console). - If multiple GSIs are added in a...
salt/states/boto_dynamodb.py
def present(name=None, table_name=None, region=None, key=None, keyid=None, profile=None, read_capacity_units=None, write_capacity_units=None, alarms=None, alarms_from_pillar="boto_dynamodb_alarms", ha...
def present(name=None, table_name=None, region=None, key=None, keyid=None, profile=None, read_capacity_units=None, write_capacity_units=None, alarms=None, alarms_from_pillar="boto_dynamodb_alarms", ha...
[ "Ensure", "the", "DynamoDB", "table", "exists", ".", "Table", "throughput", "can", "be", "updated", "after", "table", "creation", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L190-L425
[ "def", "present", "(", "name", "=", "None", ",", "table_name", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "read_capacity_units", "=", "None", ",", "write_capacity_units",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_global_indexes_present
Handles global secondary index for the table present state.
salt/states/boto_dynamodb.py
def _global_indexes_present(provisioned_indexes, global_indexes, changes_old, changes_new, comments, name, region, key, keyid, profile): '''Handles global secondary index for the table present state.''' ret = {'result': True} if provisioned_indexes: ...
def _global_indexes_present(provisioned_indexes, global_indexes, changes_old, changes_new, comments, name, region, key, keyid, profile): '''Handles global secondary index for the table present state.''' ret = {'result': True} if provisioned_indexes: ...
[ "Handles", "global", "secondary", "index", "for", "the", "table", "present", "state", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L435-L495
[ "def", "_global_indexes_present", "(", "provisioned_indexes", ",", "global_indexes", ",", "changes_old", ",", "changes_new", ",", "comments", ",", "name", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")", ":", "ret", "=", "{", "'result'", ":", "T...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_partition_index_names
Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted.
salt/states/boto_dynamodb.py
def _partition_index_names(provisioned_index_names, index_names): '''Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted.''' existing_index_names = set() new_index_names = set() for name in index_names: if name in provisioned_index_names: existing_index_nam...
def _partition_index_names(provisioned_index_names, index_names): '''Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted.''' existing_index_names = set() new_index_names = set() for name in index_names: if name in provisioned_index_names: existing_index_nam...
[ "Returns", "3", "disjoint", "sets", "of", "indexes", ":", "existing", "to", "be", "created", "and", "to", "be", "deleted", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L498-L508
[ "def", "_partition_index_names", "(", "provisioned_index_names", ",", "index_names", ")", ":", "existing_index_names", "=", "set", "(", ")", "new_index_names", "=", "set", "(", ")", "for", "name", "in", "index_names", ":", "if", "name", "in", "provisioned_index_na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_add_global_secondary_index
Updates ret iff there was a failure or in test mode.
salt/states/boto_dynamodb.py
def _add_global_secondary_index(ret, name, index_name, changes_old, changes_new, comments, gsi_config, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' if __opts__['test']: ret['result'] = None ret['comment'] = 'Dynamo table...
def _add_global_secondary_index(ret, name, index_name, changes_old, changes_new, comments, gsi_config, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' if __opts__['test']: ret['result'] = None ret['comment'] = 'Dynamo table...
[ "Updates", "ret", "iff", "there", "was", "a", "failure", "or", "in", "test", "mode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L511-L535
[ "def", "_add_global_secondary_index", "(", "ret", ",", "name", ",", "index_name", ",", "changes_old", ",", "changes_new", ",", "comments", ",", "gsi_config", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")", ":", "if", "__opts__", "[", "'test'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_update_global_secondary_indexes
Updates ret iff there was a failure or in test mode.
salt/states/boto_dynamodb.py
def _update_global_secondary_indexes(ret, changes_old, changes_new, comments, existing_index_names, provisioned_gsi_config, gsi_config, name, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' try: ...
def _update_global_secondary_indexes(ret, changes_old, changes_new, comments, existing_index_names, provisioned_gsi_config, gsi_config, name, region, key, keyid, profile): '''Updates ret iff there was a failure or in test mode.''' try: ...
[ "Updates", "ret", "iff", "there", "was", "a", "failure", "or", "in", "test", "mode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L538-L575
[ "def", "_update_global_secondary_indexes", "(", "ret", ",", "changes_old", ",", "changes_new", ",", "comments", ",", "existing_index_names", ",", "provisioned_gsi_config", ",", "gsi_config", ",", "name", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_alarms_present
helper method for present. ensure that cloudwatch_alarms are set
salt/states/boto_dynamodb.py
def _alarms_present(name, alarms, alarms_from_pillar, write_capacity_units, read_capacity_units, region, key, keyid, profile): '''helper method for present. ensure that cloudwatch_alarms are set''' # load data from alarms_from_pillar tmp = copy.deepcopy( __sa...
def _alarms_present(name, alarms, alarms_from_pillar, write_capacity_units, read_capacity_units, region, key, keyid, profile): '''helper method for present. ensure that cloudwatch_alarms are set''' # load data from alarms_from_pillar tmp = copy.deepcopy( __sa...
[ "helper", "method", "for", "present", ".", "ensure", "that", "cloudwatch_alarms", "are", "set" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L617-L668
[ "def", "_alarms_present", "(", "name", ",", "alarms", ",", "alarms_from_pillar", ",", "write_capacity_units", ",", "read_capacity_units", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")", ":", "# load data from alarms_from_pillar", "tmp", "=", "copy", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_next_datetime_with_utc_hour
Datapipeline API is throttling us, as all the pipelines are started at the same time. We would like to uniformly distribute the startTime over a 60 minute window. Return the next future utc datetime where hour == utc_hour minute = A value between 0-59 (depending on table name) second = ...
salt/states/boto_dynamodb.py
def _next_datetime_with_utc_hour(table_name, utc_hour): ''' Datapipeline API is throttling us, as all the pipelines are started at the same time. We would like to uniformly distribute the startTime over a 60 minute window. Return the next future utc datetime where hour == utc_hour minut...
def _next_datetime_with_utc_hour(table_name, utc_hour): ''' Datapipeline API is throttling us, as all the pipelines are started at the same time. We would like to uniformly distribute the startTime over a 60 minute window. Return the next future utc datetime where hour == utc_hour minut...
[ "Datapipeline", "API", "is", "throttling", "us", "as", "all", "the", "pipelines", "are", "started", "at", "the", "same", "time", ".", "We", "would", "like", "to", "uniformly", "distribute", "the", "startTime", "over", "a", "60", "minute", "window", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_dynamodb.py#L701-L728
[ "def", "_next_datetime_with_utc_hour", "(", "table_name", ",", "utc_hour", ")", ":", "today", "=", "datetime", ".", "date", ".", "today", "(", ")", "# The minute and second values generated are deterministic, as we do not want", "# pipeline definition to change for every run.", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
genrepo
Generate winrepo_cachefile based on sls files in the winrepo_dir opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. fire_event : True Fire an event on failure. Only supported on the master. CLI Example: .. code-b...
salt/runners/winrepo.py
def genrepo(opts=None, fire_event=True): ''' Generate winrepo_cachefile based on sls files in the winrepo_dir opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. fire_event : True Fire an event on failure. Only supp...
def genrepo(opts=None, fire_event=True): ''' Generate winrepo_cachefile based on sls files in the winrepo_dir opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. fire_event : True Fire an event on failure. Only supp...
[ "Generate", "winrepo_cachefile", "based", "on", "sls", "files", "in", "the", "winrepo_dir" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/winrepo.py#L40-L125
[ "def", "genrepo", "(", "opts", "=", "None", ",", "fire_event", "=", "True", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "__opts__", "winrepo_dir", "=", "opts", "[", "'winrepo_dir'", "]", "winrepo_cachefile", "=", "opts", "[", "'winrepo_cachefil...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_git_repos
Checkout git repos containing Windows Software Package Definitions opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. clean : False Clean repo cachedirs which are not configured under :conf_master:`winrepo_remotes`...
salt/runners/winrepo.py
def update_git_repos(opts=None, clean=False, masterless=False): ''' Checkout git repos containing Windows Software Package Definitions opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. clean : False Clean repo cac...
def update_git_repos(opts=None, clean=False, masterless=False): ''' Checkout git repos containing Windows Software Package Definitions opts Specify an alternate opts dict. Should not be used unless this function is imported into an execution module. clean : False Clean repo cac...
[ "Checkout", "git", "repos", "containing", "Windows", "Software", "Package", "Definitions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/winrepo.py#L128-L233
[ "def", "update_git_repos", "(", "opts", "=", "None", ",", "clean", "=", "False", ",", "masterless", "=", "False", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "__opts__", "winrepo_dir", "=", "opts", "[", "'winrepo_dir'", "]", "winrepo_remotes", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sync
Sync custom modules into the extension_modules directory
salt/utils/extmods.py
def sync(opts, form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' Sync custom modules into the extension_modules directory ''' if saltenv is None: saltenv = ['base'] if extmod_whitelist is None: extmod_whitelist = opts['extmod_...
def sync(opts, form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None): ''' Sync custom modules into the extension_modules directory ''' if saltenv is None: saltenv = ['base'] if extmod_whitelist is None: extmod_whitelist = opts['extmod_...
[ "Sync", "custom", "modules", "into", "the", "extension_modules", "directory" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/extmods.py#L43-L159
[ "def", "sync", "(", "opts", ",", "form", ",", "saltenv", "=", "None", ",", "extmod_whitelist", "=", "None", ",", "extmod_blacklist", "=", "None", ")", ":", "if", "saltenv", "is", "None", ":", "saltenv", "=", "[", "'base'", "]", "if", "extmod_whitelist", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parallel_map
Applies a function to each element of a list, returning the resulting list. A separate thread is created for each element in the input list and the passed function is called for each of the elements. When all threads have finished execution a list with the results corresponding to the inputs is returne...
salt/states/saltmod.py
def _parallel_map(func, inputs): ''' Applies a function to each element of a list, returning the resulting list. A separate thread is created for each element in the input list and the passed function is called for each of the elements. When all threads have finished execution a list with the resul...
def _parallel_map(func, inputs): ''' Applies a function to each element of a list, returning the resulting list. A separate thread is created for each element in the input list and the passed function is called for each of the elements. When all threads have finished execution a list with the resul...
[ "Applies", "a", "function", "to", "each", "element", "of", "a", "list", "returning", "the", "resulting", "list", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L66-L105
[ "def", "_parallel_map", "(", "func", ",", "inputs", ")", ":", "outputs", "=", "len", "(", "inputs", ")", "*", "[", "None", "]", "errors", "=", "len", "(", "inputs", ")", "*", "[", "None", "]", "def", "create_thread", "(", "index", ")", ":", "def", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
state
Invoke a state run on a given target name An arbitrary name used to track the state execution tgt The target specification for the state run. .. versionadded: 2016.11.0 Masterless support: When running on a masterless minion, the ``tgt`` is ignored and will always be ...
salt/states/saltmod.py
def state(name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, highstate=None, sls=None, top=None, saltenv=None, test=None, pillar=None, pillarenv=None, expect_minions=True, ...
def state(name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, highstate=None, sls=None, top=None, saltenv=None, test=None, pillar=None, pillarenv=None, expect_minions=True, ...
[ "Invoke", "a", "state", "run", "on", "a", "given", "target" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L108-L452
[ "def", "state", "(", "name", ",", "tgt", ",", "ssh", "=", "False", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "ret_config", "=", "None", ",", "ret_kwargs", "=", "None", ",", "highstate", "=", "None", ",", "sls", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
function
Execute a single module function on a remote minion via salt or salt-ssh name The name of the function to run, aka cmd.run or pkg.install tgt The target specification, aka '*' for all minions tgt_type The target type, defaults to ``glob`` arg The list of arguments to ...
salt/states/saltmod.py
def function( name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, expect_minions=False, fail_minions=None, fail_function=None, arg=None, kwarg=None, timeout=None, batch=None, ...
def function( name, tgt, ssh=False, tgt_type='glob', ret='', ret_config=None, ret_kwargs=None, expect_minions=False, fail_minions=None, fail_function=None, arg=None, kwarg=None, timeout=None, batch=None, ...
[ "Execute", "a", "single", "module", "function", "on", "a", "remote", "minion", "via", "salt", "or", "salt", "-", "ssh" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L455-L633
[ "def", "function", "(", "name", ",", "tgt", ",", "ssh", "=", "False", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "ret_config", "=", "None", ",", "ret_kwargs", "=", "None", ",", "expect_minions", "=", "False", ",", "fail_minions", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wait_for_event
Watch Salt's event bus and block until a condition is met .. versionadded:: 2014.7.0 name An event tag to watch for; supports Reactor-style globbing. id_list A list of event identifiers to watch for -- usually the minion ID. Each time an event tag is matched the event data is inspe...
salt/states/saltmod.py
def wait_for_event( name, id_list, event_id='id', timeout=300, node='master'): ''' Watch Salt's event bus and block until a condition is met .. versionadded:: 2014.7.0 name An event tag to watch for; supports Reactor-style globbing. id_list A...
def wait_for_event( name, id_list, event_id='id', timeout=300, node='master'): ''' Watch Salt's event bus and block until a condition is met .. versionadded:: 2014.7.0 name An event tag to watch for; supports Reactor-style globbing. id_list A...
[ "Watch", "Salt", "s", "event", "bus", "and", "block", "until", "a", "condition", "is", "met" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L636-L748
[ "def", "wait_for_event", "(", "name", ",", "id_list", ",", "event_id", "=", "'id'", ",", "timeout", "=", "300", ",", "node", "=", "'master'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
runner
Execute a runner module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the runner function asynchronous Run the salt command but don't wait for a reply. .. versionadded:: neon .. code-block:...
salt/states/saltmod.py
def runner(name, **kwargs): ''' Execute a runner module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the runner function asynchronous Run the salt command but don't wait for a reply. .. ...
def runner(name, **kwargs): ''' Execute a runner module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the runner function asynchronous Run the salt command but don't wait for a reply. .. ...
[ "Execute", "a", "runner", "module", "on", "the", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L751-L819
[ "def", "runner", "(", "name", ",", "*", "*", "kwargs", ")", ":", "try", ":", "jid", "=", "__orchestration_jid__", "except", "NameError", ":", "log", ".", "debug", "(", "'Unable to fire args event due to missing __orchestration_jid__'", ")", "jid", "=", "None", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
parallel_runners
Executes multiple runner modules on the master in parallel. .. versionadded:: 2017.x.0 (Nitrogen) A separate thread is spawned for each runner. This state is intended to be used with the orchestrate runner in place of the ``saltmod.runner`` state when different tasks should be run in parallel. In gene...
salt/states/saltmod.py
def parallel_runners(name, runners, **kwargs): # pylint: disable=unused-argument ''' Executes multiple runner modules on the master in parallel. .. versionadded:: 2017.x.0 (Nitrogen) A separate thread is spawned for each runner. This state is intended to be used with the orchestrate runner in pla...
def parallel_runners(name, runners, **kwargs): # pylint: disable=unused-argument ''' Executes multiple runner modules on the master in parallel. .. versionadded:: 2017.x.0 (Nitrogen) A separate thread is spawned for each runner. This state is intended to be used with the orchestrate runner in pla...
[ "Executes", "multiple", "runner", "modules", "on", "the", "master", "in", "parallel", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L822-L1003
[ "def", "parallel_runners", "(", "name", ",", "runners", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "# For the sake of consistency, we treat a single string in the same way as", "# a key without a value. This allows something like", "# salt.parallel_runn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wheel
Execute a wheel module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the wheel function asynchronous Run the salt command but don't wait for a reply. .. versionadded:: neon .. code-block:: ...
salt/states/saltmod.py
def wheel(name, **kwargs): ''' Execute a wheel module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the wheel function asynchronous Run the salt command but don't wait for a reply. .. ver...
def wheel(name, **kwargs): ''' Execute a wheel module on the master .. versionadded:: 2014.7.0 name The name of the function to run kwargs Any keyword arguments to pass to the wheel function asynchronous Run the salt command but don't wait for a reply. .. ver...
[ "Execute", "a", "wheel", "module", "on", "the", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/saltmod.py#L1006-L1079
[ "def", "wheel", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", "}", "try", ":", "jid", "=", "__orchestration_jid__...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_rooms
List all Slack rooms. :param api_key: The Slack admin api key. :return: The room list. CLI Example: .. code-block:: bash salt '*' slack.list_rooms salt '*' slack.list_rooms api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15
salt/modules/slack_notify.py
def list_rooms(api_key=None): ''' List all Slack rooms. :param api_key: The Slack admin api key. :return: The room list. CLI Example: .. code-block:: bash salt '*' slack.list_rooms salt '*' slack.list_rooms api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 ''' if not api_key:...
def list_rooms(api_key=None): ''' List all Slack rooms. :param api_key: The Slack admin api key. :return: The room list. CLI Example: .. code-block:: bash salt '*' slack.list_rooms salt '*' slack.list_rooms api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 ''' if not api_key:...
[ "List", "all", "Slack", "rooms", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L69-L88
[ "def", "list_rooms", "(", "api_key", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "return", "salt", ".", "utils", ".", "slack", ".", "query", "(", "function", "=", "'rooms'", ",", "api_key", "=", "api_ke...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
find_room
Find a room by name and return it. :param name: The room name. :param api_key: The Slack admin api key. :return: The room object. CLI Example: .. code-block:: bash salt '*' slack.find_room name="random" salt '*' slack.find_room name="random" api_key=peWcBiMOS9HrZG15peW...
salt/modules/slack_notify.py
def find_room(name, api_key=None): ''' Find a room by name and return it. :param name: The room name. :param api_key: The Slack admin api key. :return: The room object. CLI Example: .. code-block:: bash salt '*' slack.find_room name="random" salt '*' slack.find...
def find_room(name, api_key=None): ''' Find a room by name and return it. :param name: The room name. :param api_key: The Slack admin api key. :return: The room object. CLI Example: .. code-block:: bash salt '*' slack.find_room name="random" salt '*' slack.find...
[ "Find", "a", "room", "by", "name", "and", "return", "it", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L113-L144
[ "def", "find_room", "(", "name", ",", "api_key", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "# search results don't include the name of the", "# channel with a hash, if the passed channel name", "# has a hash we remove it."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
find_user
Find a user by name and return it. :param name: The user name. :param api_key: The Slack admin api key. :return: The user object. CLI Example: .. code-block:: bash salt '*' slack.find_user name="ThomasHatch" salt '*' slack.find_user name="ThomasHatch" api_k...
salt/modules/slack_notify.py
def find_user(name, api_key=None): ''' Find a user by name and return it. :param name: The user name. :param api_key: The Slack admin api key. :return: The user object. CLI Example: .. code-block:: bash salt '*' slack.find_user name="ThomasHatch" sa...
def find_user(name, api_key=None): ''' Find a user by name and return it. :param name: The user name. :param api_key: The Slack admin api key. :return: The user object. CLI Example: .. code-block:: bash salt '*' slack.find_user name="ThomasHatch" sa...
[ "Find", "a", "user", "by", "name", "and", "return", "it", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L147-L173
[ "def", "find_user", "(", "name", ",", "api_key", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "ret", "=", "list_users", "(", "api_key", ")", "if", "ret", "[", "'res'", "]", ":", "users", "=", "ret", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
post_message
Send a message to a Slack channel. :param channel: The channel name, either will work. :param message: The message to send to the Slack channel. :param from_name: Specify who the message is from. :param api_key: The Slack api key, if not specified in the configuration. :param icon: ...
salt/modules/slack_notify.py
def post_message(channel, message, from_name, api_key=None, icon=None): ''' Send a message to a Slack channel. :param channel: The channel name, either will work. :param message: The message to send to the Slack channel. :p...
def post_message(channel, message, from_name, api_key=None, icon=None): ''' Send a message to a Slack channel. :param channel: The channel name, either will work. :param message: The message to send to the Slack channel. :p...
[ "Send", "a", "message", "to", "a", "Slack", "channel", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L176-L241
[ "def", "post_message", "(", "channel", ",", "message", ",", "from_name", ",", "api_key", "=", "None", ",", "icon", "=", "None", ")", ":", "if", "not", "api_key", ":", "api_key", "=", "_get_api_key", "(", ")", "if", "not", "channel", ":", "log", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call_hook
Send message to Slack incoming webhook. :param message: The topic of message. :param attachment: The message to send to the Slacke WebHook. :param color: The color of border of left side :param short: An optional flag indicating whether the value is short enough...
salt/modules/slack_notify.py
def call_hook(message, attachment=None, color='good', short=False, identifier=None, channel=None, username=None, icon_emoji=None): ''' Send message to Slack incoming webhook. :param message: The topic of m...
def call_hook(message, attachment=None, color='good', short=False, identifier=None, channel=None, username=None, icon_emoji=None): ''' Send message to Slack incoming webhook. :param message: The topic of m...
[ "Send", "message", "to", "Slack", "incoming", "webhook", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/slack_notify.py#L244-L325
[ "def", "call_hook", "(", "message", ",", "attachment", "=", "None", ",", "color", "=", "'good'", ",", "short", "=", "False", ",", "identifier", "=", "None", ",", "channel", "=", "None", ",", "username", "=", "None", ",", "icon_emoji", "=", "None", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add
Add the specified group name Name of the new group gid Use GID for the new group system Create a system account root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.add foo 3456
salt/modules/groupadd.py
def add(name, gid=None, system=False, root=None): ''' Add the specified group name Name of the new group gid Use GID for the new group system Create a system account root Directory to chroot into CLI Example: .. code-block:: bash salt '*' gr...
def add(name, gid=None, system=False, root=None): ''' Add the specified group name Name of the new group gid Use GID for the new group system Create a system account root Directory to chroot into CLI Example: .. code-block:: bash salt '*' gr...
[ "Add", "the", "specified", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L43-L78
[ "def", "add", "(", "name", ",", "gid", "=", "None", ",", "system", "=", "False", ",", "root", "=", "None", ")", ":", "cmd", "=", "[", "'groupadd'", "]", "if", "gid", ":", "cmd", ".", "append", "(", "'-g {0}'", ".", "format", "(", "gid", ")", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Remove the named group name Name group to delete root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.delete foo
salt/modules/groupadd.py
def delete(name, root=None): ''' Remove the named group name Name group to delete root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.delete foo ''' cmd = ['groupdel'] if root is not None: cmd.extend(('-R', root)) ...
def delete(name, root=None): ''' Remove the named group name Name group to delete root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.delete foo ''' cmd = ['groupdel'] if root is not None: cmd.extend(('-R', root)) ...
[ "Remove", "the", "named", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L81-L106
[ "def", "delete", "(", "name", ",", "root", "=", "None", ")", ":", "cmd", "=", "[", "'groupdel'", "]", "if", "root", "is", "not", "None", ":", "cmd", ".", "extend", "(", "(", "'-R'", ",", "root", ")", ")", "cmd", ".", "append", "(", "name", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
info
Return information about a group name Name of the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.info foo
salt/modules/groupadd.py
def info(name, root=None): ''' Return information about a group name Name of the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.info foo ''' if root is not None: getgrnam = functools.partial(_getgrnam, root=root) ...
def info(name, root=None): ''' Return information about a group name Name of the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.info foo ''' if root is not None: getgrnam = functools.partial(_getgrnam, root=root) ...
[ "Return", "information", "about", "a", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L109-L135
[ "def", "info", "(", "name", ",", "root", "=", "None", ")", ":", "if", "root", "is", "not", "None", ":", "getgrnam", "=", "functools", ".", "partial", "(", "_getgrnam", ",", "root", "=", "root", ")", "else", ":", "getgrnam", "=", "functools", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
getent
Return info on all groups refresh Force a refresh of group information root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.getent
salt/modules/groupadd.py
def getent(refresh=False, root=None): ''' Return info on all groups refresh Force a refresh of group information root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.getent ''' if 'group.getent' in __context__ and not refresh: ...
def getent(refresh=False, root=None): ''' Return info on all groups refresh Force a refresh of group information root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.getent ''' if 'group.getent' in __context__ and not refresh: ...
[ "Return", "info", "on", "all", "groups" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L148-L176
[ "def", "getent", "(", "refresh", "=", "False", ",", "root", "=", "None", ")", ":", "if", "'group.getent'", "in", "__context__", "and", "not", "refresh", ":", "return", "__context__", "[", "'group.getent'", "]", "ret", "=", "[", "]", "if", "root", "is", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_chattrib
Change an attribute for a named user
salt/modules/groupadd.py
def _chattrib(name, key, value, param, root=None): ''' Change an attribute for a named user ''' pre_info = info(name, root=root) if not pre_info: return False if value == pre_info[key]: return True cmd = ['groupmod'] if root is not None: cmd.extend(('-R', root)...
def _chattrib(name, key, value, param, root=None): ''' Change an attribute for a named user ''' pre_info = info(name, root=root) if not pre_info: return False if value == pre_info[key]: return True cmd = ['groupmod'] if root is not None: cmd.extend(('-R', root)...
[ "Change", "an", "attribute", "for", "a", "named", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L179-L198
[ "def", "_chattrib", "(", "name", ",", "key", ",", "value", ",", "param", ",", "root", "=", "None", ")", ":", "pre_info", "=", "info", "(", "name", ",", "root", "=", "root", ")", "if", "not", "pre_info", ":", "return", "False", "if", "value", "==", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
adduser
Add a user in the group. name Name of the group to modify username Username to add to the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a valid username 'bar' as a member of an existing gro...
salt/modules/groupadd.py
def adduser(name, username, root=None): ''' Add a user in the group. name Name of the group to modify username Username to add to the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a...
def adduser(name, username, root=None): ''' Add a user in the group. name Name of the group to modify username Username to add to the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.adduser foo bar Verifies if a...
[ "Add", "a", "user", "in", "the", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L223-L264
[ "def", "adduser", "(", "name", ",", "username", ",", "root", "=", "None", ")", ":", "on_redhat_5", "=", "__grains__", ".", "get", "(", "'os_family'", ")", "==", "'RedHat'", "and", "__grains__", ".", "get", "(", "'osmajorrelease'", ")", "==", "'5'", "on_s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deluser
Remove a user from the group. name Name of the group to modify username Username to delete from the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If grou...
salt/modules/groupadd.py
def deluser(name, username, root=None): ''' Remove a user from the group. name Name of the group to modify username Username to delete from the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Rem...
def deluser(name, username, root=None): ''' Remove a user from the group. name Name of the group to modify username Username to delete from the group root Directory to chroot into CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Rem...
[ "Remove", "a", "user", "from", "the", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L267-L319
[ "def", "deluser", "(", "name", ",", "username", ",", "root", "=", "None", ")", ":", "on_redhat_5", "=", "__grains__", ".", "get", "(", "'os_family'", ")", "==", "'RedHat'", "and", "__grains__", ".", "get", "(", "'osmajorrelease'", ")", "==", "'5'", "on_s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
members
Replaces members of the group with a provided list. name Name of the group to modify members_list Username list to set into the group root Directory to chroot into CLI Example: salt '*' group.members foo 'user1,user2,user3,...' Replaces a membership list for a l...
salt/modules/groupadd.py
def members(name, members_list, root=None): ''' Replaces members of the group with a provided list. name Name of the group to modify members_list Username list to set into the group root Directory to chroot into CLI Example: salt '*' group.members foo 'user1,...
def members(name, members_list, root=None): ''' Replaces members of the group with a provided list. name Name of the group to modify members_list Username list to set into the group root Directory to chroot into CLI Example: salt '*' group.members foo 'user1,...
[ "Replaces", "members", "of", "the", "group", "with", "a", "provided", "list", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L322-L379
[ "def", "members", "(", "name", ",", "members_list", ",", "root", "=", "None", ")", ":", "on_redhat_5", "=", "__grains__", ".", "get", "(", "'os_family'", ")", "==", "'RedHat'", "and", "__grains__", ".", "get", "(", "'osmajorrelease'", ")", "==", "'5'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_getgrnam
Alternative implementation for getgrnam, that use only /etc/group
salt/modules/groupadd.py
def _getgrnam(name, root=None): ''' Alternative implementation for getgrnam, that use only /etc/group ''' root = root or '/' passwd = os.path.join(root, 'etc/group') with salt.utils.files.fopen(passwd) as fp_: for line in fp_: line = salt.utils.stringutils.to_unicode(line) ...
def _getgrnam(name, root=None): ''' Alternative implementation for getgrnam, that use only /etc/group ''' root = root or '/' passwd = os.path.join(root, 'etc/group') with salt.utils.files.fopen(passwd) as fp_: for line in fp_: line = salt.utils.stringutils.to_unicode(line) ...
[ "Alternative", "implementation", "for", "getgrnam", "that", "use", "only", "/", "etc", "/", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/groupadd.py#L382-L400
[ "def", "_getgrnam", "(", "name", ",", "root", "=", "None", ")", ":", "root", "=", "root", "or", "'/'", "passwd", "=", "os", ".", "path", ".", "join", "(", "root", ",", "'etc/group'", ")", "with", "salt", ".", "utils", ".", "files", ".", "fopen", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_execute_cmd
Execute nagios plugin if it's in the directory with salt command specified in run_type
salt/modules/nagios.py
def _execute_cmd(plugin, args='', run_type='cmd.retcode'): ''' Execute nagios plugin if it's in the directory with salt command specified in run_type ''' data = {} all_plugins = list_plugins() if plugin in all_plugins: data = __salt__[run_type]( '{0}{1} {2}'.format(PLUGI...
def _execute_cmd(plugin, args='', run_type='cmd.retcode'): ''' Execute nagios plugin if it's in the directory with salt command specified in run_type ''' data = {} all_plugins = list_plugins() if plugin in all_plugins: data = __salt__[run_type]( '{0}{1} {2}'.format(PLUGI...
[ "Execute", "nagios", "plugin", "if", "it", "s", "in", "the", "directory", "with", "salt", "command", "specified", "in", "run_type" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L29-L41
[ "def", "_execute_cmd", "(", "plugin", ",", "args", "=", "''", ",", "run_type", "=", "'cmd.retcode'", ")", ":", "data", "=", "{", "}", "all_plugins", "=", "list_plugins", "(", ")", "if", "plugin", "in", "all_plugins", ":", "data", "=", "__salt__", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_execute_pillar
Run one or more nagios plugins from pillar data and get the result of run_type The pillar have to be in this format: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: - check_load: -w 0.8 -c 1 APT: - ch...
salt/modules/nagios.py
def _execute_pillar(pillar_name, run_type): ''' Run one or more nagios plugins from pillar data and get the result of run_type The pillar have to be in this format: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: ...
def _execute_pillar(pillar_name, run_type): ''' Run one or more nagios plugins from pillar data and get the result of run_type The pillar have to be in this format: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: ...
[ "Run", "one", "or", "more", "nagios", "plugins", "from", "pillar", "data", "and", "get", "the", "result", "of", "run_type", "The", "pillar", "have", "to", "be", "in", "this", "format", ":", "------", "webserver", ":", "Ping_google", ":", "-", "check_icmp",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L44-L76
[ "def", "_execute_pillar", "(", "pillar_name", ",", "run_type", ")", ":", "groups", "=", "__salt__", "[", "'pillar.get'", "]", "(", "pillar_name", ")", "data", "=", "{", "}", "for", "group", "in", "groups", ":", "data", "[", "group", "]", "=", "{", "}",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
retcode
Run one nagios plugin and return retcode of the execution
salt/modules/nagios.py
def retcode(plugin, args='', key_name=None): ''' Run one nagios plugin and return retcode of the execution ''' data = {} # Remove all the spaces, the key must not have any space if key_name is None: key_name = _format_dict_key(args, plugin) data[key_name] = {} status = _execut...
def retcode(plugin, args='', key_name=None): ''' Run one nagios plugin and return retcode of the execution ''' data = {} # Remove all the spaces, the key must not have any space if key_name is None: key_name = _format_dict_key(args, plugin) data[key_name] = {} status = _execut...
[ "Run", "one", "nagios", "plugin", "and", "return", "retcode", "of", "the", "execution" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L105-L120
[ "def", "retcode", "(", "plugin", ",", "args", "=", "''", ",", "key_name", "=", "None", ")", ":", "data", "=", "{", "}", "# Remove all the spaces, the key must not have any space", "if", "key_name", "is", "None", ":", "key_name", "=", "_format_dict_key", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
retcode_pillar
Run one or more nagios plugins from pillar data and get the result of cmd.retcode The pillar have to be in this format:: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com Load: - check_load: -w 0.8 -...
salt/modules/nagios.py
def retcode_pillar(pillar_name): ''' Run one or more nagios plugins from pillar data and get the result of cmd.retcode The pillar have to be in this format:: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com ...
def retcode_pillar(pillar_name): ''' Run one or more nagios plugins from pillar data and get the result of cmd.retcode The pillar have to be in this format:: ------ webserver: Ping_google: - check_icmp: 8.8.8.8 - check_icmp: google.com ...
[ "Run", "one", "or", "more", "nagios", "plugins", "from", "pillar", "data", "and", "get", "the", "result", "of", "cmd", ".", "retcode", "The", "pillar", "have", "to", "be", "in", "this", "format", "::" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L131-L189
[ "def", "retcode_pillar", "(", "pillar_name", ")", ":", "groups", "=", "__salt__", "[", "'pillar.get'", "]", "(", "pillar_name", ")", "check", "=", "{", "}", "data", "=", "{", "}", "for", "group", "in", "groups", ":", "commands", "=", "groups", "[", "gr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_plugins
List all the nagios plugins CLI Example: .. code-block:: bash salt '*' nagios.list_plugins
salt/modules/nagios.py
def list_plugins(): ''' List all the nagios plugins CLI Example: .. code-block:: bash salt '*' nagios.list_plugins ''' plugin_list = os.listdir(PLUGINDIR) ret = [] for plugin in plugin_list: # Check if execute bit stat_f = os.path.join(PLUGINDIR, plugin) ...
def list_plugins(): ''' List all the nagios plugins CLI Example: .. code-block:: bash salt '*' nagios.list_plugins ''' plugin_list = os.listdir(PLUGINDIR) ret = [] for plugin in plugin_list: # Check if execute bit stat_f = os.path.join(PLUGINDIR, plugin) ...
[ "List", "all", "the", "nagios", "plugins" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nagios.py#L255-L273
[ "def", "list_plugins", "(", ")", ":", "plugin_list", "=", "os", ".", "listdir", "(", "PLUGINDIR", ")", "ret", "=", "[", "]", "for", "plugin", "in", "plugin_list", ":", "# Check if execute bit", "stat_f", "=", "os", ".", "path", ".", "join", "(", "PLUGIND...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
installed
Make sure that a package is installed. name The name of the package to install cyg_arch : x86_64 The cygwin architecture to install the package into. Current options are x86 and x86_64 mirrors : None List of mirrors to check. None will use a default mirror (kernel....
salt/states/cyg.py
def installed(name, cyg_arch='x86_64', mirrors=None): ''' Make sure that a package is installed. name The name of the package to install cyg_arch : x86_64 The cygwin architecture to install the package into. Current options are x86 and x86_64 mi...
def installed(name, cyg_arch='x86_64', mirrors=None): ''' Make sure that a package is installed. name The name of the package to install cyg_arch : x86_64 The cygwin architecture to install the package into. Current options are x86 and x86_64 mi...
[ "Make", "sure", "that", "a", "package", "is", "installed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cyg.py#L26-L91
[ "def", "installed", "(", "name", ",", "cyg_arch", "=", "'x86_64'", ",", "mirrors", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
removed
Make sure that a package is not installed. name The name of the package to uninstall cyg_arch : x86_64 The cygwin architecture to remove the package from. Current options are x86 and x86_64 mirrors : None List of mirrors to check. None will use a default mirror (ke...
salt/states/cyg.py
def removed(name, cyg_arch='x86_64', mirrors=None): ''' Make sure that a package is not installed. name The name of the package to uninstall cyg_arch : x86_64 The cygwin architecture to remove the package from. Current options are x86 and x86_64 mirrors : None List...
def removed(name, cyg_arch='x86_64', mirrors=None): ''' Make sure that a package is not installed. name The name of the package to uninstall cyg_arch : x86_64 The cygwin architecture to remove the package from. Current options are x86 and x86_64 mirrors : None List...
[ "Make", "sure", "that", "a", "package", "is", "not", "installed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cyg.py#L94-L149
[ "def", "removed", "(", "name", ",", "cyg_arch", "=", "'x86_64'", ",", "mirrors", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
updated
Make sure all packages are up to date. name : None No affect, salt fails poorly without the arg available cyg_arch : x86_64 The cygwin architecture to update. Current options are x86 and x86_64 mirrors : None List of mirrors to check. None will use a default mirror...
salt/states/cyg.py
def updated(name=None, cyg_arch='x86_64', mirrors=None): ''' Make sure all packages are up to date. name : None No affect, salt fails poorly without the arg available cyg_arch : x86_64 The cygwin architecture to update. Current options are x86 and x86_64 mirrors : None ...
def updated(name=None, cyg_arch='x86_64', mirrors=None): ''' Make sure all packages are up to date. name : None No affect, salt fails poorly without the arg available cyg_arch : x86_64 The cygwin architecture to update. Current options are x86 and x86_64 mirrors : None ...
[ "Make", "sure", "all", "packages", "are", "up", "to", "date", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cyg.py#L152-L207
[ "def", "updated", "(", "name", "=", "None", ",", "cyg_arch", "=", "'x86_64'", ",", "mirrors", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "'cyg.updated'", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Parse varstack data and return the result
salt/pillar/varstack_pillar.py
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 conf): ''' Parse varstack data and return the result ''' vs = varstack.Varstack(config_filename=conf) return vs.evaluate(__grains__)
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 conf): ''' Parse varstack data and return the result ''' vs = varstack.Varstack(config_filename=conf) return vs.evaluate(__grains__)
[ "Parse", "varstack", "data", "and", "return", "the", "result" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/varstack_pillar.py#L40-L47
[ "def", "ext_pillar", "(", "minion_id", ",", "# pylint: disable=W0613", "pillar", ",", "# pylint: disable=W0613", "conf", ")", ":", "vs", "=", "varstack", ".", "Varstack", "(", "config_filename", "=", "conf", ")", "return", "vs", ".", "evaluate", "(", "__grains__...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
query
Query the PagerDuty API
salt/utils/pagerduty.py
def query(method='GET', profile_dict=None, url=None, path='api/v1', action=None, api_key=None, service=None, params=None, data=None, subdomain=None, client_url=None, description=None, opts=None, verify_ssl=True): ''' Query the PagerDuty API ''' user_agent = 'SaltStack {0}'....
def query(method='GET', profile_dict=None, url=None, path='api/v1', action=None, api_key=None, service=None, params=None, data=None, subdomain=None, client_url=None, description=None, opts=None, verify_ssl=True): ''' Query the PagerDuty API ''' user_agent = 'SaltStack {0}'....
[ "Query", "the", "PagerDuty", "API" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pagerduty.py#L29-L108
[ "def", "query", "(", "method", "=", "'GET'", ",", "profile_dict", "=", "None", ",", "url", "=", "None", ",", "path", "=", "'api/v1'", ",", "action", "=", "None", ",", "api_key", "=", "None", ",", "service", "=", "None", ",", "params", "=", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_items
List items belonging to an API call. Used for list_services() and list_incidents()
salt/utils/pagerduty.py
def list_items(action, key, profile_dict=None, api_key=None, opts=None): ''' List items belonging to an API call. Used for list_services() and list_incidents() ''' items = salt.utils.json.loads(query( profile_dict=profile_dict, api_key=api_key, action=action, opts=opt...
def list_items(action, key, profile_dict=None, api_key=None, opts=None): ''' List items belonging to an API call. Used for list_services() and list_incidents() ''' items = salt.utils.json.loads(query( profile_dict=profile_dict, api_key=api_key, action=action, opts=opt...
[ "List", "items", "belonging", "to", "an", "API", "call", ".", "Used", "for", "list_services", "()", "and", "list_incidents", "()" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pagerduty.py#L111-L125
[ "def", "list_items", "(", "action", ",", "key", ",", "profile_dict", "=", "None", ",", "api_key", "=", "None", ",", "opts", "=", "None", ")", ":", "items", "=", "salt", ".", "utils", ".", "json", ".", "loads", "(", "query", "(", "profile_dict", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add
Add the specified group CLI Example: .. code-block:: bash salt '*' group.add foo 3456
salt/modules/aix_group.py
def add(name, gid=None, system=False, root=None): ''' Add the specified group CLI Example: .. code-block:: bash salt '*' group.add foo 3456 ''' cmd = 'mkgroup ' if system and root is not None: cmd += '-a ' if gid: cmd += 'id={0} '.format(gid) cmd += name ...
def add(name, gid=None, system=False, root=None): ''' Add the specified group CLI Example: .. code-block:: bash salt '*' group.add foo 3456 ''' cmd = 'mkgroup ' if system and root is not None: cmd += '-a ' if gid: cmd += 'id={0} '.format(gid) cmd += name ...
[ "Add", "the", "specified", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aix_group.py#L39-L60
[ "def", "add", "(", "name", ",", "gid", "=", "None", ",", "system", "=", "False", ",", "root", "=", "None", ")", ":", "cmd", "=", "'mkgroup '", "if", "system", "and", "root", "is", "not", "None", ":", "cmd", "+=", "'-a '", "if", "gid", ":", "cmd",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
info
Return information about a group CLI Example: .. code-block:: bash salt '*' group.info foo
salt/modules/aix_group.py
def info(name): ''' Return information about a group CLI Example: .. code-block:: bash salt '*' group.info foo ''' try: grinfo = grp.getgrnam(name) except KeyError: return {} else: return {'name': grinfo.gr_name, 'passwd': grinfo.gr_pass...
def info(name): ''' Return information about a group CLI Example: .. code-block:: bash salt '*' group.info foo ''' try: grinfo = grp.getgrnam(name) except KeyError: return {} else: return {'name': grinfo.gr_name, 'passwd': grinfo.gr_pass...
[ "Return", "information", "about", "a", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aix_group.py#L78-L96
[ "def", "info", "(", "name", ")", ":", "try", ":", "grinfo", "=", "grp", ".", "getgrnam", "(", "name", ")", "except", "KeyError", ":", "return", "{", "}", "else", ":", "return", "{", "'name'", ":", "grinfo", ".", "gr_name", ",", "'passwd'", ":", "gr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
getent
Return info on all groups CLI Example: .. code-block:: bash salt '*' group.getent
salt/modules/aix_group.py
def getent(refresh=False): ''' Return info on all groups CLI Example: .. code-block:: bash salt '*' group.getent ''' if 'group.getent' in __context__ and not refresh: return __context__['group.getent'] ret = [] for grinfo in grp.getgrall(): ret.append(info(gri...
def getent(refresh=False): ''' Return info on all groups CLI Example: .. code-block:: bash salt '*' group.getent ''' if 'group.getent' in __context__ and not refresh: return __context__['group.getent'] ret = [] for grinfo in grp.getgrall(): ret.append(info(gri...
[ "Return", "info", "on", "all", "groups" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aix_group.py#L99-L117
[ "def", "getent", "(", "refresh", "=", "False", ")", ":", "if", "'group.getent'", "in", "__context__", "and", "not", "refresh", ":", "return", "__context__", "[", "'group.getent'", "]", "ret", "=", "[", "]", "for", "grinfo", "in", "grp", ".", "getgrall", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deluser
Remove a user from the group. CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If group is not present then returns True.
salt/modules/aix_group.py
def deluser(name, username, root=None): ''' Remove a user from the group. CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If group is not present then returns True. ''' grp_info = __salt__['group.info'](name) ...
def deluser(name, username, root=None): ''' Remove a user from the group. CLI Example: .. code-block:: bash salt '*' group.deluser foo bar Removes a member user 'bar' from a group 'foo'. If group is not present then returns True. ''' grp_info = __salt__['group.info'](name) ...
[ "Remove", "a", "user", "from", "the", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aix_group.py#L161-L183
[ "def", "deluser", "(", "name", ",", "username", ",", "root", "=", "None", ")", ":", "grp_info", "=", "__salt__", "[", "'group.info'", "]", "(", "name", ")", "try", ":", "if", "username", "in", "grp_info", "[", "'members'", "]", ":", "cmd", "=", "'chg...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
members
Replaces members of the group with a provided list. CLI Example: salt '*' group.members foo 'user1,user2,user3,...' Replaces a membership list for a local group 'foo'. foo:x:1234:user1,user2,user3,...
salt/modules/aix_group.py
def members(name, members_list, root=None): ''' Replaces members of the group with a provided list. CLI Example: salt '*' group.members foo 'user1,user2,user3,...' Replaces a membership list for a local group 'foo'. foo:x:1234:user1,user2,user3,... ''' cmd = 'chgrpmem -m = {0}...
def members(name, members_list, root=None): ''' Replaces members of the group with a provided list. CLI Example: salt '*' group.members foo 'user1,user2,user3,...' Replaces a membership list for a local group 'foo'. foo:x:1234:user1,user2,user3,... ''' cmd = 'chgrpmem -m = {0}...
[ "Replaces", "members", "of", "the", "group", "with", "a", "provided", "list", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aix_group.py#L186-L200
[ "def", "members", "(", "name", ",", "members_list", ",", "root", "=", "None", ")", ":", "cmd", "=", "'chgrpmem -m = {0} {1}'", ".", "format", "(", "members_list", ",", "name", ")", "retcode", "=", "__salt__", "[", "'cmd.retcode'", "]", "(", "cmd", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install pyenv systemwide CLI Example: .. code-block:: bash salt '*' pyenv.install
salt/modules/pyenv.py
def install(runas=None, path=None): ''' Install pyenv systemwide CLI Example: .. code-block:: bash salt '*' pyenv.install ''' path = path or _pyenv_path(runas) path = os.path.expanduser(path) return _install_pyenv(path, runas)
def install(runas=None, path=None): ''' Install pyenv systemwide CLI Example: .. code-block:: bash salt '*' pyenv.install ''' path = path or _pyenv_path(runas) path = os.path.expanduser(path) return _install_pyenv(path, runas)
[ "Install", "pyenv", "systemwide" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L105-L117
[ "def", "install", "(", "runas", "=", "None", ",", "path", "=", "None", ")", ":", "path", "=", "path", "or", "_pyenv_path", "(", "runas", ")", "path", "=", "os", ".", "path", ".", "expanduser", "(", "path", ")", "return", "_install_pyenv", "(", "path"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Updates the current versions of pyenv and python-Build CLI Example: .. code-block:: bash salt '*' pyenv.update
salt/modules/pyenv.py
def update(runas=None, path=None): ''' Updates the current versions of pyenv and python-Build CLI Example: .. code-block:: bash salt '*' pyenv.update ''' path = path or _pyenv_path(runas) path = os.path.expanduser(path) return _update_pyenv(path, runas)
def update(runas=None, path=None): ''' Updates the current versions of pyenv and python-Build CLI Example: .. code-block:: bash salt '*' pyenv.update ''' path = path or _pyenv_path(runas) path = os.path.expanduser(path) return _update_pyenv(path, runas)
[ "Updates", "the", "current", "versions", "of", "pyenv", "and", "python", "-", "Build" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L120-L133
[ "def", "update", "(", "runas", "=", "None", ",", "path", "=", "None", ")", ":", "path", "=", "path", "or", "_pyenv_path", "(", "runas", ")", "path", "=", "os", ".", "path", ".", "expanduser", "(", "path", ")", "return", "_update_pyenv", "(", "path", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install_python
Install a python implementation. python The version of python to install, should match one of the versions listed by pyenv.list CLI Example: .. code-block:: bash salt '*' pyenv.install_python 2.0.0-p0
salt/modules/pyenv.py
def install_python(python, runas=None): ''' Install a python implementation. python The version of python to install, should match one of the versions listed by pyenv.list CLI Example: .. code-block:: bash salt '*' pyenv.install_python 2.0.0-p0 ''' python = re.sub...
def install_python(python, runas=None): ''' Install a python implementation. python The version of python to install, should match one of the versions listed by pyenv.list CLI Example: .. code-block:: bash salt '*' pyenv.install_python 2.0.0-p0 ''' python = re.sub...
[ "Install", "a", "python", "implementation", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L149-L185
[ "def", "install_python", "(", "python", ",", "runas", "=", "None", ")", ":", "python", "=", "re", ".", "sub", "(", "r'^python-'", ",", "''", ",", "python", ")", "env", "=", "None", "env_list", "=", "[", "]", "if", "__grains__", "[", "'os'", "]", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
uninstall_python
Uninstall a python implementation. python The version of python to uninstall. Should match one of the versions listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>` CLI Example: .. code-block:: bash salt '*' pyenv.uninstall_python 2.0.0-p0
salt/modules/pyenv.py
def uninstall_python(python, runas=None): ''' Uninstall a python implementation. python The version of python to uninstall. Should match one of the versions listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>` CLI Example: .. code-block:: bash salt '*' pyenv.unin...
def uninstall_python(python, runas=None): ''' Uninstall a python implementation. python The version of python to uninstall. Should match one of the versions listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>` CLI Example: .. code-block:: bash salt '*' pyenv.unin...
[ "Uninstall", "a", "python", "implementation", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L188-L206
[ "def", "uninstall_python", "(", "python", ",", "runas", "=", "None", ")", ":", "python", "=", "re", ".", "sub", "(", "r'^python-'", ",", "''", ",", "python", ")", "args", "=", "'--force {0}'", ".", "format", "(", "python", ")", "_pyenv_exec", "(", "'un...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
versions
List the installed versions of python. CLI Example: .. code-block:: bash salt '*' pyenv.versions
salt/modules/pyenv.py
def versions(runas=None): ''' List the installed versions of python. CLI Example: .. code-block:: bash salt '*' pyenv.versions ''' ret = _pyenv_exec('versions', '--bare', runas=runas) return [] if ret is False else ret.splitlines()
def versions(runas=None): ''' List the installed versions of python. CLI Example: .. code-block:: bash salt '*' pyenv.versions ''' ret = _pyenv_exec('versions', '--bare', runas=runas) return [] if ret is False else ret.splitlines()
[ "List", "the", "installed", "versions", "of", "python", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L209-L220
[ "def", "versions", "(", "runas", "=", "None", ")", ":", "ret", "=", "_pyenv_exec", "(", "'versions'", ",", "'--bare'", ",", "runas", "=", "runas", ")", "return", "[", "]", "if", "ret", "is", "False", "else", "ret", ".", "splitlines", "(", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
default
Returns or sets the currently defined default python. python=None The version to set as the default. Should match one of the versions listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>`. Leave blank to return the current default. CLI Example: .. code-block:: bash ...
salt/modules/pyenv.py
def default(python=None, runas=None): ''' Returns or sets the currently defined default python. python=None The version to set as the default. Should match one of the versions listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>`. Leave blank to return the current default. ...
def default(python=None, runas=None): ''' Returns or sets the currently defined default python. python=None The version to set as the default. Should match one of the versions listed by :mod:`pyenv.versions <salt.modules.pyenv.versions>`. Leave blank to return the current default. ...
[ "Returns", "or", "sets", "the", "currently", "defined", "default", "python", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L223-L244
[ "def", "default", "(", "python", "=", "None", ",", "runas", "=", "None", ")", ":", "if", "python", ":", "_pyenv_exec", "(", "'global'", ",", "python", ",", "runas", "=", "runas", ")", "return", "True", "else", ":", "ret", "=", "_pyenv_exec", "(", "'g...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
do
Execute a python command with pyenv's shims from the user or the system. CLI Example: .. code-block:: bash salt '*' pyenv.do 'gem list bundler' salt '*' pyenv.do 'gem list bundler' deploy
salt/modules/pyenv.py
def do(cmdline=None, runas=None): ''' Execute a python command with pyenv's shims from the user or the system. CLI Example: .. code-block:: bash salt '*' pyenv.do 'gem list bundler' salt '*' pyenv.do 'gem list bundler' deploy ''' path = _pyenv_path(runas) cmd_split = cmdli...
def do(cmdline=None, runas=None): ''' Execute a python command with pyenv's shims from the user or the system. CLI Example: .. code-block:: bash salt '*' pyenv.do 'gem list bundler' salt '*' pyenv.do 'gem list bundler' deploy ''' path = _pyenv_path(runas) cmd_split = cmdli...
[ "Execute", "a", "python", "command", "with", "pyenv", "s", "shims", "from", "the", "user", "or", "the", "system", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L281-L307
[ "def", "do", "(", "cmdline", "=", "None", ",", "runas", "=", "None", ")", ":", "path", "=", "_pyenv_path", "(", "runas", ")", "cmd_split", "=", "cmdline", ".", "split", "(", ")", "quoted_line", "=", "''", "for", "cmd", "in", "cmd_split", ":", "quoted...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
do_with_python
Execute a python command with pyenv's shims using a specific python version. CLI Example: .. code-block:: bash salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' deploy
salt/modules/pyenv.py
def do_with_python(python, cmdline, runas=None): ''' Execute a python command with pyenv's shims using a specific python version. CLI Example: .. code-block:: bash salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' deplo...
def do_with_python(python, cmdline, runas=None): ''' Execute a python command with pyenv's shims using a specific python version. CLI Example: .. code-block:: bash salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' deplo...
[ "Execute", "a", "python", "command", "with", "pyenv", "s", "shims", "using", "a", "specific", "python", "version", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pyenv.py#L310-L326
[ "def", "do_with_python", "(", "python", ",", "cmdline", ",", "runas", "=", "None", ")", ":", "if", "python", ":", "cmd", "=", "'PYENV_VERSION={0} {1}'", ".", "format", "(", "python", ",", "cmdline", ")", "else", ":", "cmd", "=", "cmdline", "return", "do"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure RDS instance exists. name Name of the RDS state definition. allocated_storage The amount of storage (in gigabytes) to be initially allocated for the database instance. db_instance_class The compute and memory capacity of the Amazon RDS DB instance. engine ...
salt/states/boto_rds.py
def present(name, allocated_storage, db_instance_class, engine, master_username, master_user_password, db_name=None, storage_type=None, db_security_groups=None, vpc_security_group_ids=None, vpc_securi...
def present(name, allocated_storage, db_instance_class, engine, master_username, master_user_password, db_name=None, storage_type=None, db_security_groups=None, vpc_security_group_ids=None, vpc_securi...
[ "Ensure", "RDS", "instance", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_rds.py#L94-L361
[ "def", "present", "(", "name", ",", "allocated_storage", ",", "db_instance_class", ",", "engine", ",", "master_username", ",", "master_user_password", ",", "db_name", "=", "None", ",", "storage_type", "=", "None", ",", "db_security_groups", "=", "None", ",", "vp...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
replica_present
Ensure RDS replica exists. .. code-block:: yaml Ensure myrds replica RDS exists: boto_rds.create_replica: - name: myreplica - source: mydb
salt/states/boto_rds.py
def replica_present(name, source, db_instance_class=None, availability_zone=None, port=None, auto_minor_version_upgrade=None, iops=None, option_group_name=None, publicly_accessible=None, tags=None, region=None, key=None, keyid=None, ...
def replica_present(name, source, db_instance_class=None, availability_zone=None, port=None, auto_minor_version_upgrade=None, iops=None, option_group_name=None, publicly_accessible=None, tags=None, region=None, key=None, keyid=None, ...
[ "Ensure", "RDS", "replica", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_rds.py#L364-L428
[ "def", "replica_present", "(", "name", ",", "source", ",", "db_instance_class", "=", "None", ",", "availability_zone", "=", "None", ",", "port", "=", "None", ",", "auto_minor_version_upgrade", "=", "None", ",", "iops", "=", "None", ",", "option_group_name", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subnet_group_present
Ensure DB subnet group exists. name The name for the DB subnet group. This value is stored as a lowercase string. subnet_ids A list of the EC2 Subnet IDs for the DB subnet group. Either subnet_ids or subnet_names must be provided. subnet_names A list of The EC2 Subnet name...
salt/states/boto_rds.py
def subnet_group_present(name, description, subnet_ids=None, subnet_names=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure DB subnet group exists. name The name for the DB subnet group. This value is stored as a lowercas...
def subnet_group_present(name, description, subnet_ids=None, subnet_names=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure DB subnet group exists. name The name for the DB subnet group. This value is stored as a lowercas...
[ "Ensure", "DB", "subnet", "group", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_rds.py#L431-L523
[ "def", "subnet_group_present", "(", "name", ",", "description", ",", "subnet_ids", "=", "None", ",", "subnet_names", "=", "None", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure RDS instance is absent. name Name of the RDS instance. skip_final_snapshot Whether a final db snapshot is created before the instance is deleted. If True, no snapshot is created. If False, a snapshot is created before deleting the instance. final_db_snapshot_identif...
salt/states/boto_rds.py
def absent(name, skip_final_snapshot=None, final_db_snapshot_identifier=None, tags=None, wait_for_deletion=True, timeout=180, region=None, key=None, keyid=None, profile=None): ''' Ensure RDS instance is absent. name Name of the RDS instance. skip_final_snapshot Wh...
def absent(name, skip_final_snapshot=None, final_db_snapshot_identifier=None, tags=None, wait_for_deletion=True, timeout=180, region=None, key=None, keyid=None, profile=None): ''' Ensure RDS instance is absent. name Name of the RDS instance. skip_final_snapshot Wh...
[ "Ensure", "RDS", "instance", "is", "absent", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_rds.py#L526-L595
[ "def", "absent", "(", "name", ",", "skip_final_snapshot", "=", "None", ",", "final_db_snapshot_identifier", "=", "None", ",", "tags", "=", "None", ",", "wait_for_deletion", "=", "True", ",", "timeout", "=", "180", ",", "region", "=", "None", ",", "key", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
parameter_present
Ensure DB parameter group exists and update parameters. name The name for the parameter group. db_parameter_group_family The DB parameter group family name. A DB parameter group can be associated with one and only one DB parameter group family, and can be applied only to a DB i...
salt/states/boto_rds.py
def parameter_present(name, db_parameter_group_family, description, parameters=None, apply_method="pending-reboot", tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure DB parameter group exists and update parameters. name The name for the parameter group. ...
def parameter_present(name, db_parameter_group_family, description, parameters=None, apply_method="pending-reboot", tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure DB parameter group exists and update parameters. name The name for the parameter group. ...
[ "Ensure", "DB", "parameter", "group", "exists", "and", "update", "parameters", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_rds.py#L627-L734
[ "def", "parameter_present", "(", "name", ",", "db_parameter_group_family", ",", "description", ",", "parameters", "=", "None", ",", "apply_method", "=", "\"pending-reboot\"", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_interval
Convert an interval string like 1w3d6h into the number of seconds, time resolution (1 unit of the smallest specified time unit) and the modifier( '+', '-', or ''). w = week d = day h = hour m = minute s = second
salt/utils/find.py
def _parse_interval(value): ''' Convert an interval string like 1w3d6h into the number of seconds, time resolution (1 unit of the smallest specified time unit) and the modifier( '+', '-', or ''). w = week d = day h = hour m = minute s = second ''' match = ...
def _parse_interval(value): ''' Convert an interval string like 1w3d6h into the number of seconds, time resolution (1 unit of the smallest specified time unit) and the modifier( '+', '-', or ''). w = week d = day h = hour m = minute s = second ''' match = ...
[ "Convert", "an", "interval", "string", "like", "1w3d6h", "into", "the", "number", "of", "seconds", "time", "resolution", "(", "1", "unit", "of", "the", "smallest", "specified", "time", "unit", ")", "and", "the", "modifier", "(", "+", "-", "or", ")", ".",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/find.py#L152-L179
[ "def", "_parse_interval", "(", "value", ")", ":", "match", "=", "_INTERVAL_REGEX", ".", "match", "(", "six", ".", "text_type", "(", "value", ")", ")", "if", "match", "is", "None", ":", "raise", "ValueError", "(", "'invalid time interval: \\'{0}\\''", ".", "f...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
find
WRITEME
salt/utils/find.py
def find(path, options): ''' WRITEME ''' finder = Finder(options) for path in finder.find(path): yield path
def find(path, options): ''' WRITEME ''' finder = Finder(options) for path in finder.find(path): yield path
[ "WRITEME" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/find.py#L697-L703
[ "def", "find", "(", "path", ",", "options", ")", ":", "finder", "=", "Finder", "(", "options", ")", "for", "path", "in", "finder", ".", "find", "(", "path", ")", ":", "yield", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Finder.find
Generate filenames in path that satisfy criteria specified in the constructor. This method is a generator and should be repeatedly called until there are no more results.
salt/utils/find.py
def find(self, path): ''' Generate filenames in path that satisfy criteria specified in the constructor. This method is a generator and should be repeatedly called until there are no more results. ''' if self.mindepth < 1: dirpath, name = os.path.split...
def find(self, path): ''' Generate filenames in path that satisfy criteria specified in the constructor. This method is a generator and should be repeatedly called until there are no more results. ''' if self.mindepth < 1: dirpath, name = os.path.split...
[ "Generate", "filenames", "in", "path", "that", "satisfy", "criteria", "specified", "in", "the", "constructor", ".", "This", "method", "is", "a", "generator", "and", "should", "be", "repeatedly", "called", "until", "there", "are", "no", "more", "results", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/find.py#L632-L658
[ "def", "find", "(", "self", ",", "path", ")", ":", "if", "self", ".", "mindepth", "<", "1", ":", "dirpath", ",", "name", "=", "os", ".", "path", ".", "split", "(", "path", ")", "match", ",", "fstat", "=", "self", ".", "_check_criteria", "(", "dir...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_services
List services belonging to this account CLI Example: salt myminion pagerduty.list_services my-pagerduty-account
salt/modules/pagerduty.py
def list_services(profile=None, api_key=None): ''' List services belonging to this account CLI Example: salt myminion pagerduty.list_services my-pagerduty-account ''' return salt.utils.pagerduty.list_items( 'services', 'name', __salt__['config.option'](profile), ...
def list_services(profile=None, api_key=None): ''' List services belonging to this account CLI Example: salt myminion pagerduty.list_services my-pagerduty-account ''' return salt.utils.pagerduty.list_items( 'services', 'name', __salt__['config.option'](profile), ...
[ "List", "services", "belonging", "to", "this", "account" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pagerduty.py#L37-L51
[ "def", "list_services", "(", "profile", "=", "None", ",", "api_key", "=", "None", ")", ":", "return", "salt", ".", "utils", ".", "pagerduty", ".", "list_items", "(", "'services'", ",", "'name'", ",", "__salt__", "[", "'config.option'", "]", "(", "profile",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_event
Create an event in PagerDuty. Designed for use in states. CLI Example: .. code-block:: yaml salt myminion pagerduty.create_event <service_key> <description> <details> \ profile=my-pagerduty-account The following parameters are required: service_key This key can be found by u...
salt/modules/pagerduty.py
def create_event(service_key=None, description=None, details=None, incident_key=None, profile=None): ''' Create an event in PagerDuty. Designed for use in states. CLI Example: .. code-block:: yaml salt myminion pagerduty.create_event <service_key> <description> <details> \ ...
def create_event(service_key=None, description=None, details=None, incident_key=None, profile=None): ''' Create an event in PagerDuty. Designed for use in states. CLI Example: .. code-block:: yaml salt myminion pagerduty.create_event <service_key> <description> <details> \ ...
[ "Create", "an", "event", "in", "PagerDuty", ".", "Designed", "for", "use", "in", "states", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pagerduty.py#L149-L197
[ "def", "create_event", "(", "service_key", "=", "None", ",", "description", "=", "None", ",", "details", "=", "None", ",", "incident_key", "=", "None", ",", "profile", "=", "None", ")", ":", "trigger_url", "=", "'https://events.pagerduty.com/generic/2010-04-15/cre...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_store
Store a certificate to the given store name The certificate to store, this can use local paths or salt:// paths store The store to add the certificate to saltenv The salt environment to use, this is ignored if a local path is specified
salt/states/win_certutil.py
def add_store(name, store, saltenv='base'): ''' Store a certificate to the given store name The certificate to store, this can use local paths or salt:// paths store The store to add the certificate to saltenv The salt environment to use, this is ignored if a local...
def add_store(name, store, saltenv='base'): ''' Store a certificate to the given store name The certificate to store, this can use local paths or salt:// paths store The store to add the certificate to saltenv The salt environment to use, this is ignored if a local...
[ "Store", "a", "certificate", "to", "the", "given", "store" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_certutil.py#L34-L73
[ "def", "add_store", "(", "name", ",", "store", ",", "saltenv", "=", "'base'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "cert_file", "=", "__sa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SyncClientMixin.master_call
Execute a function through the master network interface.
salt/client/mixins.py
def master_call(self, **kwargs): ''' Execute a function through the master network interface. ''' load = kwargs load['cmd'] = self.client channel = salt.transport.client.ReqChannel.factory(self.opts, crypt='clear'...
def master_call(self, **kwargs): ''' Execute a function through the master network interface. ''' load = kwargs load['cmd'] = self.client channel = salt.transport.client.ReqChannel.factory(self.opts, crypt='clear'...
[ "Execute", "a", "function", "through", "the", "master", "network", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L139-L155
[ "def", "master_call", "(", "self", ",", "*", "*", "kwargs", ")", ":", "load", "=", "kwargs", "load", "[", "'cmd'", "]", "=", "self", ".", "client", "channel", "=", "salt", ".", "transport", ".", "client", ".", "ReqChannel", ".", "factory", "(", "self...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SyncClientMixin.cmd_sync
Execute a runner function synchronously; eauth is respected This function requires that :conf_master:`external_auth` is configured and the user is authorized to execute runner functions: (``@runner``). .. code-block:: python runner.eauth_sync({ 'fun': 'jobs.list_jo...
salt/client/mixins.py
def cmd_sync(self, low, timeout=None, full_return=False): ''' Execute a runner function synchronously; eauth is respected This function requires that :conf_master:`external_auth` is configured and the user is authorized to execute runner functions: (``@runner``). .. code-block:...
def cmd_sync(self, low, timeout=None, full_return=False): ''' Execute a runner function synchronously; eauth is respected This function requires that :conf_master:`external_auth` is configured and the user is authorized to execute runner functions: (``@runner``). .. code-block:...
[ "Execute", "a", "runner", "function", "synchronously", ";", "eauth", "is", "respected" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L157-L185
[ "def", "cmd_sync", "(", "self", ",", "low", ",", "timeout", "=", "None", ",", "full_return", "=", "False", ")", ":", "event", "=", "salt", ".", "utils", ".", "event", ".", "get_master_event", "(", "self", ".", "opts", ",", "self", ".", "opts", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SyncClientMixin.cmd
Execute a function .. code-block:: python >>> opts = salt.config.master_config('/etc/salt/master') >>> runner = salt.runner.RunnerClient(opts) >>> runner.cmd('jobs.list_jobs', []) { '20131219215650131543': { 'Arguments': [300]...
salt/client/mixins.py
def cmd(self, fun, arg=None, pub_data=None, kwarg=None, print_event=True, full_return=False): ''' Execute a function .. code-block:: python >>> opts = salt.config.master_config('/etc/salt/master') >>> runner = salt.runner.RunnerClient(opts) >>> runner.cmd('j...
def cmd(self, fun, arg=None, pub_data=None, kwarg=None, print_event=True, full_return=False): ''' Execute a function .. code-block:: python >>> opts = salt.config.master_config('/etc/salt/master') >>> runner = salt.runner.RunnerClient(opts) >>> runner.cmd('j...
[ "Execute", "a", "function" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L187-L249
[ "def", "cmd", "(", "self", ",", "fun", ",", "arg", "=", "None", ",", "pub_data", "=", "None", ",", "kwarg", "=", "None", ",", "print_event", "=", "True", ",", "full_return", "=", "False", ")", ":", "if", "arg", "is", "None", ":", "arg", "=", "tup...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SyncClientMixin.store_job
Helper that allows us to turn off storing jobs for different classes that may incorporate this mixin.
salt/client/mixins.py
def store_job(self): ''' Helper that allows us to turn off storing jobs for different classes that may incorporate this mixin. ''' try: class_name = self.__class__.__name__.lower() except AttributeError: log.warning( 'Unable to dete...
def store_job(self): ''' Helper that allows us to turn off storing jobs for different classes that may incorporate this mixin. ''' try: class_name = self.__class__.__name__.lower() except AttributeError: log.warning( 'Unable to dete...
[ "Helper", "that", "allows", "us", "to", "turn", "off", "storing", "jobs", "for", "different", "classes", "that", "may", "incorporate", "this", "mixin", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L258-L277
[ "def", "store_job", "(", "self", ")", ":", "try", ":", "class_name", "=", "self", ".", "__class__", ".", "__name__", ".", "lower", "(", ")", "except", "AttributeError", ":", "log", ".", "warning", "(", "'Unable to determine class name'", ",", "exc_info_on_logl...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SyncClientMixin.low
Execute a function from low data Low data includes: required: - fun: the name of the function to run optional: - arg: a list of args to pass to fun - kwarg: kwargs for fun - __user__: user who is running the command ...
salt/client/mixins.py
def low(self, fun, low, print_event=True, full_return=False): ''' Execute a function from low data Low data includes: required: - fun: the name of the function to run optional: - arg: a list of args to pass to fun - kwarg: k...
def low(self, fun, low, print_event=True, full_return=False): ''' Execute a function from low data Low data includes: required: - fun: the name of the function to run optional: - arg: a list of args to pass to fun - kwarg: k...
[ "Execute", "a", "function", "from", "low", "data", "Low", "data", "includes", ":", "required", ":", "-", "fun", ":", "the", "name", "of", "the", "function", "to", "run", "optional", ":", "-", "arg", ":", "a", "list", "of", "args", "to", "pass", "to",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L279-L444
[ "def", "low", "(", "self", ",", "fun", ",", "low", ",", "print_event", "=", "True", ",", "full_return", "=", "False", ")", ":", "# fire the mminion loading (if not already done) here", "# this is not to clutter the output with the module loading", "# if we have a high debug l...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SyncClientMixin.get_docs
Return a dictionary of functions and the inline documentation for each
salt/client/mixins.py
def get_docs(self, arg=None): ''' Return a dictionary of functions and the inline documentation for each ''' if arg: if '*' in arg: target_mod = arg _use_fnmatch = True else: target_mod = arg + '.' if not arg.endswit...
def get_docs(self, arg=None): ''' Return a dictionary of functions and the inline documentation for each ''' if arg: if '*' in arg: target_mod = arg _use_fnmatch = True else: target_mod = arg + '.' if not arg.endswit...
[ "Return", "a", "dictionary", "of", "functions", "and", "the", "inline", "documentation", "for", "each" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L446-L468
[ "def", "get_docs", "(", "self", ",", "arg", "=", "None", ")", ":", "if", "arg", ":", "if", "'*'", "in", "arg", ":", "target_mod", "=", "arg", "_use_fnmatch", "=", "True", "else", ":", "target_mod", "=", "arg", "+", "'.'", "if", "not", "arg", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
AsyncClientMixin.asynchronous
Execute the function in a multiprocess and return the event tag to use to watch for the return
salt/client/mixins.py
def asynchronous(self, fun, low, user='UNKNOWN', pub=None): ''' Execute the function in a multiprocess and return the event tag to use to watch for the return ''' async_pub = pub if pub is not None else self._gen_async_pub() proc = salt.utils.process.SignalHandlingMultip...
def asynchronous(self, fun, low, user='UNKNOWN', pub=None): ''' Execute the function in a multiprocess and return the event tag to use to watch for the return ''' async_pub = pub if pub is not None else self._gen_async_pub() proc = salt.utils.process.SignalHandlingMultip...
[ "Execute", "the", "function", "in", "a", "multiprocess", "and", "return", "the", "event", "tag", "to", "use", "to", "watch", "for", "the", "return" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L525-L540
[ "def", "asynchronous", "(", "self", ",", "fun", ",", "low", ",", "user", "=", "'UNKNOWN'", ",", "pub", "=", "None", ")", ":", "async_pub", "=", "pub", "if", "pub", "is", "not", "None", "else", "self", ".", "_gen_async_pub", "(", ")", "proc", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
AsyncClientMixin.print_async_event
Print all of the events with the prefix 'tag'
salt/client/mixins.py
def print_async_event(self, suffix, event): ''' Print all of the events with the prefix 'tag' ''' if not isinstance(event, dict): return # if we are "quiet", don't print if self.opts.get('quiet', False): return # some suffixes we don't wa...
def print_async_event(self, suffix, event): ''' Print all of the events with the prefix 'tag' ''' if not isinstance(event, dict): return # if we are "quiet", don't print if self.opts.get('quiet', False): return # some suffixes we don't wa...
[ "Print", "all", "of", "the", "events", "with", "the", "prefix", "tag" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/mixins.py#L542-L575
[ "def", "print_async_event", "(", "self", ",", "suffix", ",", "event", ")", ":", "if", "not", "isinstance", "(", "event", ",", "dict", ")", ":", "return", "# if we are \"quiet\", don't print", "if", "self", ".", "opts", ".", "get", "(", "'quiet'", ",", "Fal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
write_urls_index
Generate a JSON file to serve as an index for short-URL lookups
doc/_ext/shorturls.py
def write_urls_index(app, exc): ''' Generate a JSON file to serve as an index for short-URL lookups ''' inventory = os.path.join(app.builder.outdir, 'objects.inv') objects = sphinx.ext.intersphinx.fetch_inventory(app, DOCS_URL, inventory) with open(os.path.join(app.builder.outdir, 'shorturls.js...
def write_urls_index(app, exc): ''' Generate a JSON file to serve as an index for short-URL lookups ''' inventory = os.path.join(app.builder.outdir, 'objects.inv') objects = sphinx.ext.intersphinx.fetch_inventory(app, DOCS_URL, inventory) with open(os.path.join(app.builder.outdir, 'shorturls.js...
[ "Generate", "a", "JSON", "file", "to", "serve", "as", "an", "index", "for", "short", "-", "URL", "lookups" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/doc/_ext/shorturls.py#L11-L19
[ "def", "write_urls_index", "(", "app", ",", "exc", ")", ":", "inventory", "=", "os", ".", "path", ".", "join", "(", "app", ".", "builder", ".", "outdir", ",", "'objects.inv'", ")", "objects", "=", "sphinx", ".", "ext", ".", "intersphinx", ".", "fetch_i...
e8541fd6e744ab0df786c0f76102e41631f45d46