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 | Minion._refresh_grains_watcher | Create a loop that will fire a pillar refresh to inform a master about a change in the grains of this minion
:param refresh_interval_in_minutes:
:return: None | salt/minion.py | def _refresh_grains_watcher(self, refresh_interval_in_minutes):
'''
Create a loop that will fire a pillar refresh to inform a master about a change in the grains of this minion
:param refresh_interval_in_minutes:
:return: None
'''
if '__update_grains' not in self.opts.get... | def _refresh_grains_watcher(self, refresh_interval_in_minutes):
'''
Create a loop that will fire a pillar refresh to inform a master about a change in the grains of this minion
:param refresh_interval_in_minutes:
:return: None
'''
if '__update_grains' not in self.opts.get... | [
"Create",
"a",
"loop",
"that",
"will",
"fire",
"a",
"pillar",
"refresh",
"to",
"inform",
"a",
"master",
"about",
"a",
"change",
"in",
"the",
"grains",
"of",
"this",
"minion",
":",
"param",
"refresh_interval_in_minutes",
":",
":",
"return",
":",
"None"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2169-L2185 | [
"def",
"_refresh_grains_watcher",
"(",
"self",
",",
"refresh_interval_in_minutes",
")",
":",
"if",
"'__update_grains'",
"not",
"in",
"self",
".",
"opts",
".",
"get",
"(",
"'schedule'",
",",
"{",
"}",
")",
":",
"if",
"'schedule'",
"not",
"in",
"self",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.module_refresh | Refresh the functions and returners. | salt/minion.py | def module_refresh(self, force_refresh=False, notify=False):
'''
Refresh the functions and returners.
'''
log.debug('Refreshing modules. Notify=%s', notify)
self.functions, self.returners, _, self.executors = self._load_modules(force_refresh, notify=notify)
self.schedule... | def module_refresh(self, force_refresh=False, notify=False):
'''
Refresh the functions and returners.
'''
log.debug('Refreshing modules. Notify=%s', notify)
self.functions, self.returners, _, self.executors = self._load_modules(force_refresh, notify=notify)
self.schedule... | [
"Refresh",
"the",
"functions",
"and",
"returners",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2207-L2215 | [
"def",
"module_refresh",
"(",
"self",
",",
"force_refresh",
"=",
"False",
",",
"notify",
"=",
"False",
")",
":",
"log",
".",
"debug",
"(",
"'Refreshing modules. Notify=%s'",
",",
"notify",
")",
"self",
".",
"functions",
",",
"self",
".",
"returners",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.beacons_refresh | Refresh the functions and returners. | salt/minion.py | def beacons_refresh(self):
'''
Refresh the functions and returners.
'''
log.debug('Refreshing beacons.')
self.beacons = salt.beacons.Beacon(self.opts, self.functions) | def beacons_refresh(self):
'''
Refresh the functions and returners.
'''
log.debug('Refreshing beacons.')
self.beacons = salt.beacons.Beacon(self.opts, self.functions) | [
"Refresh",
"the",
"functions",
"and",
"returners",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2217-L2222 | [
"def",
"beacons_refresh",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'Refreshing beacons.'",
")",
"self",
".",
"beacons",
"=",
"salt",
".",
"beacons",
".",
"Beacon",
"(",
"self",
".",
"opts",
",",
"self",
".",
"functions",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.matchers_refresh | Refresh the matchers | salt/minion.py | def matchers_refresh(self):
'''
Refresh the matchers
'''
log.debug('Refreshing matchers.')
self.matchers = salt.loader.matchers(self.opts) | def matchers_refresh(self):
'''
Refresh the matchers
'''
log.debug('Refreshing matchers.')
self.matchers = salt.loader.matchers(self.opts) | [
"Refresh",
"the",
"matchers"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2224-L2229 | [
"def",
"matchers_refresh",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'Refreshing matchers.'",
")",
"self",
".",
"matchers",
"=",
"salt",
".",
"loader",
".",
"matchers",
"(",
"self",
".",
"opts",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.pillar_refresh | Refresh the pillar | salt/minion.py | def pillar_refresh(self, force_refresh=False, notify=False):
'''
Refresh the pillar
'''
if self.connected:
log.debug('Refreshing pillar. Notify: %s', notify)
async_pillar = salt.pillar.get_async_pillar(
self.opts,
self.opts['grains'... | def pillar_refresh(self, force_refresh=False, notify=False):
'''
Refresh the pillar
'''
if self.connected:
log.debug('Refreshing pillar. Notify: %s', notify)
async_pillar = salt.pillar.get_async_pillar(
self.opts,
self.opts['grains'... | [
"Refresh",
"the",
"pillar"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2233-L2259 | [
"def",
"pillar_refresh",
"(",
"self",
",",
"force_refresh",
"=",
"False",
",",
"notify",
"=",
"False",
")",
":",
"if",
"self",
".",
"connected",
":",
"log",
".",
"debug",
"(",
"'Refreshing pillar. Notify: %s'",
",",
"notify",
")",
"async_pillar",
"=",
"salt"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.manage_schedule | Refresh the functions and returners. | salt/minion.py | def manage_schedule(self, tag, data):
'''
Refresh the functions and returners.
'''
func = data.get('func', None)
name = data.get('name', None)
schedule = data.get('schedule', None)
where = data.get('where', None)
persist = data.get('persist', None)
... | def manage_schedule(self, tag, data):
'''
Refresh the functions and returners.
'''
func = data.get('func', None)
name = data.get('name', None)
schedule = data.get('schedule', None)
where = data.get('where', None)
persist = data.get('persist', None)
... | [
"Refresh",
"the",
"functions",
"and",
"returners",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2261-L2293 | [
"def",
"manage_schedule",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"func",
"=",
"data",
".",
"get",
"(",
"'func'",
",",
"None",
")",
"name",
"=",
"data",
".",
"get",
"(",
"'name'",
",",
"None",
")",
"schedule",
"=",
"data",
".",
"get",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.manage_beacons | Manage Beacons | salt/minion.py | def manage_beacons(self, tag, data):
'''
Manage Beacons
'''
func = data.get('func', None)
name = data.get('name', None)
beacon_data = data.get('beacon_data', None)
include_pillar = data.get('include_pillar', None)
include_opts = data.get('include_opts', No... | def manage_beacons(self, tag, data):
'''
Manage Beacons
'''
func = data.get('func', None)
name = data.get('name', None)
beacon_data = data.get('beacon_data', None)
include_pillar = data.get('include_pillar', None)
include_opts = data.get('include_opts', No... | [
"Manage",
"Beacons"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2295-L2330 | [
"def",
"manage_beacons",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"func",
"=",
"data",
".",
"get",
"(",
"'func'",
",",
"None",
")",
"name",
"=",
"data",
".",
"get",
"(",
"'name'",
",",
"None",
")",
"beacon_data",
"=",
"data",
".",
"get",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.environ_setenv | Set the salt-minion main process environment according to
the data contained in the minion event data | salt/minion.py | def environ_setenv(self, tag, data):
'''
Set the salt-minion main process environment according to
the data contained in the minion event data
'''
environ = data.get('environ', None)
if environ is None:
return False
false_unsets = data.get('false_unset... | def environ_setenv(self, tag, data):
'''
Set the salt-minion main process environment according to
the data contained in the minion event data
'''
environ = data.get('environ', None)
if environ is None:
return False
false_unsets = data.get('false_unset... | [
"Set",
"the",
"salt",
"-",
"minion",
"main",
"process",
"environment",
"according",
"to",
"the",
"data",
"contained",
"in",
"the",
"minion",
"event",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2332-L2343 | [
"def",
"environ_setenv",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"environ",
"=",
"data",
".",
"get",
"(",
"'environ'",
",",
"None",
")",
"if",
"environ",
"is",
"None",
":",
"return",
"False",
"false_unsets",
"=",
"data",
".",
"get",
"(",
"'fa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._pre_tune | Set the minion running flag and issue the appropriate warnings if
the minion cannot be started or is already running | salt/minion.py | def _pre_tune(self):
'''
Set the minion running flag and issue the appropriate warnings if
the minion cannot be started or is already running
'''
if self._running is None:
self._running = True
elif self._running is False:
log.error(
... | def _pre_tune(self):
'''
Set the minion running flag and issue the appropriate warnings if
the minion cannot be started or is already running
'''
if self._running is None:
self._running = True
elif self._running is False:
log.error(
... | [
"Set",
"the",
"minion",
"running",
"flag",
"and",
"issue",
"the",
"appropriate",
"warnings",
"if",
"the",
"minion",
"cannot",
"be",
"started",
"or",
"is",
"already",
"running"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2345-L2378 | [
"def",
"_pre_tune",
"(",
"self",
")",
":",
"if",
"self",
".",
"_running",
"is",
"None",
":",
"self",
".",
"_running",
"=",
"True",
"elif",
"self",
".",
"_running",
"is",
"False",
":",
"log",
".",
"error",
"(",
"'This %s was scheduled to stop. Not running %s.... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._mine_send | Send mine data to the master | salt/minion.py | def _mine_send(self, tag, data):
'''
Send mine data to the master
'''
channel = salt.transport.client.ReqChannel.factory(self.opts)
data['tok'] = self.tok
try:
ret = channel.send(data)
return ret
except SaltReqTimeoutError:
log.... | def _mine_send(self, tag, data):
'''
Send mine data to the master
'''
channel = salt.transport.client.ReqChannel.factory(self.opts)
data['tok'] = self.tok
try:
ret = channel.send(data)
return ret
except SaltReqTimeoutError:
log.... | [
"Send",
"mine",
"data",
"to",
"the",
"master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2380-L2393 | [
"def",
"_mine_send",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"channel",
"=",
"salt",
".",
"transport",
".",
"client",
".",
"ReqChannel",
".",
"factory",
"(",
"self",
".",
"opts",
")",
"data",
"[",
"'tok'",
"]",
"=",
"self",
".",
"tok",
"try... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_module_refresh | Handle a module_refresh event | salt/minion.py | def _handle_tag_module_refresh(self, tag, data):
'''
Handle a module_refresh event
'''
self.module_refresh(
force_refresh=data.get('force_refresh', False),
notify=data.get('notify', False)
) | def _handle_tag_module_refresh(self, tag, data):
'''
Handle a module_refresh event
'''
self.module_refresh(
force_refresh=data.get('force_refresh', False),
notify=data.get('notify', False)
) | [
"Handle",
"a",
"module_refresh",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2395-L2402 | [
"def",
"_handle_tag_module_refresh",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"self",
".",
"module_refresh",
"(",
"force_refresh",
"=",
"data",
".",
"get",
"(",
"'force_refresh'",
",",
"False",
")",
",",
"notify",
"=",
"data",
".",
"get",
"(",
"'n... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_pillar_refresh | Handle a pillar_refresh event | salt/minion.py | def _handle_tag_pillar_refresh(self, tag, data):
'''
Handle a pillar_refresh event
'''
yield self.pillar_refresh(
force_refresh=data.get('force_refresh', False),
notify=data.get('notify', False)
) | def _handle_tag_pillar_refresh(self, tag, data):
'''
Handle a pillar_refresh event
'''
yield self.pillar_refresh(
force_refresh=data.get('force_refresh', False),
notify=data.get('notify', False)
) | [
"Handle",
"a",
"pillar_refresh",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2405-L2412 | [
"def",
"_handle_tag_pillar_refresh",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"yield",
"self",
".",
"pillar_refresh",
"(",
"force_refresh",
"=",
"data",
".",
"get",
"(",
"'force_refresh'",
",",
"False",
")",
",",
"notify",
"=",
"data",
".",
"get",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_grains_refresh | Handle a grains_refresh event | salt/minion.py | def _handle_tag_grains_refresh(self, tag, data):
'''
Handle a grains_refresh event
'''
if (data.get('force_refresh', False) or
self.grains_cache != self.opts['grains']):
self.pillar_refresh(force_refresh=True)
self.grains_cache = self.opts['grains'... | def _handle_tag_grains_refresh(self, tag, data):
'''
Handle a grains_refresh event
'''
if (data.get('force_refresh', False) or
self.grains_cache != self.opts['grains']):
self.pillar_refresh(force_refresh=True)
self.grains_cache = self.opts['grains'... | [
"Handle",
"a",
"grains_refresh",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2438-L2445 | [
"def",
"_handle_tag_grains_refresh",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"if",
"(",
"data",
".",
"get",
"(",
"'force_refresh'",
",",
"False",
")",
"or",
"self",
".",
"grains_cache",
"!=",
"self",
".",
"opts",
"[",
"'grains'",
"]",
")",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_fire_master | Handle a fire_master event | salt/minion.py | def _handle_tag_fire_master(self, tag, data):
'''
Handle a fire_master event
'''
if self.connected:
log.debug('Forwarding master event tag=%s', data['tag'])
self._fire_master(data['data'], data['tag'], data['events'], data['pretag']) | def _handle_tag_fire_master(self, tag, data):
'''
Handle a fire_master event
'''
if self.connected:
log.debug('Forwarding master event tag=%s', data['tag'])
self._fire_master(data['data'], data['tag'], data['events'], data['pretag']) | [
"Handle",
"a",
"fire_master",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2459-L2465 | [
"def",
"_handle_tag_fire_master",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"if",
"self",
".",
"connected",
":",
"log",
".",
"debug",
"(",
"'Forwarding master event tag=%s'",
",",
"data",
"[",
"'tag'",
"]",
")",
"self",
".",
"_fire_master",
"(",
"dat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_master_disconnected_failback | Handle a master_disconnected_failback event | salt/minion.py | def _handle_tag_master_disconnected_failback(self, tag, data):
'''
Handle a master_disconnected_failback event
'''
# if the master disconnect event is for a different master, raise an exception
if tag.startswith(master_event(type='disconnected')) and data['master'] != self.opts['... | def _handle_tag_master_disconnected_failback(self, tag, data):
'''
Handle a master_disconnected_failback event
'''
# if the master disconnect event is for a different master, raise an exception
if tag.startswith(master_event(type='disconnected')) and data['master'] != self.opts['... | [
"Handle",
"a",
"master_disconnected_failback",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2467-L2581 | [
"def",
"_handle_tag_master_disconnected_failback",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"# if the master disconnect event is for a different master, raise an exception",
"if",
"tag",
".",
"startswith",
"(",
"master_event",
"(",
"type",
"=",
"'disconnected'",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_master_connected | Handle a master_connected event | salt/minion.py | def _handle_tag_master_connected(self, tag, data):
'''
Handle a master_connected event
'''
# handle this event only once. otherwise it will pollute the log
# also if master type is failover all the reconnection work is done
# by `disconnected` event handler and this event... | def _handle_tag_master_connected(self, tag, data):
'''
Handle a master_connected event
'''
# handle this event only once. otherwise it will pollute the log
# also if master type is failover all the reconnection work is done
# by `disconnected` event handler and this event... | [
"Handle",
"a",
"master_connected",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2583-L2611 | [
"def",
"_handle_tag_master_connected",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"# handle this event only once. otherwise it will pollute the log",
"# also if master type is failover all the reconnection work is done",
"# by `disconnected` event handler and this event must never happe... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_schedule_return | Handle a _schedule_return event | salt/minion.py | def _handle_tag_schedule_return(self, tag, data):
'''
Handle a _schedule_return event
'''
# reporting current connection with master
if data['schedule'].startswith(master_event(type='alive', master='')):
if data['return']:
log.debug(
... | def _handle_tag_schedule_return(self, tag, data):
'''
Handle a _schedule_return event
'''
# reporting current connection with master
if data['schedule'].startswith(master_event(type='alive', master='')):
if data['return']:
log.debug(
... | [
"Handle",
"a",
"_schedule_return",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2613-L2624 | [
"def",
"_handle_tag_schedule_return",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"# reporting current connection with master",
"if",
"data",
"[",
"'schedule'",
"]",
".",
"startswith",
"(",
"master_event",
"(",
"type",
"=",
"'alive'",
",",
"master",
"=",
"''... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_salt_error | Handle a _salt_error event | salt/minion.py | def _handle_tag_salt_error(self, tag, data):
'''
Handle a _salt_error event
'''
if self.connected:
log.debug('Forwarding salt error event tag=%s', tag)
self._fire_master(data, tag) | def _handle_tag_salt_error(self, tag, data):
'''
Handle a _salt_error event
'''
if self.connected:
log.debug('Forwarding salt error event tag=%s', tag)
self._fire_master(data, tag) | [
"Handle",
"a",
"_salt_error",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2626-L2632 | [
"def",
"_handle_tag_salt_error",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"if",
"self",
".",
"connected",
":",
"log",
".",
"debug",
"(",
"'Forwarding salt error event tag=%s'",
",",
"tag",
")",
"self",
".",
"_fire_master",
"(",
"data",
",",
"tag",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._handle_tag_salt_auth_creds | Handle a salt_auth_creds event | salt/minion.py | def _handle_tag_salt_auth_creds(self, tag, data):
'''
Handle a salt_auth_creds event
'''
key = tuple(data['key'])
log.debug(
'Updating auth data for %s: %s -> %s',
key, salt.crypt.AsyncAuth.creds_map.get(key), data['creds']
)
salt.crypt.Asy... | def _handle_tag_salt_auth_creds(self, tag, data):
'''
Handle a salt_auth_creds event
'''
key = tuple(data['key'])
log.debug(
'Updating auth data for %s: %s -> %s',
key, salt.crypt.AsyncAuth.creds_map.get(key), data['creds']
)
salt.crypt.Asy... | [
"Handle",
"a",
"salt_auth_creds",
"event"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2634-L2643 | [
"def",
"_handle_tag_salt_auth_creds",
"(",
"self",
",",
"tag",
",",
"data",
")",
":",
"key",
"=",
"tuple",
"(",
"data",
"[",
"'key'",
"]",
")",
"log",
".",
"debug",
"(",
"'Updating auth data for %s: %s -> %s'",
",",
"key",
",",
"salt",
".",
"crypt",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.handle_event | Handle an event from the epull_sock (all local minion events) | salt/minion.py | def handle_event(self, package):
'''
Handle an event from the epull_sock (all local minion events)
'''
if not self.ready:
raise tornado.gen.Return()
tag, data = salt.utils.event.SaltEvent.unpack(package)
log.debug(
'Minion of \'%s\' is handling eve... | def handle_event(self, package):
'''
Handle an event from the epull_sock (all local minion events)
'''
if not self.ready:
raise tornado.gen.Return()
tag, data = salt.utils.event.SaltEvent.unpack(package)
log.debug(
'Minion of \'%s\' is handling eve... | [
"Handle",
"an",
"event",
"from",
"the",
"epull_sock",
"(",
"all",
"local",
"minion",
"events",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2646-L2679 | [
"def",
"handle_event",
"(",
"self",
",",
"package",
")",
":",
"if",
"not",
"self",
".",
"ready",
":",
"raise",
"tornado",
".",
"gen",
".",
"Return",
"(",
")",
"tag",
",",
"data",
"=",
"salt",
".",
"utils",
".",
"event",
".",
"SaltEvent",
".",
"unpa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._fallback_cleanups | Fallback cleanup routines, attempting to fix leaked processes, threads, etc. | salt/minion.py | def _fallback_cleanups(self):
'''
Fallback cleanup routines, attempting to fix leaked processes, threads, etc.
'''
# Add an extra fallback in case a forked process leaks through
multiprocessing.active_children()
# Cleanup Windows threads
if not salt.utils.platfor... | def _fallback_cleanups(self):
'''
Fallback cleanup routines, attempting to fix leaked processes, threads, etc.
'''
# Add an extra fallback in case a forked process leaks through
multiprocessing.active_children()
# Cleanup Windows threads
if not salt.utils.platfor... | [
"Fallback",
"cleanup",
"routines",
"attempting",
"to",
"fix",
"leaked",
"processes",
"threads",
"etc",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2681-L2698 | [
"def",
"_fallback_cleanups",
"(",
"self",
")",
":",
"# Add an extra fallback in case a forked process leaks through",
"multiprocessing",
".",
"active_children",
"(",
")",
"# Cleanup Windows threads",
"if",
"not",
"salt",
".",
"utils",
".",
"platform",
".",
"is_windows",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion._setup_core | Set up the core minion attributes.
This is safe to call multiple times. | salt/minion.py | def _setup_core(self):
'''
Set up the core minion attributes.
This is safe to call multiple times.
'''
if not self.ready:
# First call. Initialize.
self.functions, self.returners, self.function_errors, self.executors = self._load_modules()
self... | def _setup_core(self):
'''
Set up the core minion attributes.
This is safe to call multiple times.
'''
if not self.ready:
# First call. Initialize.
self.functions, self.returners, self.function_errors, self.executors = self._load_modules()
self... | [
"Set",
"up",
"the",
"core",
"minion",
"attributes",
".",
"This",
"is",
"safe",
"to",
"call",
"multiple",
"times",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2700-L2716 | [
"def",
"_setup_core",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"ready",
":",
"# First call. Initialize.",
"self",
".",
"functions",
",",
"self",
".",
"returners",
",",
"self",
".",
"function_errors",
",",
"self",
".",
"executors",
"=",
"self",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.setup_beacons | Set up the beacons.
This is safe to call multiple times. | salt/minion.py | def setup_beacons(self, before_connect=False):
'''
Set up the beacons.
This is safe to call multiple times.
'''
self._setup_core()
loop_interval = self.opts['loop_interval']
new_periodic_callbacks = {}
if 'beacons' not in self.periodic_callbacks:
... | def setup_beacons(self, before_connect=False):
'''
Set up the beacons.
This is safe to call multiple times.
'''
self._setup_core()
loop_interval = self.opts['loop_interval']
new_periodic_callbacks = {}
if 'beacons' not in self.periodic_callbacks:
... | [
"Set",
"up",
"the",
"beacons",
".",
"This",
"is",
"safe",
"to",
"call",
"multiple",
"times",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2718-L2755 | [
"def",
"setup_beacons",
"(",
"self",
",",
"before_connect",
"=",
"False",
")",
":",
"self",
".",
"_setup_core",
"(",
")",
"loop_interval",
"=",
"self",
".",
"opts",
"[",
"'loop_interval'",
"]",
"new_periodic_callbacks",
"=",
"{",
"}",
"if",
"'beacons'",
"not... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.setup_scheduler | Set up the scheduler.
This is safe to call multiple times. | salt/minion.py | def setup_scheduler(self, before_connect=False):
'''
Set up the scheduler.
This is safe to call multiple times.
'''
self._setup_core()
loop_interval = self.opts['loop_interval']
new_periodic_callbacks = {}
if 'schedule' not in self.periodic_callbacks:
... | def setup_scheduler(self, before_connect=False):
'''
Set up the scheduler.
This is safe to call multiple times.
'''
self._setup_core()
loop_interval = self.opts['loop_interval']
new_periodic_callbacks = {}
if 'schedule' not in self.periodic_callbacks:
... | [
"Set",
"up",
"the",
"scheduler",
".",
"This",
"is",
"safe",
"to",
"call",
"multiple",
"times",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2757-L2808 | [
"def",
"setup_scheduler",
"(",
"self",
",",
"before_connect",
"=",
"False",
")",
":",
"self",
".",
"_setup_core",
"(",
")",
"loop_interval",
"=",
"self",
".",
"opts",
"[",
"'loop_interval'",
"]",
"new_periodic_callbacks",
"=",
"{",
"}",
"if",
"'schedule'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.tune_in | Lock onto the publisher. This is the main event loop for the minion
:rtype : None | salt/minion.py | def tune_in(self, start=True):
'''
Lock onto the publisher. This is the main event loop for the minion
:rtype : None
'''
self._pre_tune()
log.debug('Minion \'%s\' trying to tune in', self.opts['id'])
if start:
if self.opts.get('beacons_before_connect... | def tune_in(self, start=True):
'''
Lock onto the publisher. This is the main event loop for the minion
:rtype : None
'''
self._pre_tune()
log.debug('Minion \'%s\' trying to tune in', self.opts['id'])
if start:
if self.opts.get('beacons_before_connect... | [
"Lock",
"onto",
"the",
"publisher",
".",
"This",
"is",
"the",
"main",
"event",
"loop",
"for",
"the",
"minion",
":",
"rtype",
":",
"None"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2811-L2883 | [
"def",
"tune_in",
"(",
"self",
",",
"start",
"=",
"True",
")",
":",
"self",
".",
"_pre_tune",
"(",
")",
"log",
".",
"debug",
"(",
"'Minion \\'%s\\' trying to tune in'",
",",
"self",
".",
"opts",
"[",
"'id'",
"]",
")",
"if",
"start",
":",
"if",
"self",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Minion.destroy | Tear down the minion | salt/minion.py | def destroy(self):
'''
Tear down the minion
'''
if self._running is False:
return
self._running = False
if hasattr(self, 'schedule'):
del self.schedule
if hasattr(self, 'pub_channel') and self.pub_channel is not None:
self.pub_... | def destroy(self):
'''
Tear down the minion
'''
if self._running is False:
return
self._running = False
if hasattr(self, 'schedule'):
del self.schedule
if hasattr(self, 'pub_channel') and self.pub_channel is not None:
self.pub_... | [
"Tear",
"down",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2928-L2945 | [
"def",
"destroy",
"(",
"self",
")",
":",
"if",
"self",
".",
"_running",
"is",
"False",
":",
"return",
"self",
".",
"_running",
"=",
"False",
"if",
"hasattr",
"(",
"self",
",",
"'schedule'",
")",
":",
"del",
"self",
".",
"schedule",
"if",
"hasattr",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Syndic._handle_decoded_payload | Override this method if you wish to handle the decoded data
differently. | salt/minion.py | def _handle_decoded_payload(self, data):
'''
Override this method if you wish to handle the decoded data
differently.
'''
# TODO: even do this??
data['to'] = int(data.get('to', self.opts['timeout'])) - 1
# Only forward the command if it didn't originate from ourse... | def _handle_decoded_payload(self, data):
'''
Override this method if you wish to handle the decoded data
differently.
'''
# TODO: even do this??
data['to'] = int(data.get('to', self.opts['timeout'])) - 1
# Only forward the command if it didn't originate from ourse... | [
"Override",
"this",
"method",
"if",
"you",
"wish",
"to",
"handle",
"the",
"decoded",
"data",
"differently",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2969-L2978 | [
"def",
"_handle_decoded_payload",
"(",
"self",
",",
"data",
")",
":",
"# TODO: even do this??",
"data",
"[",
"'to'",
"]",
"=",
"int",
"(",
"data",
".",
"get",
"(",
"'to'",
",",
"self",
".",
"opts",
"[",
"'timeout'",
"]",
")",
")",
"-",
"1",
"# Only for... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Syndic.syndic_cmd | Take the now clear load and forward it on to the client cmd | salt/minion.py | def syndic_cmd(self, data):
'''
Take the now clear load and forward it on to the client cmd
'''
# Set up default tgt_type
if 'tgt_type' not in data:
data['tgt_type'] = 'glob'
kwargs = {}
# optionally add a few fields to the publish data
for fi... | def syndic_cmd(self, data):
'''
Take the now clear load and forward it on to the client cmd
'''
# Set up default tgt_type
if 'tgt_type' not in data:
data['tgt_type'] = 'glob'
kwargs = {}
# optionally add a few fields to the publish data
for fi... | [
"Take",
"the",
"now",
"clear",
"load",
"and",
"forward",
"it",
"on",
"to",
"the",
"client",
"cmd"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L2980-L3010 | [
"def",
"syndic_cmd",
"(",
"self",
",",
"data",
")",
":",
"# Set up default tgt_type",
"if",
"'tgt_type'",
"not",
"in",
"data",
":",
"data",
"[",
"'tgt_type'",
"]",
"=",
"'glob'",
"kwargs",
"=",
"{",
"}",
"# optionally add a few fields to the publish data",
"for",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Syndic.tune_in_no_block | Executes the tune_in sequence but omits extra logging and the
management of the event bus assuming that these are handled outside
the tune_in sequence | salt/minion.py | def tune_in_no_block(self):
'''
Executes the tune_in sequence but omits extra logging and the
management of the event bus assuming that these are handled outside
the tune_in sequence
'''
# Instantiate the local client
self.local = salt.client.get_local_client(
... | def tune_in_no_block(self):
'''
Executes the tune_in sequence but omits extra logging and the
management of the event bus assuming that these are handled outside
the tune_in sequence
'''
# Instantiate the local client
self.local = salt.client.get_local_client(
... | [
"Executes",
"the",
"tune_in",
"sequence",
"but",
"omits",
"extra",
"logging",
"and",
"the",
"management",
"of",
"the",
"event",
"bus",
"assuming",
"that",
"these",
"are",
"handled",
"outside",
"the",
"tune_in",
"sequence"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3034-L3045 | [
"def",
"tune_in_no_block",
"(",
"self",
")",
":",
"# Instantiate the local client",
"self",
".",
"local",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"self",
".",
"opts",
"[",
"'_minion_conf_file'",
"]",
",",
"io_loop",
"=",
"self",
".",
"io_loop... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | Syndic.destroy | Tear down the syndic minion | salt/minion.py | def destroy(self):
'''
Tear down the syndic minion
'''
# We borrowed the local clients poller so give it back before
# it's destroyed. Reset the local poller reference.
super(Syndic, self).destroy()
if hasattr(self, 'local'):
del self.local
if... | def destroy(self):
'''
Tear down the syndic minion
'''
# We borrowed the local clients poller so give it back before
# it's destroyed. Reset the local poller reference.
super(Syndic, self).destroy()
if hasattr(self, 'local'):
del self.local
if... | [
"Tear",
"down",
"the",
"syndic",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3074-L3085 | [
"def",
"destroy",
"(",
"self",
")",
":",
"# We borrowed the local clients poller so give it back before",
"# it's destroyed. Reset the local poller reference.",
"super",
"(",
"Syndic",
",",
"self",
")",
".",
"destroy",
"(",
")",
"if",
"hasattr",
"(",
"self",
",",
"'loca... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SyndicManager._spawn_syndics | Spawn all the coroutines which will sign in the syndics | salt/minion.py | def _spawn_syndics(self):
'''
Spawn all the coroutines which will sign in the syndics
'''
self._syndics = OrderedDict() # mapping of opts['master'] -> syndic
masters = self.opts['master']
if not isinstance(masters, list):
masters = [masters]
for maste... | def _spawn_syndics(self):
'''
Spawn all the coroutines which will sign in the syndics
'''
self._syndics = OrderedDict() # mapping of opts['master'] -> syndic
masters = self.opts['master']
if not isinstance(masters, list):
masters = [masters]
for maste... | [
"Spawn",
"all",
"the",
"coroutines",
"which",
"will",
"sign",
"in",
"the",
"syndics"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3142-L3153 | [
"def",
"_spawn_syndics",
"(",
"self",
")",
":",
"self",
".",
"_syndics",
"=",
"OrderedDict",
"(",
")",
"# mapping of opts['master'] -> syndic",
"masters",
"=",
"self",
".",
"opts",
"[",
"'master'",
"]",
"if",
"not",
"isinstance",
"(",
"masters",
",",
"list",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SyndicManager._connect_syndic | Create a syndic, and asynchronously connect it to a master | salt/minion.py | def _connect_syndic(self, opts):
'''
Create a syndic, and asynchronously connect it to a master
'''
auth_wait = opts['acceptance_wait_time']
failed = False
while True:
if failed:
if auth_wait < self.max_auth_wait:
auth_wait ... | def _connect_syndic(self, opts):
'''
Create a syndic, and asynchronously connect it to a master
'''
auth_wait = opts['acceptance_wait_time']
failed = False
while True:
if failed:
if auth_wait < self.max_auth_wait:
auth_wait ... | [
"Create",
"a",
"syndic",
"and",
"asynchronously",
"connect",
"it",
"to",
"a",
"master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3156-L3210 | [
"def",
"_connect_syndic",
"(",
"self",
",",
"opts",
")",
":",
"auth_wait",
"=",
"opts",
"[",
"'acceptance_wait_time'",
"]",
"failed",
"=",
"False",
"while",
"True",
":",
"if",
"failed",
":",
"if",
"auth_wait",
"<",
"self",
".",
"max_auth_wait",
":",
"auth_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SyndicManager._mark_master_dead | Mark a master as dead. This will start the sign-in routine | salt/minion.py | def _mark_master_dead(self, master):
'''
Mark a master as dead. This will start the sign-in routine
'''
# if its connected, mark it dead
if self._syndics[master].done():
syndic = self._syndics[master].result() # pylint: disable=no-member
self._syndics[mas... | def _mark_master_dead(self, master):
'''
Mark a master as dead. This will start the sign-in routine
'''
# if its connected, mark it dead
if self._syndics[master].done():
syndic = self._syndics[master].result() # pylint: disable=no-member
self._syndics[mas... | [
"Mark",
"a",
"master",
"as",
"dead",
".",
"This",
"will",
"start",
"the",
"sign",
"-",
"in",
"routine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3212-L3225 | [
"def",
"_mark_master_dead",
"(",
"self",
",",
"master",
")",
":",
"# if its connected, mark it dead",
"if",
"self",
".",
"_syndics",
"[",
"master",
"]",
".",
"done",
"(",
")",
":",
"syndic",
"=",
"self",
".",
"_syndics",
"[",
"master",
"]",
".",
"result",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SyndicManager._call_syndic | Wrapper to call a given func on a syndic, best effort to get the one you asked for | salt/minion.py | def _call_syndic(self, func, args=(), kwargs=None, master_id=None):
'''
Wrapper to call a given func on a syndic, best effort to get the one you asked for
'''
if kwargs is None:
kwargs = {}
successful = False
# Call for each master
for master, syndic_f... | def _call_syndic(self, func, args=(), kwargs=None, master_id=None):
'''
Wrapper to call a given func on a syndic, best effort to get the one you asked for
'''
if kwargs is None:
kwargs = {}
successful = False
# Call for each master
for master, syndic_f... | [
"Wrapper",
"to",
"call",
"a",
"given",
"func",
"on",
"a",
"syndic",
"best",
"effort",
"to",
"get",
"the",
"one",
"you",
"asked",
"for"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3227-L3253 | [
"def",
"_call_syndic",
"(",
"self",
",",
"func",
",",
"args",
"=",
"(",
")",
",",
"kwargs",
"=",
"None",
",",
"master_id",
"=",
"None",
")",
":",
"if",
"kwargs",
"is",
"None",
":",
"kwargs",
"=",
"{",
"}",
"successful",
"=",
"False",
"# Call for each... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SyndicManager._return_pub_syndic | Wrapper to call the '_return_pub_multi' a syndic, best effort to get the one you asked for | salt/minion.py | def _return_pub_syndic(self, values, master_id=None):
'''
Wrapper to call the '_return_pub_multi' a syndic, best effort to get the one you asked for
'''
func = '_return_pub_multi'
for master, syndic_future in self.iter_master_options(master_id):
if not syndic_future.d... | def _return_pub_syndic(self, values, master_id=None):
'''
Wrapper to call the '_return_pub_multi' a syndic, best effort to get the one you asked for
'''
func = '_return_pub_multi'
for master, syndic_future in self.iter_master_options(master_id):
if not syndic_future.d... | [
"Wrapper",
"to",
"call",
"the",
"_return_pub_multi",
"a",
"syndic",
"best",
"effort",
"to",
"get",
"the",
"one",
"you",
"asked",
"for"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3255-L3295 | [
"def",
"_return_pub_syndic",
"(",
"self",
",",
"values",
",",
"master_id",
"=",
"None",
")",
":",
"func",
"=",
"'_return_pub_multi'",
"for",
"master",
",",
"syndic_future",
"in",
"self",
".",
"iter_master_options",
"(",
"master_id",
")",
":",
"if",
"not",
"s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SyndicManager.iter_master_options | Iterate (in order) over your options for master | salt/minion.py | def iter_master_options(self, master_id=None):
'''
Iterate (in order) over your options for master
'''
masters = list(self._syndics.keys())
if self.opts['syndic_failover'] == 'random':
shuffle(masters)
if master_id not in self._syndics:
master_id =... | def iter_master_options(self, master_id=None):
'''
Iterate (in order) over your options for master
'''
masters = list(self._syndics.keys())
if self.opts['syndic_failover'] == 'random':
shuffle(masters)
if master_id not in self._syndics:
master_id =... | [
"Iterate",
"(",
"in",
"order",
")",
"over",
"your",
"options",
"for",
"master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3297-L3313 | [
"def",
"iter_master_options",
"(",
"self",
",",
"master_id",
"=",
"None",
")",
":",
"masters",
"=",
"list",
"(",
"self",
".",
"_syndics",
".",
"keys",
"(",
")",
")",
"if",
"self",
".",
"opts",
"[",
"'syndic_failover'",
"]",
"==",
"'random'",
":",
"shuf... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SyndicManager.tune_in | Lock onto the publisher. This is the main event loop for the syndic | salt/minion.py | def tune_in(self):
'''
Lock onto the publisher. This is the main event loop for the syndic
'''
self._spawn_syndics()
# Instantiate the local client
self.local = salt.client.get_local_client(
self.opts['_minion_conf_file'], io_loop=self.io_loop)
self.lo... | def tune_in(self):
'''
Lock onto the publisher. This is the main event loop for the syndic
'''
self._spawn_syndics()
# Instantiate the local client
self.local = salt.client.get_local_client(
self.opts['_minion_conf_file'], io_loop=self.io_loop)
self.lo... | [
"Lock",
"onto",
"the",
"publisher",
".",
"This",
"is",
"the",
"main",
"event",
"loop",
"for",
"the",
"syndic"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3324-L3352 | [
"def",
"tune_in",
"(",
"self",
")",
":",
"self",
".",
"_spawn_syndics",
"(",
")",
"# Instantiate the local client",
"self",
".",
"local",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"self",
".",
"opts",
"[",
"'_minion_conf_file'",
"]",
",",
"io... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ProxyMinion._post_master_init | Function to finish init after connecting to a master
This is primarily loading modules, pillars, etc. (since they need
to know which master they connected to)
If this function is changed, please check Minion._post_master_init
to see if those changes need to be propagated.
Prox... | salt/minion.py | def _post_master_init(self, master):
'''
Function to finish init after connecting to a master
This is primarily loading modules, pillars, etc. (since they need
to know which master they connected to)
If this function is changed, please check Minion._post_master_init
to ... | def _post_master_init(self, master):
'''
Function to finish init after connecting to a master
This is primarily loading modules, pillars, etc. (since they need
to know which master they connected to)
If this function is changed, please check Minion._post_master_init
to ... | [
"Function",
"to",
"finish",
"init",
"after",
"connecting",
"to",
"a",
"master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3471-L3486 | [
"def",
"_post_master_init",
"(",
"self",
",",
"master",
")",
":",
"mp_call",
"=",
"_metaproxy_call",
"(",
"self",
".",
"opts",
",",
"'post_master_init'",
")",
"return",
"mp_call",
"(",
"self",
",",
"master",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ProxyMinion._target_load | Verify that the publication is valid and applies to this minion | salt/minion.py | def _target_load(self, load):
'''
Verify that the publication is valid and applies to this minion
'''
mp_call = _metaproxy_call(self.opts, 'target_load')
return mp_call(self, load) | def _target_load(self, load):
'''
Verify that the publication is valid and applies to this minion
'''
mp_call = _metaproxy_call(self.opts, 'target_load')
return mp_call(self, load) | [
"Verify",
"that",
"the",
"publication",
"is",
"valid",
"and",
"applies",
"to",
"this",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3488-L3493 | [
"def",
"_target_load",
"(",
"self",
",",
"load",
")",
":",
"mp_call",
"=",
"_metaproxy_call",
"(",
"self",
".",
"opts",
",",
"'target_load'",
")",
"return",
"mp_call",
"(",
"self",
",",
"load",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SProxyMinion.gen_modules | Tell the minion to reload the execution modules
CLI Example:
.. code-block:: bash
salt '*' sys.reload_modules | salt/minion.py | def gen_modules(self, initial_load=False):
'''
Tell the minion to reload the execution modules
CLI Example:
.. code-block:: bash
salt '*' sys.reload_modules
'''
self.opts['grains'] = salt.loader.grains(self.opts)
self.opts['pillar'] = salt.pillar.ge... | def gen_modules(self, initial_load=False):
'''
Tell the minion to reload the execution modules
CLI Example:
.. code-block:: bash
salt '*' sys.reload_modules
'''
self.opts['grains'] = salt.loader.grains(self.opts)
self.opts['pillar'] = salt.pillar.ge... | [
"Tell",
"the",
"minion",
"to",
"reload",
"the",
"execution",
"modules"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/minion.py#L3528-L3607 | [
"def",
"gen_modules",
"(",
"self",
",",
"initial_load",
"=",
"False",
")",
":",
"self",
".",
"opts",
"[",
"'grains'",
"]",
"=",
"salt",
".",
"loader",
".",
"grains",
"(",
"self",
".",
"opts",
")",
"self",
".",
"opts",
"[",
"'pillar'",
"]",
"=",
"sa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_comparison_spec | Return a tuple containing the comparison operator and the version. If no
comparison operator was passed, the comparison is assumed to be an "equals"
comparison, and "==" will be the operator returned. | salt/states/pkg.py | def _get_comparison_spec(pkgver):
'''
Return a tuple containing the comparison operator and the version. If no
comparison operator was passed, the comparison is assumed to be an "equals"
comparison, and "==" will be the operator returned.
'''
oper, verstr = salt.utils.pkg.split_comparison(pkgver... | def _get_comparison_spec(pkgver):
'''
Return a tuple containing the comparison operator and the version. If no
comparison operator was passed, the comparison is assumed to be an "equals"
comparison, and "==" will be the operator returned.
'''
oper, verstr = salt.utils.pkg.split_comparison(pkgver... | [
"Return",
"a",
"tuple",
"containing",
"the",
"comparison",
"operator",
"and",
"the",
"version",
".",
"If",
"no",
"comparison",
"operator",
"was",
"passed",
"the",
"comparison",
"is",
"assumed",
"to",
"be",
"an",
"equals",
"comparison",
"and",
"==",
"will",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L153-L162 | [
"def",
"_get_comparison_spec",
"(",
"pkgver",
")",
":",
"oper",
",",
"verstr",
"=",
"salt",
".",
"utils",
".",
"pkg",
".",
"split_comparison",
"(",
"pkgver",
".",
"strip",
"(",
")",
")",
"if",
"oper",
"in",
"(",
"'='",
",",
"''",
")",
":",
"oper",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_version_string | Returns a list of two-tuples containing (operator, version). | salt/states/pkg.py | def _parse_version_string(version_conditions_string):
'''
Returns a list of two-tuples containing (operator, version).
'''
result = []
version_conditions_string = version_conditions_string.strip()
if not version_conditions_string:
return result
for version_condition in version_condit... | def _parse_version_string(version_conditions_string):
'''
Returns a list of two-tuples containing (operator, version).
'''
result = []
version_conditions_string = version_conditions_string.strip()
if not version_conditions_string:
return result
for version_condition in version_condit... | [
"Returns",
"a",
"list",
"of",
"two",
"-",
"tuples",
"containing",
"(",
"operator",
"version",
")",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L165-L176 | [
"def",
"_parse_version_string",
"(",
"version_conditions_string",
")",
":",
"result",
"=",
"[",
"]",
"version_conditions_string",
"=",
"version_conditions_string",
".",
"strip",
"(",
")",
"if",
"not",
"version_conditions_string",
":",
"return",
"result",
"for",
"versi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _fulfills_version_string | Returns True if any of the installed versions match the specified version conditions,
otherwise returns False.
installed_versions
The installed versions
version_conditions_string
The string containing all version conditions. E.G.
1.2.3-4
>=1.2.3-4
>=1.2.3-4, <2.3.4-... | salt/states/pkg.py | def _fulfills_version_string(installed_versions, version_conditions_string, ignore_epoch=False, allow_updates=False):
'''
Returns True if any of the installed versions match the specified version conditions,
otherwise returns False.
installed_versions
The installed versions
version_conditi... | def _fulfills_version_string(installed_versions, version_conditions_string, ignore_epoch=False, allow_updates=False):
'''
Returns True if any of the installed versions match the specified version conditions,
otherwise returns False.
installed_versions
The installed versions
version_conditi... | [
"Returns",
"True",
"if",
"any",
"of",
"the",
"installed",
"versions",
"match",
"the",
"specified",
"version",
"conditions",
"otherwise",
"returns",
"False",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L179-L215 | [
"def",
"_fulfills_version_string",
"(",
"installed_versions",
",",
"version_conditions_string",
",",
"ignore_epoch",
"=",
"False",
",",
"allow_updates",
"=",
"False",
")",
":",
"version_conditions",
"=",
"_parse_version_string",
"(",
"version_conditions_string",
")",
"for... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _fulfills_version_spec | Returns True if any of the installed versions match the specified version,
otherwise returns False | salt/states/pkg.py | def _fulfills_version_spec(versions, oper, desired_version,
ignore_epoch=False):
'''
Returns True if any of the installed versions match the specified version,
otherwise returns False
'''
cmp_func = __salt__.get('pkg.version_cmp')
# stripping "with_origin" dict wrapper... | def _fulfills_version_spec(versions, oper, desired_version,
ignore_epoch=False):
'''
Returns True if any of the installed versions match the specified version,
otherwise returns False
'''
cmp_func = __salt__.get('pkg.version_cmp')
# stripping "with_origin" dict wrapper... | [
"Returns",
"True",
"if",
"any",
"of",
"the",
"installed",
"versions",
"match",
"the",
"specified",
"version",
"otherwise",
"returns",
"False"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L218-L237 | [
"def",
"_fulfills_version_spec",
"(",
"versions",
",",
"oper",
",",
"desired_version",
",",
"ignore_epoch",
"=",
"False",
")",
":",
"cmp_func",
"=",
"__salt__",
".",
"get",
"(",
"'pkg.version_cmp'",
")",
"# stripping \"with_origin\" dict wrapper",
"if",
"salt",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_unpurge_targets | Find packages which are marked to be purged but can't yet be removed
because they are dependencies for other installed packages. These are the
packages which will need to be 'unpurged' because they are part of
pkg.installed states. This really just applies to Debian-based Linuxes. | salt/states/pkg.py | def _find_unpurge_targets(desired, **kwargs):
'''
Find packages which are marked to be purged but can't yet be removed
because they are dependencies for other installed packages. These are the
packages which will need to be 'unpurged' because they are part of
pkg.installed states. This really just a... | def _find_unpurge_targets(desired, **kwargs):
'''
Find packages which are marked to be purged but can't yet be removed
because they are dependencies for other installed packages. These are the
packages which will need to be 'unpurged' because they are part of
pkg.installed states. This really just a... | [
"Find",
"packages",
"which",
"are",
"marked",
"to",
"be",
"purged",
"but",
"can",
"t",
"yet",
"be",
"removed",
"because",
"they",
"are",
"dependencies",
"for",
"other",
"installed",
"packages",
".",
"These",
"are",
"the",
"packages",
"which",
"will",
"need",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L240-L250 | [
"def",
"_find_unpurge_targets",
"(",
"desired",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"[",
"x",
"for",
"x",
"in",
"desired",
"if",
"x",
"in",
"__salt__",
"[",
"'pkg.list_pkgs'",
"]",
"(",
"purge_desired",
"=",
"True",
",",
"*",
"*",
"kwargs",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_download_targets | Inspect the arguments to pkg.downloaded and discover what packages need to
be downloaded. Return a dict of packages to download. | salt/states/pkg.py | def _find_download_targets(name=None,
version=None,
pkgs=None,
normalize=True,
skip_suggestions=False,
ignore_epoch=False,
**kwargs):
'''
Inspect the ... | def _find_download_targets(name=None,
version=None,
pkgs=None,
normalize=True,
skip_suggestions=False,
ignore_epoch=False,
**kwargs):
'''
Inspect the ... | [
"Inspect",
"the",
"arguments",
"to",
"pkg",
".",
"downloaded",
"and",
"discover",
"what",
"packages",
"need",
"to",
"be",
"downloaded",
".",
"Return",
"a",
"dict",
"of",
"packages",
"to",
"download",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L253-L372 | [
"def",
"_find_download_targets",
"(",
"name",
"=",
"None",
",",
"version",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"normalize",
"=",
"True",
",",
"skip_suggestions",
"=",
"False",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_advisory_targets | Inspect the arguments to pkg.patch_installed and discover what advisory
patches need to be installed. Return a dict of advisory patches to install. | salt/states/pkg.py | def _find_advisory_targets(name=None,
advisory_ids=None,
**kwargs):
'''
Inspect the arguments to pkg.patch_installed and discover what advisory
patches need to be installed. Return a dict of advisory patches to install.
'''
cur_patches = __salt__... | def _find_advisory_targets(name=None,
advisory_ids=None,
**kwargs):
'''
Inspect the arguments to pkg.patch_installed and discover what advisory
patches need to be installed. Return a dict of advisory patches to install.
'''
cur_patches = __salt__... | [
"Inspect",
"the",
"arguments",
"to",
"pkg",
".",
"patch_installed",
"and",
"discover",
"what",
"advisory",
"patches",
"need",
"to",
"be",
"installed",
".",
"Return",
"a",
"dict",
"of",
"advisory",
"patches",
"to",
"install",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L375-L412 | [
"def",
"_find_advisory_targets",
"(",
"name",
"=",
"None",
",",
"advisory_ids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cur_patches",
"=",
"__salt__",
"[",
"'pkg.list_installed_patches'",
"]",
"(",
"*",
"*",
"kwargs",
")",
"if",
"advisory_ids",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_remove_targets | Inspect the arguments to pkg.removed and discover what packages need to
be removed. Return a dict of packages to remove. | salt/states/pkg.py | def _find_remove_targets(name=None,
version=None,
pkgs=None,
normalize=True,
ignore_epoch=False,
**kwargs):
'''
Inspect the arguments to pkg.removed and discover what packages need to
... | def _find_remove_targets(name=None,
version=None,
pkgs=None,
normalize=True,
ignore_epoch=False,
**kwargs):
'''
Inspect the arguments to pkg.removed and discover what packages need to
... | [
"Inspect",
"the",
"arguments",
"to",
"pkg",
".",
"removed",
"and",
"discover",
"what",
"packages",
"need",
"to",
"be",
"removed",
".",
"Return",
"a",
"dict",
"of",
"packages",
"to",
"remove",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L415-L493 | [
"def",
"_find_remove_targets",
"(",
"name",
"=",
"None",
",",
"version",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"normalize",
"=",
"True",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"__grains__",
"[",
"'os'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_install_targets | Inspect the arguments to pkg.installed and discover what packages need to
be installed. Return a dict of desired packages | salt/states/pkg.py | def _find_install_targets(name=None,
version=None,
pkgs=None,
sources=None,
skip_suggestions=False,
pkg_verify=False,
normalize=True,
igno... | def _find_install_targets(name=None,
version=None,
pkgs=None,
sources=None,
skip_suggestions=False,
pkg_verify=False,
normalize=True,
igno... | [
"Inspect",
"the",
"arguments",
"to",
"pkg",
".",
"installed",
"and",
"discover",
"what",
"packages",
"need",
"to",
"be",
"installed",
".",
"Return",
"a",
"dict",
"of",
"desired",
"packages"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L496-L837 | [
"def",
"_find_install_targets",
"(",
"name",
"=",
"None",
",",
"version",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
",",
"skip_suggestions",
"=",
"False",
",",
"pkg_verify",
"=",
"False",
",",
"normalize",
"=",
"True",
",",
"ign... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _verify_install | Determine whether or not the installed packages match what was requested in
the SLS file. | salt/states/pkg.py | def _verify_install(desired, new_pkgs, ignore_epoch=False, new_caps=None):
'''
Determine whether or not the installed packages match what was requested in
the SLS file.
'''
ok = []
failed = []
if not new_caps:
new_caps = dict()
for pkgname, pkgver in desired.items():
# Fr... | def _verify_install(desired, new_pkgs, ignore_epoch=False, new_caps=None):
'''
Determine whether or not the installed packages match what was requested in
the SLS file.
'''
ok = []
failed = []
if not new_caps:
new_caps = dict()
for pkgname, pkgver in desired.items():
# Fr... | [
"Determine",
"whether",
"or",
"not",
"the",
"installed",
"packages",
"match",
"what",
"was",
"requested",
"in",
"the",
"SLS",
"file",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L840-L884 | [
"def",
"_verify_install",
"(",
"desired",
",",
"new_pkgs",
",",
"ignore_epoch",
"=",
"False",
",",
"new_caps",
"=",
"None",
")",
":",
"ok",
"=",
"[",
"]",
"failed",
"=",
"[",
"]",
"if",
"not",
"new_caps",
":",
"new_caps",
"=",
"dict",
"(",
")",
"for"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_desired_pkg | Helper function that retrieves and nicely formats the desired pkg (and
version if specified) so that helpful information can be printed in the
comment for the state. | salt/states/pkg.py | def _get_desired_pkg(name, desired):
'''
Helper function that retrieves and nicely formats the desired pkg (and
version if specified) so that helpful information can be printed in the
comment for the state.
'''
if not desired[name] or desired[name].startswith(('<', '>', '=')):
oper = ''
... | def _get_desired_pkg(name, desired):
'''
Helper function that retrieves and nicely formats the desired pkg (and
version if specified) so that helpful information can be printed in the
comment for the state.
'''
if not desired[name] or desired[name].startswith(('<', '>', '=')):
oper = ''
... | [
"Helper",
"function",
"that",
"retrieves",
"and",
"nicely",
"formats",
"the",
"desired",
"pkg",
"(",
"and",
"version",
"if",
"specified",
")",
"so",
"that",
"helpful",
"information",
"can",
"be",
"printed",
"in",
"the",
"comment",
"for",
"the",
"state",
"."
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L887-L898 | [
"def",
"_get_desired_pkg",
"(",
"name",
",",
"desired",
")",
":",
"if",
"not",
"desired",
"[",
"name",
"]",
"or",
"desired",
"[",
"name",
"]",
".",
"startswith",
"(",
"(",
"'<'",
",",
"'>'",
",",
"'='",
")",
")",
":",
"oper",
"=",
"''",
"else",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _preflight_check | Perform platform-specific checks on desired packages | salt/states/pkg.py | def _preflight_check(desired, fromrepo, **kwargs):
'''
Perform platform-specific checks on desired packages
'''
if 'pkg.check_db' not in __salt__:
return {}
ret = {'suggest': {}, 'no_suggest': []}
pkginfo = __salt__['pkg.check_db'](
*list(desired.keys()), fromrepo=fromrepo, **kwa... | def _preflight_check(desired, fromrepo, **kwargs):
'''
Perform platform-specific checks on desired packages
'''
if 'pkg.check_db' not in __salt__:
return {}
ret = {'suggest': {}, 'no_suggest': []}
pkginfo = __salt__['pkg.check_db'](
*list(desired.keys()), fromrepo=fromrepo, **kwa... | [
"Perform",
"platform",
"-",
"specific",
"checks",
"on",
"desired",
"packages"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L901-L917 | [
"def",
"_preflight_check",
"(",
"desired",
",",
"fromrepo",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'pkg.check_db'",
"not",
"in",
"__salt__",
":",
"return",
"{",
"}",
"ret",
"=",
"{",
"'suggest'",
":",
"{",
"}",
",",
"'no_suggest'",
":",
"[",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _nested_output | Serialize obj and format for output | salt/states/pkg.py | def _nested_output(obj):
'''
Serialize obj and format for output
'''
nested.__opts__ = __opts__
ret = nested.output(obj).rstrip()
return ret | def _nested_output(obj):
'''
Serialize obj and format for output
'''
nested.__opts__ = __opts__
ret = nested.output(obj).rstrip()
return ret | [
"Serialize",
"obj",
"and",
"format",
"for",
"output"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L920-L926 | [
"def",
"_nested_output",
"(",
"obj",
")",
":",
"nested",
".",
"__opts__",
"=",
"__opts__",
"ret",
"=",
"nested",
".",
"output",
"(",
"obj",
")",
".",
"rstrip",
"(",
")",
"return",
"ret"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _resolve_capabilities | Resolve capabilities in ``pkgs`` and exchange them with real package
names, when the result is distinct.
This feature can be turned on while setting the paramter
``resolve_capabilities`` to True.
Return the input dictionary with replaced capability names and as
second return value a bool which say ... | salt/states/pkg.py | def _resolve_capabilities(pkgs, refresh=False, **kwargs):
'''
Resolve capabilities in ``pkgs`` and exchange them with real package
names, when the result is distinct.
This feature can be turned on while setting the paramter
``resolve_capabilities`` to True.
Return the input dictionary with repl... | def _resolve_capabilities(pkgs, refresh=False, **kwargs):
'''
Resolve capabilities in ``pkgs`` and exchange them with real package
names, when the result is distinct.
This feature can be turned on while setting the paramter
``resolve_capabilities`` to True.
Return the input dictionary with repl... | [
"Resolve",
"capabilities",
"in",
"pkgs",
"and",
"exchange",
"them",
"with",
"real",
"package",
"names",
"when",
"the",
"result",
"is",
"distinct",
".",
"This",
"feature",
"can",
"be",
"turned",
"on",
"while",
"setting",
"the",
"paramter",
"resolve_capabilities",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L929-L946 | [
"def",
"_resolve_capabilities",
"(",
"pkgs",
",",
"refresh",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"pkgs",
"or",
"'pkg.resolve_capabilities'",
"not",
"in",
"__salt__",
":",
"return",
"pkgs",
",",
"refresh",
"ret",
"=",
"__salt__",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | installed | Ensure that the package is installed, and that it is the correct version
(if specified).
:param str name:
The name of the package to be installed. This parameter is ignored if
either "pkgs" or "sources" is used. Additionally, please note that this
option can only be used to install pack... | salt/states/pkg.py | def installed(
name,
version=None,
refresh=None,
fromrepo=None,
skip_verify=False,
skip_suggestions=False,
pkgs=None,
sources=None,
allow_updates=False,
pkg_verify=False,
normalize=True,
ignore_epoch=False,
reinstall... | def installed(
name,
version=None,
refresh=None,
fromrepo=None,
skip_verify=False,
skip_suggestions=False,
pkgs=None,
sources=None,
allow_updates=False,
pkg_verify=False,
normalize=True,
ignore_epoch=False,
reinstall... | [
"Ensure",
"that",
"the",
"package",
"is",
"installed",
"and",
"that",
"it",
"is",
"the",
"correct",
"version",
"(",
"if",
"specified",
")",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L949-L2023 | [
"def",
"installed",
"(",
"name",
",",
"version",
"=",
"None",
",",
"refresh",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"skip_verify",
"=",
"False",
",",
"skip_suggestions",
"=",
"False",
",",
"pkgs",
"=",
"None",
",",
"sources",
"=",
"None",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | downloaded | .. versionadded:: 2017.7.0
Ensure that the package is downloaded, and that it is the correct version
(if specified).
Currently supported for the following pkg providers:
:mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`
:param str name:
The name of the package to... | salt/states/pkg.py | def downloaded(name,
version=None,
pkgs=None,
fromrepo=None,
ignore_epoch=None,
**kwargs):
'''
.. versionadded:: 2017.7.0
Ensure that the package is downloaded, and that it is the correct version
(if specified).
Currently s... | def downloaded(name,
version=None,
pkgs=None,
fromrepo=None,
ignore_epoch=None,
**kwargs):
'''
.. versionadded:: 2017.7.0
Ensure that the package is downloaded, and that it is the correct version
(if specified).
Currently s... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L2026-L2181 | [
"def",
"downloaded",
"(",
"name",
",",
"version",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"fromrepo",
"=",
"None",
",",
"ignore_epoch",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | patch_installed | .. versionadded:: 2017.7.0
Ensure that packages related to certain advisory ids are installed.
Currently supported for the following pkg providers:
:mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`
CLI Example:
.. code-block:: yaml
issue-foo-fixed:
pk... | salt/states/pkg.py | def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs):
'''
.. versionadded:: 2017.7.0
Ensure that packages related to certain advisory ids are installed.
Currently supported for the following pkg providers:
:mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypp... | def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs):
'''
.. versionadded:: 2017.7.0
Ensure that packages related to certain advisory ids are installed.
Currently supported for the following pkg providers:
:mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypp... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L2184-L2261 | [
"def",
"patch_installed",
"(",
"name",
",",
"advisory_ids",
"=",
"None",
",",
"downloadonly",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | patch_downloaded | .. versionadded:: 2017.7.0
Ensure that packages related to certain advisory ids are downloaded.
Currently supported for the following pkg providers:
:mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`
CLI Example:
.. code-block:: yaml
preparing-to-fix-issues:
... | salt/states/pkg.py | def patch_downloaded(name, advisory_ids=None, **kwargs):
'''
.. versionadded:: 2017.7.0
Ensure that packages related to certain advisory ids are downloaded.
Currently supported for the following pkg providers:
:mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`
CLI Exa... | def patch_downloaded(name, advisory_ids=None, **kwargs):
'''
.. versionadded:: 2017.7.0
Ensure that packages related to certain advisory ids are downloaded.
Currently supported for the following pkg providers:
:mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`
CLI Exa... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L2264-L2295 | [
"def",
"patch_downloaded",
"(",
"name",
",",
"advisory_ids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'pkg.list_patches'",
"not",
"in",
"__salt__",
":",
"return",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'changes'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _uninstall | Common function for package removal | salt/states/pkg.py | def _uninstall(
action='remove',
name=None,
version=None,
pkgs=None,
normalize=True,
ignore_epoch=False,
**kwargs):
'''
Common function for package removal
'''
if action not in ('remove', 'purge'):
return {'name': name,
'changes': {},
'... | def _uninstall(
action='remove',
name=None,
version=None,
pkgs=None,
normalize=True,
ignore_epoch=False,
**kwargs):
'''
Common function for package removal
'''
if action not in ('remove', 'purge'):
return {'name': name,
'changes': {},
'... | [
"Common",
"function",
"for",
"package",
"removal"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L2666-L2767 | [
"def",
"_uninstall",
"(",
"action",
"=",
"'remove'",
",",
"name",
"=",
"None",
",",
"version",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"normalize",
"=",
"True",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"action",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | purged | Verify that a package is not installed, calling ``pkg.purge`` if necessary
to purge the package. All configuration files are also removed.
name
The name of the package to be purged.
version
The version of the package that should be removed. Don't do anything if
the package is insta... | salt/states/pkg.py | def purged(name,
version=None,
pkgs=None,
normalize=True,
ignore_epoch=False,
**kwargs):
'''
Verify that a package is not installed, calling ``pkg.purge`` if necessary
to purge the package. All configuration files are also removed.
name
The... | def purged(name,
version=None,
pkgs=None,
normalize=True,
ignore_epoch=False,
**kwargs):
'''
Verify that a package is not installed, calling ``pkg.purge`` if necessary
to purge the package. All configuration files are also removed.
name
The... | [
"Verify",
"that",
"a",
"package",
"is",
"not",
"installed",
"calling",
"pkg",
".",
"purge",
"if",
"necessary",
"to",
"purge",
"the",
"package",
".",
"All",
"configuration",
"files",
"are",
"also",
"removed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L2876-L2979 | [
"def",
"purged",
"(",
"name",
",",
"version",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"normalize",
"=",
"True",
",",
"ignore_epoch",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'saltenv'",
"]",
"=",
"__env__",
"try",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | uptodate | .. versionadded:: 2014.7.0
.. versionchanged:: 2018.3.0
Added support for the ``pkgin`` provider.
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
reference
refresh
refresh the package database befor... | salt/states/pkg.py | def uptodate(name, refresh=False, pkgs=None, **kwargs):
'''
.. versionadded:: 2014.7.0
.. versionchanged:: 2018.3.0
Added support for the ``pkgin`` provider.
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
... | def uptodate(name, refresh=False, pkgs=None, **kwargs):
'''
.. versionadded:: 2014.7.0
.. versionchanged:: 2018.3.0
Added support for the ``pkgin`` provider.
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
... | [
"..",
"versionadded",
"::",
"2014",
".",
"7",
".",
"0",
"..",
"versionchanged",
"::",
"2018",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L2982-L3089 | [
"def",
"uptodate",
"(",
"name",
",",
"refresh",
"=",
"False",
",",
"pkgs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | group_installed | .. versionadded:: 2015.8.0
.. versionchanged:: 2016.11.0
Added support in :mod:`pacman <salt.modules.pacman>`
Ensure that an entire package group is installed. This state is currently
only supported for the :mod:`yum <salt.modules.yumpkg>` and :mod:`pacman <salt.modules.pacman>`
package manage... | salt/states/pkg.py | def group_installed(name, skip=None, include=None, **kwargs):
'''
.. versionadded:: 2015.8.0
.. versionchanged:: 2016.11.0
Added support in :mod:`pacman <salt.modules.pacman>`
Ensure that an entire package group is installed. This state is currently
only supported for the :mod:`yum <salt.m... | def group_installed(name, skip=None, include=None, **kwargs):
'''
.. versionadded:: 2015.8.0
.. versionchanged:: 2016.11.0
Added support in :mod:`pacman <salt.modules.pacman>`
Ensure that an entire package group is installed. This state is currently
only supported for the :mod:`yum <salt.m... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L3092-L3237 | [
"def",
"group_installed",
"(",
"name",
",",
"skip",
"=",
"None",
",",
"include",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_init | Set a flag to tell the install functions to refresh the package database.
This ensures that the package database is refreshed only once during
a state run significantly improving the speed of package management
during a state run.
It sets a flag for a number of reasons, primarily due to timeline logic.... | salt/states/pkg.py | def mod_init(low):
'''
Set a flag to tell the install functions to refresh the package database.
This ensures that the package database is refreshed only once during
a state run significantly improving the speed of package management
during a state run.
It sets a flag for a number of reasons, p... | def mod_init(low):
'''
Set a flag to tell the install functions to refresh the package database.
This ensures that the package database is refreshed only once during
a state run significantly improving the speed of package management
during a state run.
It sets a flag for a number of reasons, p... | [
"Set",
"a",
"flag",
"to",
"tell",
"the",
"install",
"functions",
"to",
"refresh",
"the",
"package",
"database",
".",
"This",
"ensures",
"that",
"the",
"package",
"database",
"is",
"refreshed",
"only",
"once",
"during",
"a",
"state",
"run",
"significantly",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L3240-L3266 | [
"def",
"mod_init",
"(",
"low",
")",
":",
"ret",
"=",
"True",
"if",
"'pkg.ex_mod_init'",
"in",
"__salt__",
":",
"ret",
"=",
"__salt__",
"[",
"'pkg.ex_mod_init'",
"]",
"(",
"low",
")",
"if",
"low",
"[",
"'fun'",
"]",
"==",
"'installed'",
"or",
"low",
"["... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_watch | Install/reinstall a package based on a watch requisite
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered. | salt/states/pkg.py | def mod_watch(name, **kwargs):
'''
Install/reinstall a package based on a watch requisite
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the stat... | def mod_watch(name, **kwargs):
'''
Install/reinstall a package based on a watch requisite
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the stat... | [
"Install",
"/",
"reinstall",
"a",
"package",
"based",
"on",
"a",
"watch",
"requisite"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pkg.py#L3329-L3349 | [
"def",
"mod_watch",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"sfun",
"=",
"kwargs",
".",
"pop",
"(",
"'sfun'",
",",
"None",
")",
"mapfun",
"=",
"{",
"'purged'",
":",
"purged",
",",
"'latest'",
":",
"latest",
",",
"'removed'",
":",
"removed",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensures that the named port exists on bridge, eventually creates it.
Args:
name: The name of the port.
bridge: The name of the bridge.
tunnel_type: Optional type of interface to create, currently supports: vlan, vxlan and gre.
id: Optional tunnel's key.
remote: Remote endpoi... | salt/states/openvswitch_port.py | def present(name, bridge, tunnel_type=None, id=None, remote=None, dst_port=None, internal=False):
'''
Ensures that the named port exists on bridge, eventually creates it.
Args:
name: The name of the port.
bridge: The name of the bridge.
tunnel_type: Optional type of interface to cre... | def present(name, bridge, tunnel_type=None, id=None, remote=None, dst_port=None, internal=False):
'''
Ensures that the named port exists on bridge, eventually creates it.
Args:
name: The name of the port.
bridge: The name of the bridge.
tunnel_type: Optional type of interface to cre... | [
"Ensures",
"that",
"the",
"named",
"port",
"exists",
"on",
"bridge",
"eventually",
"creates",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_port.py#L20-L271 | [
"def",
"present",
"(",
"name",
",",
"bridge",
",",
"tunnel_type",
"=",
"None",
",",
"id",
"=",
"None",
",",
"remote",
"=",
"None",
",",
"dst_port",
"=",
"None",
",",
"internal",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensures that the named port exists on bridge, eventually deletes it.
If bridge is not set, port is removed from whatever bridge contains it.
Args:
name: The name of the port.
bridge: The name of the bridge. | salt/states/openvswitch_port.py | def absent(name, bridge=None):
'''
Ensures that the named port exists on bridge, eventually deletes it.
If bridge is not set, port is removed from whatever bridge contains it.
Args:
name: The name of the port.
bridge: The name of the bridge.
'''
ret = {'name': name, 'changes':... | def absent(name, bridge=None):
'''
Ensures that the named port exists on bridge, eventually deletes it.
If bridge is not set, port is removed from whatever bridge contains it.
Args:
name: The name of the port.
bridge: The name of the bridge.
'''
ret = {'name': name, 'changes':... | [
"Ensures",
"that",
"the",
"named",
"port",
"exists",
"on",
"bridge",
"eventually",
"deletes",
"it",
".",
"If",
"bridge",
"is",
"not",
"set",
"port",
"is",
"removed",
"from",
"whatever",
"bridge",
"contains",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_port.py#L274-L339 | [
"def",
"absent",
"(",
"name",
",",
"bridge",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"bridge_exists",
"=",
"False",
"if",
"brid... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _call_system_profiler | Call out to system_profiler. Return a dictionary
of the stuff we are interested in. | salt/modules/system_profiler.py | def _call_system_profiler(datatype):
'''
Call out to system_profiler. Return a dictionary
of the stuff we are interested in.
'''
p = subprocess.Popen(
[PROFILER_BINARY, '-detailLevel', 'full',
'-xml', datatype], stdout=subprocess.PIPE)
(sysprofresults, sysprof_stderr) = p.comm... | def _call_system_profiler(datatype):
'''
Call out to system_profiler. Return a dictionary
of the stuff we are interested in.
'''
p = subprocess.Popen(
[PROFILER_BINARY, '-detailLevel', 'full',
'-xml', datatype], stdout=subprocess.PIPE)
(sysprofresults, sysprof_stderr) = p.comm... | [
"Call",
"out",
"to",
"system_profiler",
".",
"Return",
"a",
"dictionary",
"of",
"the",
"stuff",
"we",
"are",
"interested",
"in",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system_profiler.py#L34-L55 | [
"def",
"_call_system_profiler",
"(",
"datatype",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"PROFILER_BINARY",
",",
"'-detailLevel'",
",",
"'full'",
",",
"'-xml'",
",",
"datatype",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | receipts | Return the results of a call to
``system_profiler -xml -detail full SPInstallHistoryDataType``
as a dictionary. Top-level keys of the dictionary
are the names of each set of install receipts, since
there can be multiple receipts with the same name.
Contents of each key are a list of dictionaries.
... | salt/modules/system_profiler.py | def receipts():
'''
Return the results of a call to
``system_profiler -xml -detail full SPInstallHistoryDataType``
as a dictionary. Top-level keys of the dictionary
are the names of each set of install receipts, since
there can be multiple receipts with the same name.
Contents of each key a... | def receipts():
'''
Return the results of a call to
``system_profiler -xml -detail full SPInstallHistoryDataType``
as a dictionary. Top-level keys of the dictionary
are the names of each set of install receipts, since
there can be multiple receipts with the same name.
Contents of each key a... | [
"Return",
"the",
"results",
"of",
"a",
"call",
"to",
"system_profiler",
"-",
"xml",
"-",
"detail",
"full",
"SPInstallHistoryDataType",
"as",
"a",
"dictionary",
".",
"Top",
"-",
"level",
"keys",
"of",
"the",
"dictionary",
"are",
"the",
"names",
"of",
"each",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/system_profiler.py#L58-L95 | [
"def",
"receipts",
"(",
")",
":",
"apps",
"=",
"_call_system_profiler",
"(",
"'SPInstallHistoryDataType'",
")",
"appdict",
"=",
"{",
"}",
"for",
"a",
"in",
"apps",
":",
"details",
"=",
"dict",
"(",
"a",
")",
"details",
".",
"pop",
"(",
"'_name'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias | Create alias and enforce collection list.
Use the solrcloud module to get alias members and set them.
You can pass additional arguments that will be forwarded to http.query
name
The collection name
collections
list of collections to include in the alias | salt/states/solrcloud.py | def alias(name, collections, **kwargs):
'''
Create alias and enforce collection list.
Use the solrcloud module to get alias members and set them.
You can pass additional arguments that will be forwarded to http.query
name
The collection name
collections
list of collections to ... | def alias(name, collections, **kwargs):
'''
Create alias and enforce collection list.
Use the solrcloud module to get alias members and set them.
You can pass additional arguments that will be forwarded to http.query
name
The collection name
collections
list of collections to ... | [
"Create",
"alias",
"and",
"enforce",
"collection",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/solrcloud.py#L19-L75 | [
"def",
"alias",
"(",
"name",
",",
"collections",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"}",
"if",
"__salt__",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | collection | Create collection and enforce options.
Use the solrcloud module to get collection parameters.
You can pass additional arguments that will be forwarded to http.query
name
The collection name
options : {}
options to ensure | salt/states/solrcloud.py | def collection(name, options=None, **kwargs):
'''
Create collection and enforce options.
Use the solrcloud module to get collection parameters.
You can pass additional arguments that will be forwarded to http.query
name
The collection name
options : {}
options to ensure
''... | def collection(name, options=None, **kwargs):
'''
Create collection and enforce options.
Use the solrcloud module to get collection parameters.
You can pass additional arguments that will be forwarded to http.query
name
The collection name
options : {}
options to ensure
''... | [
"Create",
"collection",
"and",
"enforce",
"options",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/solrcloud.py#L78-L159 | [
"def",
"collection",
"(",
"name",
",",
"options",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"}",
"if",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _query | Consul object method function to construct and execute on the API URL.
:param api_url: The Consul api url.
:param api_version The Consul api version
:param function: The Consul api function to perform.
:param method: The HTTP method, e.g. GET or POST.
:param data: The data to be... | salt/modules/consul.py | def _query(function,
consul_url,
token=None,
method='GET',
api_version='v1',
data=None,
query_params=None):
'''
Consul object method function to construct and execute on the API URL.
:param api_url: The Consul api url.
:param api_ver... | def _query(function,
consul_url,
token=None,
method='GET',
api_version='v1',
data=None,
query_params=None):
'''
Consul object method function to construct and execute on the API URL.
:param api_url: The Consul api url.
:param api_ver... | [
"Consul",
"object",
"method",
"function",
"to",
"construct",
"and",
"execute",
"on",
"the",
"API",
"URL",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L50-L113 | [
"def",
"_query",
"(",
"function",
",",
"consul_url",
",",
"token",
"=",
"None",
",",
"method",
"=",
"'GET'",
",",
"api_version",
"=",
"'v1'",
",",
"data",
"=",
"None",
",",
"query_params",
"=",
"None",
")",
":",
"if",
"not",
"query_params",
":",
"query... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_ | List keys in Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:return: The list of keys.
CLI Example:
.. code-block:: bash
salt '*' consul.list
salt '*' consul.list key='web' | salt/modules/consul.py | def list_(consul_url=None, token=None, key=None, **kwargs):
'''
List keys in Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:return: The list of keys.
CLI Example:
.. code-block:: bash
salt '*' consul.list
s... | def list_(consul_url=None, token=None, key=None, **kwargs):
'''
List keys in Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:return: The list of keys.
CLI Example:
.. code-block:: bash
salt '*' consul.list
s... | [
"List",
"keys",
"in",
"Consul"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L116-L160 | [
"def",
"list_",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"key",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get | Get key from Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param recurse: Return values recursively beginning at the value of key.
:param decode: By default values are stored as Base64 encoded values,
decode will retu... | salt/modules/consul.py | def get(consul_url=None, key=None, token=None, recurse=False, decode=False, raw=False):
'''
Get key from Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param recurse: Return values recursively beginning at the value of key.
:para... | def get(consul_url=None, key=None, token=None, recurse=False, decode=False, raw=False):
'''
Get key from Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param recurse: Return values recursively beginning at the value of key.
:para... | [
"Get",
"key",
"from",
"Consul"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L163-L224 | [
"def",
"get",
"(",
"consul_url",
"=",
"None",
",",
"key",
"=",
"None",
",",
"token",
"=",
"None",
",",
"recurse",
"=",
"False",
",",
"decode",
"=",
"False",
",",
"raw",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put | Put values into Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param value: The value to set the key to.
:param flags: This can be used to specify an unsigned value
between 0 and 2^64-1. Clients can choose to use
... | salt/modules/consul.py | def put(consul_url=None, token=None, key=None, value=None, **kwargs):
'''
Put values into Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param value: The value to set the key to.
:param flags: This can be used to specify an unsig... | def put(consul_url=None, token=None, key=None, value=None, **kwargs):
'''
Put values into Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param value: The value to set the key to.
:param flags: This can be used to specify an unsig... | [
"Put",
"values",
"into",
"Consul"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L227-L345 | [
"def",
"put",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"key",
"=",
"None",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Delete values from Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param recurse: Delete values recursively beginning at the value of key.
:param cas: This flag is used to turn the DELETE into
a Check-And-Set operation.
... | salt/modules/consul.py | def delete(consul_url=None, token=None, key=None, **kwargs):
'''
Delete values from Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param recurse: Delete values recursively beginning at the value of key.
:param cas: This flag is u... | def delete(consul_url=None, token=None, key=None, **kwargs):
'''
Delete values from Consul
:param consul_url: The Consul server URL.
:param key: The key to use as the starting point for the list.
:param recurse: Delete values recursively beginning at the value of key.
:param cas: This flag is u... | [
"Delete",
"values",
"from",
"Consul"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L348-L406 | [
"def",
"delete",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"key",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_checks | Returns the checks the local agent is managing
:param consul_url: The Consul server URL.
:return: Returns the checks the local agent is managing
CLI Example:
.. code-block:: bash
salt '*' consul.agent_checks | salt/modules/consul.py | def agent_checks(consul_url=None, token=None):
'''
Returns the checks the local agent is managing
:param consul_url: The Consul server URL.
:return: Returns the checks the local agent is managing
CLI Example:
.. code-block:: bash
salt '*' consul.agent_checks
'''
ret = {}
... | def agent_checks(consul_url=None, token=None):
'''
Returns the checks the local agent is managing
:param consul_url: The Consul server URL.
:return: Returns the checks the local agent is managing
CLI Example:
.. code-block:: bash
salt '*' consul.agent_checks
'''
ret = {}
... | [
"Returns",
"the",
"checks",
"the",
"local",
"agent",
"is",
"managing"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L409-L437 | [
"def",
"agent_checks",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
"consul_url",
":",
"log",
".",
"error",
"(",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_members | Returns the members as seen by the local serf agent
:param consul_url: The Consul server URL.
:return: Returns the members as seen by the local serf agent
CLI Example:
.. code-block:: bash
salt '*' consul.agent_members | salt/modules/consul.py | def agent_members(consul_url=None, token=None, **kwargs):
'''
Returns the members as seen by the local serf agent
:param consul_url: The Consul server URL.
:return: Returns the members as seen by the local serf agent
CLI Example:
.. code-block:: bash
salt '*' consul.agent_members
... | def agent_members(consul_url=None, token=None, **kwargs):
'''
Returns the members as seen by the local serf agent
:param consul_url: The Consul server URL.
:return: Returns the members as seen by the local serf agent
CLI Example:
.. code-block:: bash
salt '*' consul.agent_members
... | [
"Returns",
"the",
"members",
"as",
"seen",
"by",
"the",
"local",
"serf",
"agent"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L471-L504 | [
"def",
"agent_members",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_self | Returns the local node configuration
:param consul_url: The Consul server URL.
:return: Returns the local node configuration
CLI Example:
.. code-block:: bash
salt '*' consul.agent_self | salt/modules/consul.py | def agent_self(consul_url=None, token=None):
'''
Returns the local node configuration
:param consul_url: The Consul server URL.
:return: Returns the local node configuration
CLI Example:
.. code-block:: bash
salt '*' consul.agent_self
'''
ret = {}
query_params = {}
i... | def agent_self(consul_url=None, token=None):
'''
Returns the local node configuration
:param consul_url: The Consul server URL.
:return: Returns the local node configuration
CLI Example:
.. code-block:: bash
salt '*' consul.agent_self
'''
ret = {}
query_params = {}
i... | [
"Returns",
"the",
"local",
"node",
"configuration"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L507-L537 | [
"def",
"agent_self",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
"consul_url",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_maintenance | Manages node maintenance mode
:param consul_url: The Consul server URL.
:param enable: The enable flag is required.
Acceptable values are either true
(to enter maintenance mode) or
false (to resume normal operation).
:param reason: If provided, its v... | salt/modules/consul.py | def agent_maintenance(consul_url=None, token=None, **kwargs):
'''
Manages node maintenance mode
:param consul_url: The Consul server URL.
:param enable: The enable flag is required.
Acceptable values are either true
(to enter maintenance mode) or
... | def agent_maintenance(consul_url=None, token=None, **kwargs):
'''
Manages node maintenance mode
:param consul_url: The Consul server URL.
:param enable: The enable flag is required.
Acceptable values are either true
(to enter maintenance mode) or
... | [
"Manages",
"node",
"maintenance",
"mode"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L540-L594 | [
"def",
"agent_maintenance",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_leave | Used to instruct the agent to force a node into the left state.
:param consul_url: The Consul server URL.
:param node: The node the agent will force into left state
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.agent_leave n... | salt/modules/consul.py | def agent_leave(consul_url=None, token=None, node=None):
'''
Used to instruct the agent to force a node into the left state.
:param consul_url: The Consul server URL.
:param node: The node the agent will force into left state
:return: Boolean and message indicating success or failure.
CLI Exam... | def agent_leave(consul_url=None, token=None, node=None):
'''
Used to instruct the agent to force a node into the left state.
:param consul_url: The Consul server URL.
:param node: The node the agent will force into left state
:return: Boolean and message indicating success or failure.
CLI Exam... | [
"Used",
"to",
"instruct",
"the",
"agent",
"to",
"force",
"a",
"node",
"into",
"the",
"left",
"state",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L644-L684 | [
"def",
"agent_leave",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"node",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_check_register | The register endpoint is used to add a new check to the local agent.
:param consul_url: The Consul server URL.
:param name: The description of what the check is for.
:param id: The unique name to use for the check, if not
provided 'name' is used.
:param notes: Human readable description ... | salt/modules/consul.py | def agent_check_register(consul_url=None, token=None, **kwargs):
'''
The register endpoint is used to add a new check to the local agent.
:param consul_url: The Consul server URL.
:param name: The description of what the check is for.
:param id: The unique name to use for the check, if not
... | def agent_check_register(consul_url=None, token=None, **kwargs):
'''
The register endpoint is used to add a new check to the local agent.
:param consul_url: The Consul server URL.
:param name: The description of what the check is for.
:param id: The unique name to use for the check, if not
... | [
"The",
"register",
"endpoint",
"is",
"used",
"to",
"add",
"a",
"new",
"check",
"to",
"the",
"local",
"agent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L687-L772 | [
"def",
"agent_check_register",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"data",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_check_deregister | The agent will take care of deregistering the check from the Catalog.
:param consul_url: The Consul server URL.
:param checkid: The ID of the check to deregister from Consul.
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.age... | salt/modules/consul.py | def agent_check_deregister(consul_url=None, token=None, checkid=None):
'''
The agent will take care of deregistering the check from the Catalog.
:param consul_url: The Consul server URL.
:param checkid: The ID of the check to deregister from Consul.
:return: Boolean and message indicating success o... | def agent_check_deregister(consul_url=None, token=None, checkid=None):
'''
The agent will take care of deregistering the check from the Catalog.
:param consul_url: The Consul server URL.
:param checkid: The ID of the check to deregister from Consul.
:return: Boolean and message indicating success o... | [
"The",
"agent",
"will",
"take",
"care",
"of",
"deregistering",
"the",
"check",
"from",
"the",
"Catalog",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L775-L813 | [
"def",
"agent_check_deregister",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"checkid",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
"consul_url"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_check_warn | This endpoint is used with a check that is of the TTL type. When this
is called, the status of the check is set to warning and the TTL
clock is reset.
:param consul_url: The Consul server URL.
:param checkid: The ID of the check to deregister from Consul.
:param note: A human-readable message with ... | salt/modules/consul.py | def agent_check_warn(consul_url=None, token=None, checkid=None, **kwargs):
'''
This endpoint is used with a check that is of the TTL type. When this
is called, the status of the check is set to warning and the TTL
clock is reset.
:param consul_url: The Consul server URL.
:param checkid: The ID ... | def agent_check_warn(consul_url=None, token=None, checkid=None, **kwargs):
'''
This endpoint is used with a check that is of the TTL type. When this
is called, the status of the check is set to warning and the TTL
clock is reset.
:param consul_url: The Consul server URL.
:param checkid: The ID ... | [
"This",
"endpoint",
"is",
"used",
"with",
"a",
"check",
"that",
"is",
"of",
"the",
"TTL",
"type",
".",
"When",
"this",
"is",
"called",
"the",
"status",
"of",
"the",
"check",
"is",
"set",
"to",
"warning",
"and",
"the",
"TTL",
"clock",
"is",
"reset",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L865-L911 | [
"def",
"agent_check_warn",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"checkid",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_service_register | The used to add a new service, with an optional
health check, to the local agent.
:param consul_url: The Consul server URL.
:param name: A name describing the service.
:param address: The address used by the service, defaults
to the address of the agent.
:param port: The port us... | salt/modules/consul.py | def agent_service_register(consul_url=None, token=None, **kwargs):
'''
The used to add a new service, with an optional
health check, to the local agent.
:param consul_url: The Consul server URL.
:param name: A name describing the service.
:param address: The address used by the service, default... | def agent_service_register(consul_url=None, token=None, **kwargs):
'''
The used to add a new service, with an optional
health check, to the local agent.
:param consul_url: The Consul server URL.
:param name: A name describing the service.
:param address: The address used by the service, default... | [
"The",
"used",
"to",
"add",
"a",
"new",
"service",
"with",
"an",
"optional",
"health",
"check",
"to",
"the",
"local",
"agent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L963-L1074 | [
"def",
"agent_service_register",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"data",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_service_deregister | Used to remove a service.
:param consul_url: The Consul server URL.
:param serviceid: A serviceid describing the service.
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.agent_service_deregister serviceid='redis' | salt/modules/consul.py | def agent_service_deregister(consul_url=None, token=None, serviceid=None):
'''
Used to remove a service.
:param consul_url: The Consul server URL.
:param serviceid: A serviceid describing the service.
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block::... | def agent_service_deregister(consul_url=None, token=None, serviceid=None):
'''
Used to remove a service.
:param consul_url: The Consul server URL.
:param serviceid: A serviceid describing the service.
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block::... | [
"Used",
"to",
"remove",
"a",
"service",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1077-L1117 | [
"def",
"agent_service_deregister",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"serviceid",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"data",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | agent_service_maintenance | Used to place a service into maintenance mode.
:param consul_url: The Consul server URL.
:param serviceid: A name of the service.
:param enable: Whether the service should be enabled or disabled.
:param reason: A human readable message of why the service was
enabled or disabled.
... | salt/modules/consul.py | def agent_service_maintenance(consul_url=None, token=None, serviceid=None, **kwargs):
'''
Used to place a service into maintenance mode.
:param consul_url: The Consul server URL.
:param serviceid: A name of the service.
:param enable: Whether the service should be enabled or disabled.
:param re... | def agent_service_maintenance(consul_url=None, token=None, serviceid=None, **kwargs):
'''
Used to place a service into maintenance mode.
:param consul_url: The Consul server URL.
:param serviceid: A name of the service.
:param enable: Whether the service should be enabled or disabled.
:param re... | [
"Used",
"to",
"place",
"a",
"service",
"into",
"maintenance",
"mode",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1120-L1175 | [
"def",
"agent_service_maintenance",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"serviceid",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consu... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | session_create | Used to create a session.
:param consul_url: The Consul server URL.
:param lockdelay: Duration string using a "s" suffix for seconds.
The default is 15s.
:param node: Must refer to a node that is already registered,
if specified. By default, the agent's own node
... | salt/modules/consul.py | def session_create(consul_url=None, token=None, **kwargs):
'''
Used to create a session.
:param consul_url: The Consul server URL.
:param lockdelay: Duration string using a "s" suffix for seconds.
The default is 15s.
:param node: Must refer to a node that is already registered... | def session_create(consul_url=None, token=None, **kwargs):
'''
Used to create a session.
:param consul_url: The Consul server URL.
:param lockdelay: Duration string using a "s" suffix for seconds.
The default is 15s.
:param node: Must refer to a node that is already registered... | [
"Used",
"to",
"create",
"a",
"session",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1178-L1266 | [
"def",
"session_create",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
"consul_url",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | session_list | Used to list sessions.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param return_list: By default, all information about the sessions is
returned, us... | salt/modules/consul.py | def session_list(consul_url=None, token=None, return_list=False, **kwargs):
'''
Used to list sessions.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param return_list... | def session_list(consul_url=None, token=None, return_list=False, **kwargs):
'''
Used to list sessions.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param return_list... | [
"Used",
"to",
"list",
"sessions",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1269-L1313 | [
"def",
"session_list",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"return_list",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | session_destroy | Destroy session
:param consul_url: The Consul server URL.
:param session: The ID of the session to destroy.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: Boolean & message of success or failure.
CLI ... | salt/modules/consul.py | def session_destroy(consul_url=None, token=None, session=None, **kwargs):
'''
Destroy session
:param consul_url: The Consul server URL.
:param session: The ID of the session to destroy.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided usi... | def session_destroy(consul_url=None, token=None, session=None, **kwargs):
'''
Destroy session
:param consul_url: The Consul server URL.
:param session: The ID of the session to destroy.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided usi... | [
"Destroy",
"session"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1316-L1361 | [
"def",
"session_destroy",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"session",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | session_info | Information about a session
:param consul_url: The Consul server URL.
:param session: The ID of the session to return information about.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: Boolean & message of ... | salt/modules/consul.py | def session_info(consul_url=None, token=None, session=None, **kwargs):
'''
Information about a session
:param consul_url: The Consul server URL.
:param session: The ID of the session to return information about.
:param dc: By default, the datacenter of the agent is queried;
however, ... | def session_info(consul_url=None, token=None, session=None, **kwargs):
'''
Information about a session
:param consul_url: The Consul server URL.
:param session: The ID of the session to return information about.
:param dc: By default, the datacenter of the agent is queried;
however, ... | [
"Information",
"about",
"a",
"session"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1364-L1403 | [
"def",
"session_info",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"session",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | catalog_register | Registers a new node, service, or check
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param node: The node to register.
:param address: The address of the node.
:para... | salt/modules/consul.py | def catalog_register(consul_url=None, token=None, **kwargs):
'''
Registers a new node, service, or check
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param node: The... | def catalog_register(consul_url=None, token=None, **kwargs):
'''
Registers a new node, service, or check
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param node: The... | [
"Registers",
"a",
"new",
"node",
"service",
"or",
"check"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1406-L1564 | [
"def",
"catalog_register",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"data",
"=",
"{",
"}",
"data",
"[",
"'NodeMeta'",
"]",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | catalog_datacenters | Return list of available datacenters from catalog.
:param consul_url: The Consul server URL.
:return: The list of available datacenters.
CLI Example:
.. code-block:: bash
salt '*' consul.catalog_datacenters | salt/modules/consul.py | def catalog_datacenters(consul_url=None, token=None):
'''
Return list of available datacenters from catalog.
:param consul_url: The Consul server URL.
:return: The list of available datacenters.
CLI Example:
.. code-block:: bash
salt '*' consul.catalog_datacenters
'''
ret = ... | def catalog_datacenters(consul_url=None, token=None):
'''
Return list of available datacenters from catalog.
:param consul_url: The Consul server URL.
:return: The list of available datacenters.
CLI Example:
.. code-block:: bash
salt '*' consul.catalog_datacenters
'''
ret = ... | [
"Return",
"list",
"of",
"available",
"datacenters",
"from",
"catalog",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1629-L1656 | [
"def",
"catalog_datacenters",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
"consul_url",
":",
"log",
".",
"error",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | catalog_nodes | Return list of available nodes from catalog.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: The list of available nodes.
CLI Example:
.. code-block:: bash
... | salt/modules/consul.py | def catalog_nodes(consul_url=None, token=None, **kwargs):
'''
Return list of available nodes from catalog.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: The l... | def catalog_nodes(consul_url=None, token=None, **kwargs):
'''
Return list of available nodes from catalog.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: The l... | [
"Return",
"list",
"of",
"available",
"nodes",
"from",
"catalog",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1659-L1693 | [
"def",
"catalog_nodes",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | health_node | Health information about the registered node.
:param consul_url: The Consul server URL.
:param node: The node to request health information about.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: Health info... | salt/modules/consul.py | def health_node(consul_url=None, token=None, node=None, **kwargs):
'''
Health information about the registered node.
:param consul_url: The Consul server URL.
:param node: The node to request health information about.
:param dc: By default, the datacenter of the agent is queried;
how... | def health_node(consul_url=None, token=None, node=None, **kwargs):
'''
Health information about the registered node.
:param consul_url: The Consul server URL.
:param node: The node to request health information about.
:param dc: By default, the datacenter of the agent is queried;
how... | [
"Health",
"information",
"about",
"the",
"registered",
"node",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1818-L1856 | [
"def",
"health_node",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"node",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | health_checks | Health information about the registered service.
:param consul_url: The Consul server URL.
:param service: The service to request health information about.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: He... | salt/modules/consul.py | def health_checks(consul_url=None, token=None, service=None, **kwargs):
'''
Health information about the registered service.
:param consul_url: The Consul server URL.
:param service: The service to request health information about.
:param dc: By default, the datacenter of the agent is queried;
... | def health_checks(consul_url=None, token=None, service=None, **kwargs):
'''
Health information about the registered service.
:param consul_url: The Consul server URL.
:param service: The service to request health information about.
:param dc: By default, the datacenter of the agent is queried;
... | [
"Health",
"information",
"about",
"the",
"registered",
"service",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1859-L1897 | [
"def",
"health_checks",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"service",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | health_state | Returns the checks in the state provided on the path.
:param consul_url: The Consul server URL.
:param state: The state to show checks for. The supported states
are any, unknown, passing, warning, or critical.
The any state is a wildcard that can be used to
... | salt/modules/consul.py | def health_state(consul_url=None, token=None, state=None, **kwargs):
'''
Returns the checks in the state provided on the path.
:param consul_url: The Consul server URL.
:param state: The state to show checks for. The supported states
are any, unknown, passing, warning, or critical.
... | def health_state(consul_url=None, token=None, state=None, **kwargs):
'''
Returns the checks in the state provided on the path.
:param consul_url: The Consul server URL.
:param state: The state to show checks for. The supported states
are any, unknown, passing, warning, or critical.
... | [
"Returns",
"the",
"checks",
"in",
"the",
"state",
"provided",
"on",
"the",
"path",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1952-L2000 | [
"def",
"health_state",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"state",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | acl_delete | Delete an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Boolean & message of success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_delete id='c1c4d223-91cb-3d1f-1ee8-f2af9e7b6716' | salt/modules/consul.py | def acl_delete(consul_url=None, token=None, **kwargs):
'''
Delete an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Boolean & message of success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_de... | def acl_delete(consul_url=None, token=None, **kwargs):
'''
Delete an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Boolean & message of success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_de... | [
"Delete",
"an",
"ACL",
"token",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2189-L2234 | [
"def",
"acl_delete",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"data",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | acl_info | Information about an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Information about the ACL requested.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_info id='c1c4d223-91cb-3d1f-1ee8-f2af9e7b6716' | salt/modules/consul.py | def acl_info(consul_url=None, **kwargs):
'''
Information about an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Information about the ACL requested.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_info id='... | def acl_info(consul_url=None, **kwargs):
'''
Information about an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Information about the ACL requested.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_info id='... | [
"Information",
"about",
"an",
"ACL",
"token",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2237-L2272 | [
"def",
"acl_info",
"(",
"consul_url",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"data",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
"consul_url",
":",
"log",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | acl_list | List the ACL tokens.
:param consul_url: The Consul server URL.
:return: List of ACLs
CLI Example:
.. code-block:: bash
salt '*' consul.acl_list | salt/modules/consul.py | def acl_list(consul_url=None, token=None, **kwargs):
'''
List the ACL tokens.
:param consul_url: The Consul server URL.
:return: List of ACLs
CLI Example:
.. code-block:: bash
salt '*' consul.acl_list
'''
ret = {}
data = {}
if not consul_url:
consul_url = _ge... | def acl_list(consul_url=None, token=None, **kwargs):
'''
List the ACL tokens.
:param consul_url: The Consul server URL.
:return: List of ACLs
CLI Example:
.. code-block:: bash
salt '*' consul.acl_list
'''
ret = {}
data = {}
if not consul_url:
consul_url = _ge... | [
"List",
"the",
"ACL",
"tokens",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2323-L2358 | [
"def",
"acl_list",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"data",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_get_config",
"(",
")",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | event_fire | List the ACL tokens.
:param consul_url: The Consul server URL.
:param name: The name of the event to fire.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param node: Filter by node name.
:param service: Filter... | salt/modules/consul.py | def event_fire(consul_url=None, token=None, name=None, **kwargs):
'''
List the ACL tokens.
:param consul_url: The Consul server URL.
:param name: The name of the event to fire.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "d... | def event_fire(consul_url=None, token=None, name=None, **kwargs):
'''
List the ACL tokens.
:param consul_url: The Consul server URL.
:param name: The name of the event to fire.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "d... | [
"List",
"the",
"ACL",
"tokens",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2361-L2421 | [
"def",
"event_fire",
"(",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
",",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"query_params",
"=",
"{",
"}",
"if",
"not",
"consul_url",
":",
"consul_url",
"=",
"_g... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.