Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def _send_splunk(event, index_override=None, sourcetype_override=None):
'''
Send the results to Splunk.
Requires the Splunk HTTP Event Collector running on port 8088.
This is available on Splunk Enterprise version 6.3 or higher.
'''
# Get Splunk Opti... | [] |
Please provide a description of the function:def output(data, **kwargs): # pylint: disable=unused-argument
'''
Print the output data in JSON
'''
try:
dump_opts = {'indent': 4, 'default': repr}
if 'output_indent' in __opts__:
indent = __opts__.get('output_indent')
... | [] |
Please provide a description of the function:def _get_salt_params():
'''
Try to get all sort of parameters for Server Density server info.
NOTE: Missing publicDNS and publicIPs parameters. There might be way of
getting them with salt-cloud.
'''
all_stats = __salt__['status.all_status']()
al... | [] |
Please provide a description of the function:def monitored(name, group=None, salt_name=True, salt_params=True, agent_version=1, **params):
'''
Device is monitored with Server Density.
name
Device name in Server Density.
salt_name
If ``True`` (default), takes the name from the ``id`` gr... | [] |
Please provide a description of the function:def _conn(queue):
'''
Return an sqlite connection
'''
queue_dir = __opts__['sqlite_queue_dir']
db = os.path.join(queue_dir, '{0}.db'.format(queue))
log.debug('Connecting to: %s', db)
con = sqlite3.connect(db)
tables = _list_tables(con)
if... | [] |
Please provide a description of the function:def _list_items(queue):
'''
Private function to list contents of a queue
'''
con = _conn(queue)
with con:
cur = con.cursor()
cmd = 'SELECT name FROM {0}'.format(queue)
log.debug('SQL Query: %s', cmd)
cur.execute(cmd)
... | [] |
Please provide a description of the function:def _list_queues():
'''
Return a list of sqlite databases in the queue_dir
'''
queue_dir = __opts__['sqlite_queue_dir']
files = os.path.join(queue_dir, '*.db')
paths = glob.glob(files)
queues = [os.path.splitext(os.path.basename(item))[0] for item... | [] |
Please provide a description of the function:def list_items(queue):
'''
List contents of a queue
'''
itemstuple = _list_items(queue)
items = [item[0] for item in itemstuple]
return items | [] |
Please provide a description of the function:def _quote_escape(item):
'''
Make sure single quotes are escaped properly in sqlite3 fashion.
e.g.: ' becomes ''
'''
rex_sqlquote = re.compile("'", re.M)
return rex_sqlquote.sub("''", item) | [] |
Please provide a description of the function:def delete(queue, items):
'''
Delete an item or items from a queue
'''
con = _conn(queue)
with con:
cur = con.cursor()
if isinstance(items, six.string_types):
items = _quote_escape(items)
cmd = .format(queue, items)... | [
"DELETE FROM {0} WHERE name = '{1}'",
"DELETE FROM {0} WHERE name = '{1}'"
] |
Please provide a description of the function:def pop(queue, quantity=1, is_runner=False):
'''
Pop one or more or all items from the queue return them.
'''
cmd = 'SELECT name FROM {0}'.format(queue)
if quantity != 'all':
try:
quantity = int(quantity)
except ValueError as e... | [] |
Please provide a description of the function:def get_all_topics(region=None, key=None, keyid=None, profile=None):
'''
Returns a list of the all topics..
CLI example::
salt myminion boto_sns.get_all_topics
'''
cache_key = _cache_get_key()
try:
return __context__[cache_key]
e... | [] |
Please provide a description of the function:def exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an SNS topic exists.
CLI example::
salt myminion boto_sns.exists mytopic region=us-east-1
'''
topics = get_all_topics(region=region, key=key, keyid=keyid,
... | [] |
Please provide a description of the function:def create(name, region=None, key=None, keyid=None, profile=None):
'''
Create an SNS topic.
CLI example to create a topic::
salt myminion boto_sns.create mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=... | [] |
Please provide a description of the function:def delete(name, region=None, key=None, keyid=None, profile=None):
'''
Delete an SNS topic.
CLI example to delete a topic::
salt myminion boto_sns.delete mytopic region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=... | [] |
Please provide a description of the function:def get_all_subscriptions_by_topic(name, region=None, key=None, keyid=None, profile=None):
'''
Get list of all subscriptions to a specific topic.
CLI example to delete a topic::
salt myminion boto_sns.get_all_subscriptions_by_topic mytopic region=us-eas... | [] |
Please provide a description of the function:def subscribe(topic, protocol, endpoint, region=None, key=None, keyid=None, profile=None):
'''
Subscribe to a Topic.
CLI example to delete a topic::
salt myminion boto_sns.subscribe mytopic https https://www.example.com/sns-endpoint region=us-east-1
... | [] |
Please provide a description of the function:def unsubscribe(topic, subscription_arn, region=None, key=None, keyid=None, profile=None):
'''
Unsubscribe a specific SubscriptionArn of a topic.
CLI Example:
.. code-block:: bash
salt myminion boto_sns.unsubscribe my_topic my_subscription_arn regi... | [] |
Please provide a description of the function:def get_arn(name, region=None, key=None, keyid=None, profile=None):
'''
Returns the full ARN for a given topic name.
CLI example::
salt myminion boto_sns.get_arn mytopic
'''
if name.startswith('arn:aws:sns:'):
return name
account_id... | [] |
Please provide a description of the function:def current_ioloop(io_loop):
'''
A context manager that will set the current ioloop to io_loop for the context
'''
orig_loop = tornado.ioloop.IOLoop.current()
io_loop.make_current()
try:
yield
finally:
orig_loop.make_current() | [] |
Please provide a description of the function:def _get_top_file_envs():
'''
Get all environments from the top file
'''
try:
return __context__['saltutil._top_file_envs']
except KeyError:
try:
st_ = salt.state.HighState(__opts__,
initi... | [] |
Please provide a description of the function:def _sync(form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None):
'''
Sync the given directory in the given environment
'''
if saltenv is None:
saltenv = _get_top_file_envs()
if isinstance(saltenv, six.string_types):
saltenv = s... | [] |
Please provide a description of the function:def update(version=None):
'''
Update the salt minion from the URL defined in opts['update_url']
SaltStack, Inc provides the latest builds here:
update_url: https://repo.saltstack.com/windows/
Be aware that as of 2014-8-11 there's a bug in esky such that ... | [] |
Please provide a description of the function:def sync_beacons(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
'''
.. versionadded:: 2015.5.1
Sync beacons from ``salt://_beacons`` to the minion
saltenv
The fileserver environment from which to sync. To sync from more t... | [] |
Please provide a description of the function:def sync_sdb(saltenv=None, extmod_whitelist=None, extmod_blacklist=None):
'''
.. versionadded:: 2015.5.8,2015.8.3
Sync sdb modules from ``salt://_sdb`` to the minion
saltenv
The fileserver environment from which to sync. To sync from more than
... | [] |
Please provide a description of the function:def sync_modules(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
'''
.. versionadded:: 0.10.0
Sync execution modules from ``salt://_modules`` to the minion
saltenv
The fileserver environment from which to sync. To sync fro... | [] |
Please provide a description of the function:def refresh_grains(**kwargs):
'''
.. versionadded:: 2016.3.6,2016.11.4,2017.7.0
Refresh the minion's grains without syncing custom grains modules from
``salt://_grains``.
.. note::
The available execution modules will be reloaded as part of this... | [] |
Please provide a description of the function:def sync_grains(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
'''
.. versionadded:: 0.10.0
Sync grains modules from ``salt://_grains`` to the minion
saltenv
The fileserver environment from which to sync. To sync from mor... | [] |
Please provide a description of the function:def sync_matchers(saltenv=None, refresh=False, extmod_whitelist=None, extmod_blacklist=None):
'''
.. versionadded:: 2019.2.0
Sync engine modules from ``salt://_matchers`` to the minion
saltenv
The fileserver environment from which to sync. To sync f... | [] |
Please provide a description of the function:def list_extmods():
'''
.. versionadded:: 2017.7.0
List Salt modules which have been synced externally
CLI Examples:
.. code-block:: bash
salt '*' saltutil.list_extmods
'''
ret = {}
ext_dir = os.path.join(__opts__['cachedir'], 'ext... | [] |
Please provide a description of the function:def sync_pillar(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
'''
.. versionadded:: 2015.8.11,2016.3.2
Sync pillar modules from the ``salt://_pillar`` directory on the Salt
fileserver. This function is environment-aware, pass the... | [] |
Please provide a description of the function:def sync_all(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
'''
.. versionchanged:: 2015.8.11,2016.3.2
On masterless minions, pillar modules are now synced, and refreshed
when ``refresh`` is set to ``True``.
Sync down ... | [] |
Please provide a description of the function:def refresh_pillar(**kwargs):
'''
Signal the minion to refresh the pillar data.
.. versionchanged:: Neon
The ``async`` argument has been added. The default value is True.
CLI Example:
.. code-block:: bash
salt '*' saltutil.refresh_pill... | [] |
Please provide a description of the function:def is_running(fun):
'''
If the named function is running return the data associated with it/them.
The argument can be a glob
CLI Example:
.. code-block:: bash
salt '*' saltutil.is_running state.highstate
'''
run = running()
ret = [... | [] |
Please provide a description of the function:def clear_cache(days=-1):
'''
Forcibly removes all caches on a minion.
.. versionadded:: 2014.7.0
WARNING: The safest way to clear a minion cache is by first stopping
the minion and then deleting the cache files before restarting it.
CLI Example:
... | [] |
Please provide a description of the function:def clear_job_cache(hours=24):
'''
Forcibly removes job cache folders and files on a minion.
.. versionadded:: 2018.3.0
WARNING: The safest way to clear a minion cache is by first stopping
the minion and then deleting the cache files before restarting i... | [] |
Please provide a description of the function:def find_cached_job(jid):
'''
Return the data for a specific cached job id. Note this only works if
cache_jobs has previously been set to True on the minion.
CLI Example:
.. code-block:: bash
salt '*' saltutil.find_cached_job <job id>
'''
... | [] |
Please provide a description of the function:def signal_job(jid, sig):
'''
Sends a signal to the named salt job's process
CLI Example:
.. code-block:: bash
salt '*' saltutil.signal_job <job id> 15
'''
if HAS_PSUTIL is False:
log.warning('saltutil.signal job called, but psutil ... | [] |
Please provide a description of the function:def term_all_jobs():
'''
Sends a termination signal (SIGTERM 15) to all currently running jobs
CLI Example:
.. code-block:: bash
salt '*' saltutil.term_all_jobs
'''
ret = []
for data in running():
ret.append(signal_job(data['jid... | [] |
Please provide a description of the function:def regen_keys():
'''
Used to regenerate the minion keys.
CLI Example:
.. code-block:: bash
salt '*' saltutil.regen_keys
'''
for fn_ in os.listdir(__opts__['pki_dir']):
path = os.path.join(__opts__['pki_dir'], fn_)
try:
... | [] |
Please provide a description of the function:def revoke_auth(preserve_minion_cache=False):
'''
The minion sends a request to the master to revoke its own key.
Note that the minion session will be revoked and the minion may
not be able to return the result of this command back to the master.
If the ... | [] |
Please provide a description of the function:def cmd(tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
ssh=False,
**kwargs):
'''
.. versionchanged:: 2017.7.0
The ``expr_form`` argument has been renamed to ``tgt_type``, ea... | [] |
Please provide a description of the function:def cmd_iter(tgt,
fun,
arg=(),
timeout=None,
tgt_type='glob',
ret='',
kwarg=None,
ssh=False,
**kwargs):
'''
.. versionchanged:: 2017.7.0
The ``expr_form`` ... | [] |
Please provide a description of the function:def runner(name, arg=None, kwarg=None, full_return=False, saltenv='base', jid=None, asynchronous=False, **kwargs):
'''
Execute a runner function. This function must be run on the master,
either by targeting a minion running on a master or by using
salt-call o... | [] |
Please provide a description of the function:def wheel(name, *args, **kwargs):
'''
Execute a wheel module and function. This function must be run against a
minion that is local to the master.
.. versionadded:: 2014.7.0
name
The name of the function to run
args
Any positional a... | [] |
Please provide a description of the function:def mmodule(saltenv, fun, *args, **kwargs):
'''
Loads minion modules from an environment so that they can be used in pillars
for that environment
CLI Example:
.. code-block:: bash
salt '*' saltutil.mmodule base test.ping
'''
mminion = _... | [] |
Please provide a description of the function:def _session():
'''
Create a session to be used when connecting to Zenoss.
'''
config = __salt__['config.option']('zenoss')
session = requests.session()
session.auth = (config.get('username'), config.get('password'))
session.verify = False
se... | [] |
Please provide a description of the function:def _router_request(router, method, data=None):
'''
Make a request to the Zenoss API router
'''
if router not in ROUTERS:
return False
req_data = salt.utils.json.dumps([dict(
action=router,
method=method,
data=data,
... | [] |
Please provide a description of the function:def find_device(device=None):
'''
Find a device in Zenoss. If device not found, returns None.
Parameters:
device: (Optional) Will use the grain 'fqdn' by default
CLI Example:
salt '*' zenoss.find_device
'''
data = [{'uid': '... | [] |
Please provide a description of the function:def add_device(device=None, device_class=None, collector='localhost', prod_state=1000):
'''
A function to connect to a zenoss server and add a new device entry.
Parameters:
device: (Optional) Will use the grain 'fqdn' by default.
device_c... | [] |
Please provide a description of the function:def set_prod_state(prod_state, device=None):
'''
A function to set the prod_state in zenoss.
Parameters:
prod_state: (Required) Integer value of the state
device: (Optional) Will use the grain 'fqdn' by default.
CLI Example:
... | [] |
Please provide a description of the function:def _valid_deleted_file(path):
'''
Filters file path against unwanted directories and decides whether file is marked as deleted.
Returns:
True if file is desired deleted file, else False.
Args:
path: A string - path to file
'''
ret =... | [] |
Please provide a description of the function:def _deleted_files():
'''
Iterates over /proc/PID/maps and /proc/PID/fd links and returns list of desired deleted files.
Returns:
List of deleted files to analyze, False on failure.
'''
deleted_files = []
for proc in psutil.process_iter(): ... | [] |
Please provide a description of the function:def _format_output(kernel_restart, packages, verbose, restartable, nonrestartable, restartservicecommands,
restartinitcommands):
'''
Formats the output of the restartcheck module.
Returns:
String - formatted output.
Args:
... | [] |
Please provide a description of the function:def _kernel_versions_debian():
'''
Last installed kernel name, for Debian based systems.
Returns:
List with possible names of last installed kernel
as they are probably interpreted in output of `uname -a` command.
'''
kernel_get_s... | [] |
Please provide a description of the function:def _kernel_versions_redhat():
'''
Name of the last installed kernel, for Red Hat based systems.
Returns:
List with name of last installed kernel as it is interpreted in output of `uname -a` command.
'''
kernel_get_last = __salt__['cmd.run'](... | [] |
Please provide a description of the function:def _kernel_versions_nilrt():
'''
Last installed kernel name, for Debian based systems.
Returns:
List with possible names of last installed kernel
as they are probably interpreted in output of `uname -a` command.
'''
kver = None
... | [] |
Please provide a description of the function:def _check_timeout(start_time, timeout):
'''
Name of the last installed kernel, for Red Hat based systems.
Returns:
List with name of last installed kernel as it is interpreted in output of `uname -a` command.
'''
timeout_milisec = timeout * ... | [] |
Please provide a description of the function:def _file_changed_nilrt(full_filepath):
'''
Detect whether a file changed in an NILinuxRT system using md5sum and timestamp
files from a state directory.
Returns:
- False if md5sum/timestamp state files don't exist
- True/False depe... | [] |
Please provide a description of the function:def _sysapi_changed_nilrt():
'''
Besides the normal Linux kernel driver interfaces, NILinuxRT-supported hardware features an
extensible, plugin-based device enumeration and configuration interface named "System API".
When an installed package is extending the... | [] |
Please provide a description of the function:def restartcheck(ignorelist=None, blacklist=None, excludepid=None, **kwargs):
'''
Analyzes files openeded by running processes and seeks for packages which need to be restarted.
Args:
ignorelist: string or list of packages to be ignored
blacklist... | [] |
Please provide a description of the function:def default_vsan_policy_configured(name, policy):
'''
Configures the default VSAN policy on a vCenter.
The state assumes there is only one default VSAN policy on a vCenter.
policy
Dict representation of a policy
'''
# TODO Refactor when recur... | [] |
Please provide a description of the function:def default_storage_policy_assigned(name, policy, datastore):
'''
Assigns a default storage policy to a datastore
policy
Name of storage policy
datastore
Name of datastore
'''
log.info('Running state %s for policy \'%s\', datastore \... | [] |
Please provide a description of the function:def _get_client():
'''
Return a cloud client
'''
client = salt.cloud.CloudClient(
os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud'),
pillars=copy.deepcopy(__pillar__.get('cloud', {}))
)
return client | [] |
Please provide a description of the function:def has_instance(name, provider=None):
'''
Return true if the instance is found on a provider
CLI Example:
.. code-block:: bash
salt minionname cloud.has_instance myinstance
'''
data = get_instance(name, provider)
if data is None:
... | [] |
Please provide a description of the function:def get_instance(name, provider=None):
'''
Return details on an instance.
Similar to the cloud action show_instance
but returns only the instance details.
CLI Example:
.. code-block:: bash
salt minionname cloud.get_instance myinstance
... | [] |
Please provide a description of the function:def profile_(profile, names, vm_overrides=None, opts=None, **kwargs):
'''
Spin up an instance using Salt Cloud
CLI Example:
.. code-block:: bash
salt minionname cloud.profile my-gce-config myinstance
'''
client = _get_client()
if isinst... | [] |
Please provide a description of the function:def map_run(path=None, **kwargs):
'''
Execute a salt cloud map file
Cloud Map data can be retrieved from several sources:
- a local file (provide the path to the file to the 'path' argument)
- a JSON-formatted map directly (provide the appropriately for... | [] |
Please provide a description of the function:def action(
fun=None,
cloudmap=None,
names=None,
provider=None,
instance=None,
**kwargs):
'''
Execute a single action on the given provider/instance
CLI Example:
.. code-block:: bash
salt minionname c... | [] |
Please provide a description of the function:def create(provider, names, opts=None, **kwargs):
'''
Create an instance using Salt Cloud
CLI Example:
.. code-block:: bash
salt minionname cloud.create my-ec2-config myinstance image=ami-1624987f size='t1.micro' ssh_username=ec2-user securitygroup... | [] |
Please provide a description of the function:def volume_list(provider):
'''
List block storage volumes
CLI Example:
.. code-block:: bash
salt minionname cloud.volume_list my-nova
'''
client = _get_client()
info = client.extra_action(action='volume_list', provider=provider, names=... | [] |
Please provide a description of the function:def volume_attach(provider, names, **kwargs):
'''
Attach volume to a server
CLI Example:
.. code-block:: bash
salt minionname cloud.volume_attach my-nova myblock server_name=myserver device='/dev/xvdf'
'''
client = _get_client()
info =... | [] |
Please provide a description of the function:def network_list(provider):
'''
List private networks
CLI Example:
.. code-block:: bash
salt minionname cloud.network_list my-nova
'''
client = _get_client()
return client.extra_action(action='network_list', provider=provider, names='n... | [] |
Please provide a description of the function:def network_create(provider, names, **kwargs):
'''
Create private network
CLI Example:
.. code-block:: bash
salt minionname cloud.network_create my-nova names=['salt'] cidr='192.168.100.0/24'
'''
client = _get_client()
return client.ex... | [] |
Please provide a description of the function:def virtual_interface_list(provider, names, **kwargs):
'''
List virtual interfaces on a server
CLI Example:
.. code-block:: bash
salt minionname cloud.virtual_interface_list my-nova names=['salt-master']
'''
client = _get_client()
retu... | [] |
Please provide a description of the function:def virtual_interface_create(provider, names, **kwargs):
'''
Attach private interfaces to a server
CLI Example:
.. code-block:: bash
salt minionname cloud.virtual_interface_create my-nova names=['salt-master'] net_name='salt'
'''
client = ... | [] |
Please provide a description of the function:def show(config_file=False):
'''
Return a list of sysctl parameters for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.show
'''
roots = (
'kern',
'vm',
'vfs',
'net',
'hw',
'mach... | [] |
Please provide a description of the function:def get(name):
'''
Return a single sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.get hw.physmem
'''
cmd = 'sysctl -n {0}'.format(name)
out = __salt__['cmd.run'](cmd, python_shell=False)
return ou... | [] |
Please provide a description of the function:def persist(name, value, config='/etc/sysctl.conf'):
'''
Assign and persist a simple sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.persist net.inet.icmp.icmplim 50
'''
nlines = []
edited = False
... | [] |
Please provide a description of the function:def post_message(name,
user=None,
device=None,
message=None,
title=None,
priority=None,
expire=None,
retry=None,
sound=None,
... | [] |
Please provide a description of the function:def check_ip(addr):
'''
Check if address is a valid IP. returns True if valid, otherwise False.
CLI Example:
.. code-block:: bash
salt ns1 dig.check_ip 127.0.0.1
salt ns1 dig.check_ip 1111:2222:3333:4444:5555:6666:7777:8888
'''
try... | [] |
Please provide a description of the function:def AAAA(host, nameserver=None):
'''
Return the AAAA record for ``host``.
Always returns a list.
CLI Example:
.. code-block:: bash
salt ns1 dig.AAAA www.google.com
'''
dig = ['dig', '+short', six.text_type(host), 'AAAA']
if namese... | [] |
Please provide a description of the function:def NS(domain, resolve=True, nameserver=None):
'''
Return a list of IPs of the nameservers for ``domain``
If ``resolve`` is False, don't resolve names.
CLI Example:
.. code-block:: bash
salt ns1 dig.NS google.com
'''
dig = ['dig', '+sh... | [] |
Please provide a description of the function:def SPF(domain, record='SPF', nameserver=None):
'''
Return the allowed IPv4 ranges in the SPF record for ``domain``.
If record is ``SPF`` and the SPF record is empty, the TXT record will be
searched automatically. If you know the domain uses TXT and not SPF,... | [] |
Please provide a description of the function:def MX(domain, resolve=False, nameserver=None):
'''
Return a list of lists for the MX of ``domain``.
If the ``resolve`` argument is True, resolve IPs for the servers.
It's limited to one IP, because although in practice it's very rarely a
round robin, i... | [] |
Please provide a description of the function:def TXT(host, nameserver=None):
'''
Return the TXT record for ``host``.
Always returns a list.
CLI Example:
.. code-block:: bash
salt ns1 dig.TXT google.com
'''
dig = ['dig', '+short', six.text_type(host), 'TXT']
if nameserver is ... | [] |
Please provide a description of the function:def show(config_file=False):
'''
Return a list of sysctl parameters for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.show
'''
roots = (
'compat',
'debug',
'dev',
'hptmv',
'hw',
... | [] |
Please provide a description of the function:def assign(name, value):
'''
Assign a single sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.assign net.inet.icmp.icmplim 50
'''
ret = {}
cmd = 'sysctl {0}="{1}"'.format(name, value)
data = __salt_... | [] |
Please provide a description of the function:def persist(name, value, config='/etc/sysctl.conf'):
'''
Assign and persist a simple sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.persist net.inet.icmp.icmplim 50
salt '*' sysctl.persist coretemp_load N... | [] |
Please provide a description of the function:def _workout_filename(filename):
'''
Recursively workout the file name from an augeas change
'''
if os.path.isfile(filename) or filename == '/':
if filename == '/':
filename = None
return filename
else:
return _workout_... | [] |
Please provide a description of the function:def _check_filepath(changes):
'''
Ensure all changes are fully qualified and affect only one file.
This ensures that the diff output works and a state change is not
incorrectly reported.
'''
filename = None
for change_ in changes:
try:
... | [] |
Please provide a description of the function:def change(name, context=None, changes=None, lens=None,
load_path=None, **kwargs):
'''
.. versionadded:: 2014.7.0
This state replaces :py:func:`~salt.states.augeas.setvalue`.
Issue changes to Augeas, optionally for a specific context, with a
spe... | [] |
Please provide a description of the function:def _connect(host=None, port=None, db=None, password=None):
'''
Returns an instance of the redis client
'''
if not host:
host = __salt__['config.option']('redis.host')
if not port:
port = __salt__['config.option']('redis.port')
if not ... | [] |
Please provide a description of the function:def _sconnect(host=None, port=None, password=None):
'''
Returns an instance of the redis client
'''
if host is None:
host = __salt__['config.option']('redis_sentinel.host', 'localhost')
if port is None:
port = __salt__['config.option']('re... | [] |
Please provide a description of the function:def bgrewriteaof(host=None, port=None, db=None, password=None):
'''
Asynchronously rewrite the append-only file
CLI Example:
.. code-block:: bash
salt '*' redis.bgrewriteaof
'''
server = _connect(host, port, db, password)
return server.... | [] |
Please provide a description of the function:def bgsave(host=None, port=None, db=None, password=None):
'''
Asynchronously save the dataset to disk
CLI Example:
.. code-block:: bash
salt '*' redis.bgsave
'''
server = _connect(host, port, db, password)
return server.bgsave() | [] |
Please provide a description of the function:def config_get(pattern='*', host=None, port=None, db=None, password=None):
'''
Get redis server configuration values
CLI Example:
.. code-block:: bash
salt '*' redis.config_get
salt '*' redis.config_get port
'''
server = _connect(ho... | [] |
Please provide a description of the function:def config_set(name, value, host=None, port=None, db=None, password=None):
'''
Set redis server configuration values
CLI Example:
.. code-block:: bash
salt '*' redis.config_set masterauth luv_kittens
'''
server = _connect(host, port, db, pa... | [] |
Please provide a description of the function:def dbsize(host=None, port=None, db=None, password=None):
'''
Return the number of keys in the selected database
CLI Example:
.. code-block:: bash
salt '*' redis.dbsize
'''
server = _connect(host, port, db, password)
return server.dbsiz... | [] |
Please provide a description of the function:def delete(*keys, **connection_args):
'''
Deletes the keys from redis, returns number of keys deleted
CLI Example:
.. code-block:: bash
salt '*' redis.delete foo
'''
# Get connection args from keywords if set
conn_args = {}
for arg ... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.