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
file_exists
.. versionadded:: 2016.3.0 This is a master-only function. Calling from the minion is not supported. Use the given path and search relative to the pillar environments to see if a file exists at that path. If the ``saltenv`` argument is given, restrict search to that environment only. Will on...
salt/modules/pillar.py
def file_exists(path, saltenv=None): ''' .. versionadded:: 2016.3.0 This is a master-only function. Calling from the minion is not supported. Use the given path and search relative to the pillar environments to see if a file exists at that path. If the ``saltenv`` argument is given, restrict ...
def file_exists(path, saltenv=None): ''' .. versionadded:: 2016.3.0 This is a master-only function. Calling from the minion is not supported. Use the given path and search relative to the pillar environments to see if a file exists at that path. If the ``saltenv`` argument is given, restrict ...
[ "..", "versionadded", "::", "2016", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pillar.py#L549-L594
[ "def", "file_exists", "(", "path", ",", "saltenv", "=", "None", ")", ":", "pillar_roots", "=", "__opts__", ".", "get", "(", "'pillar_roots'", ")", "if", "not", "pillar_roots", ":", "raise", "CommandExecutionError", "(", "'No pillar_roots found. Are you running '", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
filter_by
.. versionadded:: 2017.7.0 Look up the given pillar in a given dictionary and return the result :param lookup_dict: A dictionary, keyed by a pillar, containing a value or values relevant to systems matching that pillar. For example, a key could be a pillar for a role and the value could the na...
salt/modules/pillar.py
def filter_by(lookup_dict, pillar, merge=None, default='default', base=None): ''' .. versionadded:: 2017.7.0 Look up the given pillar in a given dictionary and return the result :param lookup_dict: A dictionary, keyed by a pillar, containing a va...
def filter_by(lookup_dict, pillar, merge=None, default='default', base=None): ''' .. versionadded:: 2017.7.0 Look up the given pillar in a given dictionary and return the result :param lookup_dict: A dictionary, keyed by a pillar, containing a va...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pillar.py#L601-L658
[ "def", "filter_by", "(", "lookup_dict", ",", "pillar", ",", "merge", "=", "None", ",", "default", "=", "'default'", ",", "base", "=", "None", ")", ":", "return", "salt", ".", "utils", ".", "data", ".", "filter_by", "(", "lookup_dict", "=", "lookup_dict",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_system
Get Pure Storage FlashArray configuration 1) From the minion config pure_tags: fa: san_ip: management vip or hostname for the FlashArray api_token: A valid api token for the FlashArray being managed 2) From environment (PUREFA_IP and PUREFA_API) 3) From the pillar ...
salt/modules/purefa.py
def _get_system(): ''' Get Pure Storage FlashArray configuration 1) From the minion config pure_tags: fa: san_ip: management vip or hostname for the FlashArray api_token: A valid api token for the FlashArray being managed 2) From environment (PUREFA_IP and PURE...
def _get_system(): ''' Get Pure Storage FlashArray configuration 1) From the minion config pure_tags: fa: san_ip: management vip or hostname for the FlashArray api_token: A valid api token for the FlashArray being managed 2) From environment (PUREFA_IP and PURE...
[ "Get", "Pure", "Storage", "FlashArray", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefa.py#L94-L139
[ "def", "_get_system", "(", ")", ":", "agent", "=", "{", "'base'", ":", "USER_AGENT_BASE", ",", "'class'", ":", "__name__", ",", "'version'", ":", "VERSION", ",", "'platform'", ":", "platform", ".", "platform", "(", ")", "}", "user_agent", "=", "'{base} {cl...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_snapshot
Private function to check snapshot
salt/modules/purefa.py
def _get_snapshot(name, suffix, array): '''Private function to check snapshot''' snapshot = name + '.' + suffix try: for snap in array.get_volume(name, snap=True): if snap['name'] == snapshot: return snapshot except purestorage.PureError: return None
def _get_snapshot(name, suffix, array): '''Private function to check snapshot''' snapshot = name + '.' + suffix try: for snap in array.get_volume(name, snap=True): if snap['name'] == snapshot: return snapshot except purestorage.PureError: return None
[ "Private", "function", "to", "check", "snapshot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefa.py#L150-L158
[ "def", "_get_snapshot", "(", "name", ",", "suffix", ",", "array", ")", ":", "snapshot", "=", "name", "+", "'.'", "+", "suffix", "try", ":", "for", "snap", "in", "array", ".", "get_volume", "(", "name", ",", "snap", "=", "True", ")", ":", "if", "sna...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_pgroup
Private function to check protection group
salt/modules/purefa.py
def _get_pgroup(name, array): '''Private function to check protection group''' pgroup = None for temp in array.list_pgroups(): if temp['name'] == name: pgroup = temp break return pgroup
def _get_pgroup(name, array): '''Private function to check protection group''' pgroup = None for temp in array.list_pgroups(): if temp['name'] == name: pgroup = temp break return pgroup
[ "Private", "function", "to", "check", "protection", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefa.py#L169-L176
[ "def", "_get_pgroup", "(", "name", ",", "array", ")", ":", "pgroup", "=", "None", "for", "temp", "in", "array", ".", "list_pgroups", "(", ")", ":", "if", "temp", "[", "'name'", "]", "==", "name", ":", "pgroup", "=", "temp", "break", "return", "pgroup...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_hgroup
Private function to check hostgroup
salt/modules/purefa.py
def _get_hgroup(name, array): '''Private function to check hostgroup''' hostgroup = None for temp in array.list_hgroups(): if temp['name'] == name: hostgroup = temp break return hostgroup
def _get_hgroup(name, array): '''Private function to check hostgroup''' hostgroup = None for temp in array.list_hgroups(): if temp['name'] == name: hostgroup = temp break return hostgroup
[ "Private", "function", "to", "check", "hostgroup" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefa.py#L187-L194
[ "def", "_get_hgroup", "(", "name", ",", "array", ")", ":", "hostgroup", "=", "None", "for", "temp", "in", "array", ".", "list_hgroups", "(", ")", ":", "if", "temp", "[", "'name'", "]", "==", "name", ":", "hostgroup", "=", "temp", "break", "return", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_host
Private function to check host
salt/modules/purefa.py
def _get_host(name, array): '''Private function to check host''' host = None for temp in array.list_hosts(): if temp['name'] == name: host = temp break return host
def _get_host(name, array): '''Private function to check host''' host = None for temp in array.list_hosts(): if temp['name'] == name: host = temp break return host
[ "Private", "function", "to", "check", "host" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefa.py#L197-L204
[ "def", "_get_host", "(", "name", ",", "array", ")", ":", "host", "=", "None", "for", "temp", "in", "array", ".", "list_hosts", "(", ")", ":", "if", "temp", "[", "'name'", "]", "==", "name", ":", "host", "=", "temp", "break", "return", "host" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure the SNS topic exists. name Name of the SNS topic. subscriptions List of SNS subscriptions. Each subscription is a dictionary with a protocol and endpoint key: .. code-block:: python [ {'protocol': 'https', 'endpoint': 'https://www.example.com/s...
salt/states/boto_sns.py
def present( name, subscriptions=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the SNS topic exists. name Name of the SNS topic. subscriptions List of SNS subscriptions. Each subscription is a dictionary with...
def present( name, subscriptions=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the SNS topic exists. name Name of the SNS topic. subscriptions List of SNS subscriptions. Each subscription is a dictionary with...
[ "Ensure", "the", "SNS", "topic", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_sns.py#L70-L207
[ "def", "present", "(", "name", ",", "subscriptions", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure the named sns topic is deleted. name Name of the SNS topic. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a pillar key (string) that contains a dict with r...
salt/states/boto_sns.py
def absent( name, region=None, key=None, keyid=None, profile=None, unsubscribe=False): ''' Ensure the named sns topic is deleted. name Name of the SNS topic. region Region to connect to. key Secret key to be used. keyid ...
def absent( name, region=None, key=None, keyid=None, profile=None, unsubscribe=False): ''' Ensure the named sns topic is deleted. name Name of the SNS topic. region Region to connect to. key Secret key to be used. keyid ...
[ "Ensure", "the", "named", "sns", "topic", "is", "deleted", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_sns.py#L210-L287
[ "def", "absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "unsubscribe", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_locations
List all available locations
salt/cloud/clouds/softlayer_hw.py
def avail_locations(call=None): ''' List all available locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} conn = get_conn(ser...
def avail_locations(call=None): ''' List all available locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} conn = get_conn(ser...
[ "List", "all", "available", "locations" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer_hw.py#L117-L144
[ "def", "avail_locations", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_locations function must be called with '", "'-f or --function, or with the --list-locations option'", ")", "ret", "=", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_images
Return a dict of all available VM images on the cloud provider.
salt/cloud/clouds/softlayer_hw.py
def avail_images(call=None): ''' Return a dict of all available VM images on the cloud provider. ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) ret = ...
def avail_images(call=None): ''' Return a dict of all available VM images on the cloud provider. ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) ret = ...
[ "Return", "a", "dict", "of", "all", "available", "VM", "images", "on", "the", "cloud", "provider", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer_hw.py#L171-L190
[ "def", "avail_images", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", "ret", "=", "{", "}", "c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single VM from a data dict
salt/cloud/clouds/softlayer_hw.py
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'sof...
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'sof...
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer_hw.py#L212-L425
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'softl...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
Return a list of the VMs that are on the provider
salt/cloud/clouds/softlayer_hw.py
def list_nodes_full(mask='mask[id, hostname, primaryIpAddress, \ primaryBackendIpAddress, processorPhysicalCoreAmount, memoryCount]', call=None): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_...
def list_nodes_full(mask='mask[id, hostname, primaryIpAddress, \ primaryBackendIpAddress, processorPhysicalCoreAmount, memoryCount]', call=None): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_...
[ "Return", "a", "list", "of", "the", "VMs", "that", "are", "on", "the", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer_hw.py#L428-L446
[ "def", "list_nodes_full", "(", "mask", "=", "'mask[id, hostname, primaryIpAddress, \\\n primaryBackendIpAddress, processorPhysicalCoreAmount, memoryCount]'", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_pricing
Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-softlayerhw-config profile=my-profile If pricing sources have not been cached, they will be downloaded. Once they have be...
salt/cloud/clouds/softlayer_hw.py
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-softlayerhw-config profile=my-profile If pricing sources have not been ...
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-softlayerhw-config profile=my-profile If pricing sources have not been ...
[ "Show", "pricing", "for", "a", "particular", "profile", ".", "This", "is", "only", "an", "estimate", "based", "on", "unofficial", "pricing", "sources", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer_hw.py#L566-L616
[ "def", "show_pricing", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "profile", "=", "__opts__", "[", "'profiles'", "]", ".", "get", "(", "kwargs", "[", "'profile'", "]", ",", "{", "}", ")", "if", "not", "profile", ":", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_all_prices
Return a dict of all prices on the cloud provider.
salt/cloud/clouds/softlayer_hw.py
def show_all_prices(call=None, kwargs=None): ''' Return a dict of all prices on the cloud provider. ''' if call == 'action': raise SaltCloudSystemExit( 'The show_all_prices function must be called with -f or --function.' ) if kwargs is None: kwargs = {} conn...
def show_all_prices(call=None, kwargs=None): ''' Return a dict of all prices on the cloud provider. ''' if call == 'action': raise SaltCloudSystemExit( 'The show_all_prices function must be called with -f or --function.' ) if kwargs is None: kwargs = {} conn...
[ "Return", "a", "dict", "of", "all", "prices", "on", "the", "cloud", "provider", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer_hw.py#L619-L643
[ "def", "show_all_prices", "(", "call", "=", "None", ",", "kwargs", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_all_prices function must be called with -f or --function.'", ")", "if", "kwargs", "is", "No...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_all_categories
Return a dict of all available categories on the cloud provider. .. versionadded:: 2016.3.0
salt/cloud/clouds/softlayer_hw.py
def show_all_categories(call=None): ''' Return a dict of all available categories on the cloud provider. .. versionadded:: 2016.3.0 ''' if call == 'action': raise SaltCloudSystemExit( 'The show_all_categories function must be called with -f or --function.' ) conn = ...
def show_all_categories(call=None): ''' Return a dict of all available categories on the cloud provider. .. versionadded:: 2016.3.0 ''' if call == 'action': raise SaltCloudSystemExit( 'The show_all_categories function must be called with -f or --function.' ) conn = ...
[ "Return", "a", "dict", "of", "all", "available", "categories", "on", "the", "cloud", "provider", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/softlayer_hw.py#L646-L663
[ "def", "show_all_categories", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_all_categories function must be called with -f or --function.'", ")", "conn", "=", "get_conn", "(", "service", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_connect
wrap authentication credentials here
salt/modules/mysql.py
def _connect(**kwargs): ''' wrap authentication credentials here ''' connargs = dict() def _connarg(name, key=None, get_opts=True): ''' Add key to connargs, only if name exists in our kwargs or, if get_opts is true, as mysql.<name> in __opts__ or __pillar__ If get_o...
def _connect(**kwargs): ''' wrap authentication credentials here ''' connargs = dict() def _connarg(name, key=None, get_opts=True): ''' Add key to connargs, only if name exists in our kwargs or, if get_opts is true, as mysql.<name> in __opts__ or __pillar__ If get_o...
[ "wrap", "authentication", "credentials", "here" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L329-L400
[ "def", "_connect", "(", "*", "*", "kwargs", ")", ":", "connargs", "=", "dict", "(", ")", "def", "_connarg", "(", "name", ",", "key", "=", "None", ",", "get_opts", "=", "True", ")", ":", "'''\n Add key to connargs, only if name exists in our kwargs or,\n ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
quote_identifier
r''' Return an identifier name (column, table, database, etc) escaped for MySQL This means surrounded by "`" character and escaping this character inside. It also means doubling the '%' character for MySQLdb internal usage. :param identifier: the table, column or database identifier :param for_gr...
salt/modules/mysql.py
def quote_identifier(identifier, for_grants=False): r''' Return an identifier name (column, table, database, etc) escaped for MySQL This means surrounded by "`" character and escaping this character inside. It also means doubling the '%' character for MySQLdb internal usage. :param identifier: the...
def quote_identifier(identifier, for_grants=False): r''' Return an identifier name (column, table, database, etc) escaped for MySQL This means surrounded by "`" character and escaping this character inside. It also means doubling the '%' character for MySQLdb internal usage. :param identifier: the...
[ "r", "Return", "an", "identifier", "name", "(", "column", "table", "database", "etc", ")", "escaped", "for", "MySQL" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L562-L587
[ "def", "quote_identifier", "(", "identifier", ",", "for_grants", "=", "False", ")", ":", "if", "for_grants", ":", "return", "'`'", "+", "identifier", ".", "replace", "(", "'`'", ",", "'``'", ")", ".", "replace", "(", "'_'", ",", "r'\\_'", ")", ".", "re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_execute
Internal wrapper around MySQLdb cursor.execute() function MySQLDb does not apply the same filters when arguments are used with the query. For example '%' characters on the query must be encoded as '%%' and will be restored as '%' when arguments are applied. But when there're no arguments the '%%' is no...
salt/modules/mysql.py
def _execute(cur, qry, args=None): ''' Internal wrapper around MySQLdb cursor.execute() function MySQLDb does not apply the same filters when arguments are used with the query. For example '%' characters on the query must be encoded as '%%' and will be restored as '%' when arguments are applied. Bu...
def _execute(cur, qry, args=None): ''' Internal wrapper around MySQLdb cursor.execute() function MySQLDb does not apply the same filters when arguments are used with the query. For example '%' characters on the query must be encoded as '%%' and will be restored as '%' when arguments are applied. Bu...
[ "Internal", "wrapper", "around", "MySQLdb", "cursor", ".", "execute", "()", "function" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L590-L607
[ "def", "_execute", "(", "cur", ",", "qry", ",", "args", "=", "None", ")", ":", "if", "args", "is", "None", "or", "args", "==", "{", "}", ":", "qry", "=", "qry", ".", "replace", "(", "'%%'", ",", "'%'", ")", "log", ".", "debug", "(", "'Doing que...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
query
Run an arbitrary SQL query and return the results or the number of affected rows. CLI Example: .. code-block:: bash salt '*' mysql.query mydb "UPDATE mytable set myfield=1 limit 1" Return data: .. code-block:: python {'query time': {'human': '39.0ms', 'raw': '0.03899'}, 'rows a...
salt/modules/mysql.py
def query(database, query, **connection_args): ''' Run an arbitrary SQL query and return the results or the number of affected rows. CLI Example: .. code-block:: bash salt '*' mysql.query mydb "UPDATE mytable set myfield=1 limit 1" Return data: .. code-block:: python {'...
def query(database, query, **connection_args): ''' Run an arbitrary SQL query and return the results or the number of affected rows. CLI Example: .. code-block:: bash salt '*' mysql.query mydb "UPDATE mytable set myfield=1 limit 1" Return data: .. code-block:: python {'...
[ "Run", "an", "arbitrary", "SQL", "query", "and", "return", "the", "results", "or", "the", "number", "of", "affected", "rows", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L610-L739
[ "def", "query", "(", "database", ",", "query", ",", "*", "*", "connection_args", ")", ":", "# Doesn't do anything about sql warnings, e.g. empty values on an insert.", "# I don't think it handles multiple queries at once, so adding \"commit\"", "# might not work.", "# The following 3 l...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
file_query
Run an arbitrary SQL query from the specified file and return the the number of affected rows. .. versionadded:: 2017.7.0 database database to run script inside file_name File name of the script. This can be on the minion, or a file that is reachable by the fileserver CLI Exam...
salt/modules/mysql.py
def file_query(database, file_name, **connection_args): ''' Run an arbitrary SQL query from the specified file and return the the number of affected rows. .. versionadded:: 2017.7.0 database database to run script inside file_name File name of the script. This can be on the...
def file_query(database, file_name, **connection_args): ''' Run an arbitrary SQL query from the specified file and return the the number of affected rows. .. versionadded:: 2017.7.0 database database to run script inside file_name File name of the script. This can be on the...
[ "Run", "an", "arbitrary", "SQL", "query", "from", "the", "specified", "file", "and", "return", "the", "the", "number", "of", "affected", "rows", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L742-L813
[ "def", "file_query", "(", "database", ",", "file_name", ",", "*", "*", "connection_args", ")", ":", "if", "any", "(", "file_name", ".", "startswith", "(", "proto", ")", "for", "proto", "in", "(", "'salt://'", ",", "'http://'", ",", "'https://'", ",", "'s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
Return the status of a MySQL server using the output from the ``SHOW STATUS`` query. CLI Example: .. code-block:: bash salt '*' mysql.status
salt/modules/mysql.py
def status(**connection_args): ''' Return the status of a MySQL server using the output from the ``SHOW STATUS`` query. CLI Example: .. code-block:: bash salt '*' mysql.status ''' dbc = _connect(**connection_args) if dbc is None: return {} cur = dbc.cursor() qr...
def status(**connection_args): ''' Return the status of a MySQL server using the output from the ``SHOW STATUS`` query. CLI Example: .. code-block:: bash salt '*' mysql.status ''' dbc = _connect(**connection_args) if dbc is None: return {} cur = dbc.cursor() qr...
[ "Return", "the", "status", "of", "a", "MySQL", "server", "using", "the", "output", "from", "the", "SHOW", "STATUS", "query", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L816-L844
[ "def", "status", "(", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "{", "}", "cur", "=", "dbc", ".", "cursor", "(", ")", "qry", "=", "'SHOW STATUS'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Return the version of a MySQL server using the output from the ``SELECT VERSION()`` query. CLI Example: .. code-block:: bash salt '*' mysql.version
salt/modules/mysql.py
def version(**connection_args): ''' Return the version of a MySQL server using the output from the ``SELECT VERSION()`` query. CLI Example: .. code-block:: bash salt '*' mysql.version ''' dbc = _connect(**connection_args) if dbc is None: return '' cur = dbc.cursor(...
def version(**connection_args): ''' Return the version of a MySQL server using the output from the ``SELECT VERSION()`` query. CLI Example: .. code-block:: bash salt '*' mysql.version ''' dbc = _connect(**connection_args) if dbc is None: return '' cur = dbc.cursor(...
[ "Return", "the", "version", "of", "a", "MySQL", "server", "using", "the", "output", "from", "the", "SELECT", "VERSION", "()", "query", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L847-L874
[ "def", "version", "(", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "''", "cur", "=", "dbc", ".", "cursor", "(", ")", "qry", "=", "'SELECT VERSION()'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
slave_lag
Return the number of seconds that a slave SQL server is lagging behind the master, if the host is not a slave it will return -1. If the server is configured to be a slave for replication but slave IO is not running then -2 will be returned. If there was an error connecting to the database or checking t...
salt/modules/mysql.py
def slave_lag(**connection_args): ''' Return the number of seconds that a slave SQL server is lagging behind the master, if the host is not a slave it will return -1. If the server is configured to be a slave for replication but slave IO is not running then -2 will be returned. If there was an erro...
def slave_lag(**connection_args): ''' Return the number of seconds that a slave SQL server is lagging behind the master, if the host is not a slave it will return -1. If the server is configured to be a slave for replication but slave IO is not running then -2 will be returned. If there was an erro...
[ "Return", "the", "number", "of", "seconds", "that", "a", "slave", "SQL", "server", "is", "lagging", "behind", "the", "master", "if", "the", "host", "is", "not", "a", "slave", "it", "will", "return", "-", "1", ".", "If", "the", "server", "is", "configur...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L877-L916
[ "def", "slave_lag", "(", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "-", "3", "cur", "=", "dbc", ".", "cursor", "(", "MySQLdb", ".", "cursors", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
free_slave
Frees a slave from its master. This is a WIP, do not use. CLI Example: .. code-block:: bash salt '*' mysql.free_slave
salt/modules/mysql.py
def free_slave(**connection_args): ''' Frees a slave from its master. This is a WIP, do not use. CLI Example: .. code-block:: bash salt '*' mysql.free_slave ''' slave_db = _connect(**connection_args) if slave_db is None: return '' slave_cur = slave_db.cursor(MySQLdb.c...
def free_slave(**connection_args): ''' Frees a slave from its master. This is a WIP, do not use. CLI Example: .. code-block:: bash salt '*' mysql.free_slave ''' slave_db = _connect(**connection_args) if slave_db is None: return '' slave_cur = slave_db.cursor(MySQLdb.c...
[ "Frees", "a", "slave", "from", "its", "master", ".", "This", "is", "a", "WIP", "do", "not", "use", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L919-L961
[ "def", "free_slave", "(", "*", "*", "connection_args", ")", ":", "slave_db", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "slave_db", "is", "None", ":", "return", "''", "slave_cur", "=", "slave_db", ".", "cursor", "(", "MySQLdb", ".", "c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_list
Return a list of databases of a MySQL server using the output from the ``SHOW DATABASES`` query. CLI Example: .. code-block:: bash salt '*' mysql.db_list
salt/modules/mysql.py
def db_list(**connection_args): ''' Return a list of databases of a MySQL server using the output from the ``SHOW DATABASES`` query. CLI Example: .. code-block:: bash salt '*' mysql.db_list ''' dbc = _connect(**connection_args) if dbc is None: return [] cur = dbc.c...
def db_list(**connection_args): ''' Return a list of databases of a MySQL server using the output from the ``SHOW DATABASES`` query. CLI Example: .. code-block:: bash salt '*' mysql.db_list ''' dbc = _connect(**connection_args) if dbc is None: return [] cur = dbc.c...
[ "Return", "a", "list", "of", "databases", "of", "a", "MySQL", "server", "using", "the", "output", "from", "the", "SHOW", "DATABASES", "query", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L965-L995
[ "def", "db_list", "(", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "[", "]", "cur", "=", "dbc", ".", "cursor", "(", ")", "qry", "=", "'SHOW DATABASES'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
alter_db
Modify database using ``ALTER DATABASE %(dbname)s CHARACTER SET %(charset)s COLLATE %(collation)s;`` query. CLI Example: .. code-block:: bash salt '*' mysql.alter_db testdb charset='latin1'
salt/modules/mysql.py
def alter_db(name, character_set=None, collate=None, **connection_args): ''' Modify database using ``ALTER DATABASE %(dbname)s CHARACTER SET %(charset)s COLLATE %(collation)s;`` query. CLI Example: .. code-block:: bash salt '*' mysql.alter_db testdb charset='latin1' ''' dbc = _con...
def alter_db(name, character_set=None, collate=None, **connection_args): ''' Modify database using ``ALTER DATABASE %(dbname)s CHARACTER SET %(charset)s COLLATE %(collation)s;`` query. CLI Example: .. code-block:: bash salt '*' mysql.alter_db testdb charset='latin1' ''' dbc = _con...
[ "Modify", "database", "using", "ALTER", "DATABASE", "%", "(", "dbname", ")", "s", "CHARACTER", "SET", "%", "(", "charset", ")", "s", "COLLATE", "%", "(", "collation", ")", "s", ";", "query", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L998-L1019
[ "def", "alter_db", "(", "name", ",", "character_set", "=", "None", ",", "collate", "=", "None", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_get
Return a list of databases of a MySQL server using the output from the ``SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='dbname';`` query. CLI Example: .. code-block:: bash salt '*' mysql.db_get test
salt/modules/mysql.py
def db_get(name, **connection_args): ''' Return a list of databases of a MySQL server using the output from the ``SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='dbname';`` query. CLI Example: .. code-block:: bash salt '*' ...
def db_get(name, **connection_args): ''' Return a list of databases of a MySQL server using the output from the ``SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='dbname';`` query. CLI Example: .. code-block:: bash salt '*' ...
[ "Return", "a", "list", "of", "databases", "of", "a", "MySQL", "server", "using", "the", "output", "from", "the", "SELECT", "DEFAULT_CHARACTER_SET_NAME", "DEFAULT_COLLATION_NAME", "FROM", "INFORMATION_SCHEMA", ".", "SCHEMATA", "WHERE", "SCHEMA_NAME", "=", "dbname", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1022-L1046
[ "def", "db_get", "(", "name", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "[", "]", "cur", "=", "dbc", ".", "cursor", "(", ")", "qry", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_tables
Shows the tables in the given MySQL database (if exists) CLI Example: .. code-block:: bash salt '*' mysql.db_tables 'database'
salt/modules/mysql.py
def db_tables(name, **connection_args): ''' Shows the tables in the given MySQL database (if exists) CLI Example: .. code-block:: bash salt '*' mysql.db_tables 'database' ''' if not db_exists(name, **connection_args): log.info('Database \'%s\' does not exist', name) re...
def db_tables(name, **connection_args): ''' Shows the tables in the given MySQL database (if exists) CLI Example: .. code-block:: bash salt '*' mysql.db_tables 'database' ''' if not db_exists(name, **connection_args): log.info('Database \'%s\' does not exist', name) re...
[ "Shows", "the", "tables", "in", "the", "given", "MySQL", "database", "(", "if", "exists", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1049-L1083
[ "def", "db_tables", "(", "name", ",", "*", "*", "connection_args", ")", ":", "if", "not", "db_exists", "(", "name", ",", "*", "*", "connection_args", ")", ":", "log", ".", "info", "(", "'Database \\'%s\\' does not exist'", ",", "name", ")", "return", "Fals...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_exists
Checks if a database exists on the MySQL server. CLI Example: .. code-block:: bash salt '*' mysql.db_exists 'dbname'
salt/modules/mysql.py
def db_exists(name, **connection_args): ''' Checks if a database exists on the MySQL server. CLI Example: .. code-block:: bash salt '*' mysql.db_exists 'dbname' ''' dbc = _connect(**connection_args) if dbc is None: return False cur = dbc.cursor() # Warn: here db id...
def db_exists(name, **connection_args): ''' Checks if a database exists on the MySQL server. CLI Example: .. code-block:: bash salt '*' mysql.db_exists 'dbname' ''' dbc = _connect(**connection_args) if dbc is None: return False cur = dbc.cursor() # Warn: here db id...
[ "Checks", "if", "a", "database", "exists", "on", "the", "MySQL", "server", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1086-L1113
[ "def", "db_exists", "(", "name", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "False", "cur", "=", "dbc", ".", "cursor", "(", ")", "# Warn: here db ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_create
Adds a databases to the MySQL server. name The name of the database to manage character_set The character set, if left empty the MySQL default will be used collate The collation, if left empty the MySQL default will be used CLI Example: .. code-block:: bash salt...
salt/modules/mysql.py
def db_create(name, character_set=None, collate=None, **connection_args): ''' Adds a databases to the MySQL server. name The name of the database to manage character_set The character set, if left empty the MySQL default will be used collate The collation, if left empty th...
def db_create(name, character_set=None, collate=None, **connection_args): ''' Adds a databases to the MySQL server. name The name of the database to manage character_set The character set, if left empty the MySQL default will be used collate The collation, if left empty th...
[ "Adds", "a", "databases", "to", "the", "MySQL", "server", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1116-L1166
[ "def", "db_create", "(", "name", ",", "character_set", "=", "None", ",", "collate", "=", "None", ",", "*", "*", "connection_args", ")", ":", "# check if db exists", "if", "db_exists", "(", "name", ",", "*", "*", "connection_args", ")", ":", "log", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_remove
Removes a databases from the MySQL server. CLI Example: .. code-block:: bash salt '*' mysql.db_remove 'dbname'
salt/modules/mysql.py
def db_remove(name, **connection_args): ''' Removes a databases from the MySQL server. CLI Example: .. code-block:: bash salt '*' mysql.db_remove 'dbname' ''' # check if db exists if not db_exists(name, **connection_args): log.info('DB \'%s\' does not exist', name) ...
def db_remove(name, **connection_args): ''' Removes a databases from the MySQL server. CLI Example: .. code-block:: bash salt '*' mysql.db_remove 'dbname' ''' # check if db exists if not db_exists(name, **connection_args): log.info('DB \'%s\' does not exist', name) ...
[ "Removes", "a", "databases", "from", "the", "MySQL", "server", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1169-L1209
[ "def", "db_remove", "(", "name", ",", "*", "*", "connection_args", ")", ":", "# check if db exists", "if", "not", "db_exists", "(", "name", ",", "*", "*", "connection_args", ")", ":", "log", ".", "info", "(", "'DB \\'%s\\' does not exist'", ",", "name", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_list
Return a list of users on a MySQL server CLI Example: .. code-block:: bash salt '*' mysql.user_list
salt/modules/mysql.py
def user_list(**connection_args): ''' Return a list of users on a MySQL server CLI Example: .. code-block:: bash salt '*' mysql.user_list ''' dbc = _connect(**connection_args) if dbc is None: return [] cur = dbc.cursor(MySQLdb.cursors.DictCursor) try: qry =...
def user_list(**connection_args): ''' Return a list of users on a MySQL server CLI Example: .. code-block:: bash salt '*' mysql.user_list ''' dbc = _connect(**connection_args) if dbc is None: return [] cur = dbc.cursor(MySQLdb.cursors.DictCursor) try: qry =...
[ "Return", "a", "list", "of", "users", "on", "a", "MySQL", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1213-L1237
[ "def", "user_list", "(", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "[", "]", "cur", "=", "dbc", ".", "cursor", "(", "MySQLdb", ".", "cursors", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_exists
Checks if a user exists on the MySQL server. A login can be checked to see if passwordless login is permitted by omitting ``password`` and ``password_hash``, and using ``passwordless=True``. .. versionadded:: 0.16.2 The ``passwordless`` option was added. CLI Example: .. code-block:: bash ...
salt/modules/mysql.py
def user_exists(user, host='localhost', password=None, password_hash=None, passwordless=False, unix_socket=False, password_column=None, **connection_args): ''' Checks if a user exists on the MySQL ser...
def user_exists(user, host='localhost', password=None, password_hash=None, passwordless=False, unix_socket=False, password_column=None, **connection_args): ''' Checks if a user exists on the MySQL ser...
[ "Checks", "if", "a", "user", "exists", "on", "the", "MySQL", "server", ".", "A", "login", "can", "be", "checked", "to", "see", "if", "passwordless", "login", "is", "permitted", "by", "omitting", "password", "and", "password_hash", "and", "using", "passwordle...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1240-L1325
[ "def", "user_exists", "(", "user", ",", "host", "=", "'localhost'", ",", "password", "=", "None", ",", "password_hash", "=", "None", ",", "passwordless", "=", "False", ",", "unix_socket", "=", "False", ",", "password_column", "=", "None", ",", "*", "*", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_info
Get full info on a MySQL user CLI Example: .. code-block:: bash salt '*' mysql.user_info root localhost
salt/modules/mysql.py
def user_info(user, host='localhost', **connection_args): ''' Get full info on a MySQL user CLI Example: .. code-block:: bash salt '*' mysql.user_info root localhost ''' dbc = _connect(**connection_args) if dbc is None: return False cur = dbc.cursor(MySQLdb.cursors.Di...
def user_info(user, host='localhost', **connection_args): ''' Get full info on a MySQL user CLI Example: .. code-block:: bash salt '*' mysql.user_info root localhost ''' dbc = _connect(**connection_args) if dbc is None: return False cur = dbc.cursor(MySQLdb.cursors.Di...
[ "Get", "full", "info", "on", "a", "MySQL", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1328-L1358
[ "def", "user_info", "(", "user", ",", "host", "=", "'localhost'", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "False", "cur", "=", "dbc", ".", "c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_create
Creates a MySQL user host Host for which this user/password combo applies password The password to use for the new user. Will take precedence over the ``password_hash`` option if both are specified. password_hash The password in hashed form. Be sure to quote the password b...
salt/modules/mysql.py
def user_create(user, host='localhost', password=None, password_hash=None, allow_passwordless=False, unix_socket=False, password_column=None, **connection_args): ''' Creates a MySQL user host ...
def user_create(user, host='localhost', password=None, password_hash=None, allow_passwordless=False, unix_socket=False, password_column=None, **connection_args): ''' Creates a MySQL user host ...
[ "Creates", "a", "MySQL", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1361-L1471
[ "def", "user_create", "(", "user", ",", "host", "=", "'localhost'", ",", "password", "=", "None", ",", "password_hash", "=", "None", ",", "allow_passwordless", "=", "False", ",", "unix_socket", "=", "False", ",", "password_column", "=", "None", ",", "*", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_chpass
Change password for a MySQL user host Host for which this user/password combo applies password The password to set for the new user. Will take precedence over the ``password_hash`` option if both are specified. password_hash The password in hashed form. Be sure to quote th...
salt/modules/mysql.py
def user_chpass(user, host='localhost', password=None, password_hash=None, allow_passwordless=False, unix_socket=None, password_column=None, **connection_args): ''' Change password for a MySQL user ...
def user_chpass(user, host='localhost', password=None, password_hash=None, allow_passwordless=False, unix_socket=None, password_column=None, **connection_args): ''' Change password for a MySQL user ...
[ "Change", "password", "for", "a", "MySQL", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1474-L1602
[ "def", "user_chpass", "(", "user", ",", "host", "=", "'localhost'", ",", "password", "=", "None", ",", "password_hash", "=", "None", ",", "allow_passwordless", "=", "False", ",", "unix_socket", "=", "None", ",", "password_column", "=", "None", ",", "*", "*...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_remove
Delete MySQL user CLI Example: .. code-block:: bash salt '*' mysql.user_remove frank localhost
salt/modules/mysql.py
def user_remove(user, host='localhost', **connection_args): ''' Delete MySQL user CLI Example: .. code-block:: bash salt '*' mysql.user_remove frank localhost ''' dbc = _connect(**connection_args) if dbc is None: return False cur = dbc....
def user_remove(user, host='localhost', **connection_args): ''' Delete MySQL user CLI Example: .. code-block:: bash salt '*' mysql.user_remove frank localhost ''' dbc = _connect(**connection_args) if dbc is None: return False cur = dbc....
[ "Delete", "MySQL", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1605-L1639
[ "def", "user_remove", "(", "user", ",", "host", "=", "'localhost'", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "False", "cur", "=", "dbc", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_check
Repairs the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_check dbname salt '*' mysql.db_check dbname dbtable
salt/modules/mysql.py
def db_check(name, table=None, **connection_args): ''' Repairs the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_check dbname salt '*' mysql.db_check dbname dbtable ''' ret = [] if table is None: #...
def db_check(name, table=None, **connection_args): ''' Repairs the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_check dbname salt '*' mysql.db_check dbname dbtable ''' ret = [] if table is None: #...
[ "Repairs", "the", "full", "database", "or", "just", "a", "given", "table" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1659-L1682
[ "def", "db_check", "(", "name", ",", "table", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "[", "]", "if", "table", "is", "None", ":", "# we need to check all tables", "tables", "=", "db_tables", "(", "name", ",", "*", "*", "con...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_repair
Repairs the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_repair dbname
salt/modules/mysql.py
def db_repair(name, table=None, **connection_args): ''' Repairs the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_repair dbname ''' ret = [] if table is None: # we need to repair all tables table...
def db_repair(name, table=None, **connection_args): ''' Repairs the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_repair dbname ''' ret = [] if table is None: # we need to repair all tables table...
[ "Repairs", "the", "full", "database", "or", "just", "a", "given", "table" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1685-L1707
[ "def", "db_repair", "(", "name", ",", "table", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "[", "]", "if", "table", "is", "None", ":", "# we need to repair all tables", "tables", "=", "db_tables", "(", "name", ",", "*", "*", "c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
db_optimize
Optimizes the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_optimize dbname
salt/modules/mysql.py
def db_optimize(name, table=None, **connection_args): ''' Optimizes the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_optimize dbname ''' ret = [] if table is None: # we need to optimize all tables ...
def db_optimize(name, table=None, **connection_args): ''' Optimizes the full database or just a given table CLI Example: .. code-block:: bash salt '*' mysql.db_optimize dbname ''' ret = [] if table is None: # we need to optimize all tables ...
[ "Optimizes", "the", "full", "database", "or", "just", "a", "given", "table" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1710-L1732
[ "def", "db_optimize", "(", "name", ",", "table", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "[", "]", "if", "table", "is", "None", ":", "# we need to optimize all tables", "tables", "=", "db_tables", "(", "name", ",", "*", "*", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__grant_generate
Validate grants and build the query that could set the given grants Note that this query contains arguments for user and host but not for grants or database.
salt/modules/mysql.py
def __grant_generate(grant, database, user, host='localhost', grant_option=False, escape=True, ssl_option=False): ''' Validate grants and build the query that could set the given grants N...
def __grant_generate(grant, database, user, host='localhost', grant_option=False, escape=True, ssl_option=False): ''' Validate grants and build the query that could set the given grants N...
[ "Validate", "grants", "and", "build", "the", "query", "that", "could", "set", "the", "given", "grants" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1778-L1818
[ "def", "__grant_generate", "(", "grant", ",", "database", ",", "user", ",", "host", "=", "'localhost'", ",", "grant_option", "=", "False", ",", "escape", "=", "True", ",", "ssl_option", "=", "False", ")", ":", "# TODO: Re-order the grant so it is according to the"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_grants
Shows the grants for the given MySQL user (if it exists) CLI Example: .. code-block:: bash salt '*' mysql.user_grants 'frank' 'localhost'
salt/modules/mysql.py
def user_grants(user, host='localhost', **connection_args): ''' Shows the grants for the given MySQL user (if it exists) CLI Example: .. code-block:: bash salt '*' mysql.user_grants 'frank' 'localhost' ''' if not user_exists(user, host, **connection_args): log....
def user_grants(user, host='localhost', **connection_args): ''' Shows the grants for the given MySQL user (if it exists) CLI Example: .. code-block:: bash salt '*' mysql.user_grants 'frank' 'localhost' ''' if not user_exists(user, host, **connection_args): log....
[ "Shows", "the", "grants", "for", "the", "given", "MySQL", "user", "(", "if", "it", "exists", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1821-L1860
[ "def", "user_grants", "(", "user", ",", "host", "=", "'localhost'", ",", "*", "*", "connection_args", ")", ":", "if", "not", "user_exists", "(", "user", ",", "host", ",", "*", "*", "connection_args", ")", ":", "log", ".", "info", "(", "'User \\'%s\\'@\\'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
grant_exists
Checks to see if a grant exists in the database CLI Example: .. code-block:: bash salt '*' mysql.grant_exists \ 'SELECT,INSERT,UPDATE,...' 'database.*' 'frank' 'localhost'
salt/modules/mysql.py
def grant_exists(grant, database, user, host='localhost', grant_option=False, escape=True, **connection_args): ''' Checks to see if a grant exists in the database CLI Example: .. code-block:: bash ...
def grant_exists(grant, database, user, host='localhost', grant_option=False, escape=True, **connection_args): ''' Checks to see if a grant exists in the database CLI Example: .. code-block:: bash ...
[ "Checks", "to", "see", "if", "a", "grant", "exists", "in", "the", "database" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1863-L1949
[ "def", "grant_exists", "(", "grant", ",", "database", ",", "user", ",", "host", "=", "'localhost'", ",", "grant_option", "=", "False", ",", "escape", "=", "True", ",", "*", "*", "connection_args", ")", ":", "server_version", "=", "salt", ".", "utils", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
grant_add
Adds a grant to the MySQL server. For database, make sure you specify database.table or database.* CLI Example: .. code-block:: bash salt '*' mysql.grant_add \ 'SELECT,INSERT,UPDATE,...' 'database.*' 'frank' 'localhost'
salt/modules/mysql.py
def grant_add(grant, database, user, host='localhost', grant_option=False, escape=True, ssl_option=False, **connection_args): ''' Adds a grant to the MySQL server. For database, make sure you specify database....
def grant_add(grant, database, user, host='localhost', grant_option=False, escape=True, ssl_option=False, **connection_args): ''' Adds a grant to the MySQL server. For database, make sure you specify database....
[ "Adds", "a", "grant", "to", "the", "MySQL", "server", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L1952-L2004
[ "def", "grant_add", "(", "grant", ",", "database", ",", "user", ",", "host", "=", "'localhost'", ",", "grant_option", "=", "False", ",", "escape", "=", "True", ",", "ssl_option", "=", "False", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
grant_revoke
Removes a grant from the MySQL server. CLI Example: .. code-block:: bash salt '*' mysql.grant_revoke \ 'SELECT,INSERT,UPDATE' 'database.*' 'frank' 'localhost'
salt/modules/mysql.py
def grant_revoke(grant, database, user, host='localhost', grant_option=False, escape=True, **connection_args): ''' Removes a grant from the MySQL server. CLI Example: .. code-block:: bash sal...
def grant_revoke(grant, database, user, host='localhost', grant_option=False, escape=True, **connection_args): ''' Removes a grant from the MySQL server. CLI Example: .. code-block:: bash sal...
[ "Removes", "a", "grant", "from", "the", "MySQL", "server", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L2007-L2081
[ "def", "grant_revoke", "(", "grant", ",", "database", ",", "user", ",", "host", "=", "'localhost'", ",", "grant_option", "=", "False", ",", "escape", "=", "True", ",", "*", "*", "connection_args", ")", ":", "dbc", "=", "_connect", "(", "*", "*", "conne...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
processlist
Retrieves the processlist from the MySQL server via "SHOW FULL PROCESSLIST". Returns: a list of dicts, with each dict representing a process: .. code-block:: python {'Command': 'Query', 'Host': 'localhost', 'Id': 39, 'Info': 'SHOW FULL PROCESSLIST', 'Rows_examined'...
salt/modules/mysql.py
def processlist(**connection_args): ''' Retrieves the processlist from the MySQL server via "SHOW FULL PROCESSLIST". Returns: a list of dicts, with each dict representing a process: .. code-block:: python {'Command': 'Query', 'Host': 'localhost', 'Id': 39, 'Info': ...
def processlist(**connection_args): ''' Retrieves the processlist from the MySQL server via "SHOW FULL PROCESSLIST". Returns: a list of dicts, with each dict representing a process: .. code-block:: python {'Command': 'Query', 'Host': 'localhost', 'Id': 39, 'Info': ...
[ "Retrieves", "the", "processlist", "from", "the", "MySQL", "server", "via", "SHOW", "FULL", "PROCESSLIST", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L2084-L2127
[ "def", "processlist", "(", "*", "*", "connection_args", ")", ":", "ret", "=", "[", "]", "dbc", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "dbc", "is", "None", ":", "return", "[", "]", "cur", "=", "dbc", ".", "cursor", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__do_query_into_hash
Perform the query that is passed to it (sql_str). Returns: results in a dict.
salt/modules/mysql.py
def __do_query_into_hash(conn, sql_str): ''' Perform the query that is passed to it (sql_str). Returns: results in a dict. ''' mod = sys._getframe().f_code.co_name log.debug('%s<--(%s)', mod, sql_str) rtn_results = [] try: cursor = conn.cursor() except MySQLdb.MySQ...
def __do_query_into_hash(conn, sql_str): ''' Perform the query that is passed to it (sql_str). Returns: results in a dict. ''' mod = sys._getframe().f_code.co_name log.debug('%s<--(%s)', mod, sql_str) rtn_results = [] try: cursor = conn.cursor() except MySQLdb.MySQ...
[ "Perform", "the", "query", "that", "is", "passed", "to", "it", "(", "sql_str", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L2130-L2173
[ "def", "__do_query_into_hash", "(", "conn", ",", "sql_str", ")", ":", "mod", "=", "sys", ".", "_getframe", "(", ")", ".", "f_code", ".", "co_name", "log", ".", "debug", "(", "'%s<--(%s)'", ",", "mod", ",", "sql_str", ")", "rtn_results", "=", "[", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_master_status
Retrieves the master status from the minion. Returns:: {'host.domain.com': {'Binlog_Do_DB': '', 'Binlog_Ignore_DB': '', 'File': 'mysql-bin.000021', 'Position': 107}} CLI Example: .. code-block:: bash salt '*' mys...
salt/modules/mysql.py
def get_master_status(**connection_args): ''' Retrieves the master status from the minion. Returns:: {'host.domain.com': {'Binlog_Do_DB': '', 'Binlog_Ignore_DB': '', 'File': 'mysql-bin.000021', 'Position': 107}} CLI Ex...
def get_master_status(**connection_args): ''' Retrieves the master status from the minion. Returns:: {'host.domain.com': {'Binlog_Do_DB': '', 'Binlog_Ignore_DB': '', 'File': 'mysql-bin.000021', 'Position': 107}} CLI Ex...
[ "Retrieves", "the", "master", "status", "from", "the", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L2176-L2207
[ "def", "get_master_status", "(", "*", "*", "connection_args", ")", ":", "mod", "=", "sys", ".", "_getframe", "(", ")", ".", "f_code", ".", "co_name", "log", ".", "debug", "(", "'%s<--'", ",", "mod", ")", "conn", "=", "_connect", "(", "*", "*", "conne...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
verify_login
Attempt to login using the provided credentials. If successful, return true. Otherwise, return False. CLI Example: .. code-block:: bash salt '*' mysql.verify_login root password
salt/modules/mysql.py
def verify_login(user, password=None, **connection_args): ''' Attempt to login using the provided credentials. If successful, return true. Otherwise, return False. CLI Example: .. code-block:: bash salt '*' mysql.verify_login root password ''' # Override the connection args for u...
def verify_login(user, password=None, **connection_args): ''' Attempt to login using the provided credentials. If successful, return true. Otherwise, return False. CLI Example: .. code-block:: bash salt '*' mysql.verify_login root password ''' # Override the connection args for u...
[ "Attempt", "to", "login", "using", "the", "provided", "credentials", ".", "If", "successful", "return", "true", ".", "Otherwise", "return", "False", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mysql.py#L2336-L2358
[ "def", "verify_login", "(", "user", ",", "password", "=", "None", ",", "*", "*", "connection_args", ")", ":", "# Override the connection args for username and password", "connection_args", "[", "'connection_user'", "]", "=", "user", "connection_args", "[", "'connection_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
WheelClient.call_func
Backwards compatibility
salt/wheel/__init__.py
def call_func(self, fun, **kwargs): ''' Backwards compatibility ''' return self.low(fun, kwargs, print_event=kwargs.get('print_event', True), full_return=kwargs.get('full_return', False))
def call_func(self, fun, **kwargs): ''' Backwards compatibility ''' return self.low(fun, kwargs, print_event=kwargs.get('print_event', True), full_return=kwargs.get('full_return', False))
[ "Backwards", "compatibility" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/__init__.py#L53-L57
[ "def", "call_func", "(", "self", ",", "fun", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "low", "(", "fun", ",", "kwargs", ",", "print_event", "=", "kwargs", ".", "get", "(", "'print_event'", ",", "True", ")", ",", "full_return", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
WheelClient.master_call
Execute a wheel function through the master network interface (eauth).
salt/wheel/__init__.py
def master_call(self, **kwargs): ''' Execute a wheel function through the master network interface (eauth). ''' load = kwargs load['cmd'] = 'wheel' interface = self.opts['interface'] if interface == '0.0.0.0': interface = '127.0.0.1' master_uri...
def master_call(self, **kwargs): ''' Execute a wheel function through the master network interface (eauth). ''' load = kwargs load['cmd'] = 'wheel' interface = self.opts['interface'] if interface == '0.0.0.0': interface = '127.0.0.1' master_uri...
[ "Execute", "a", "wheel", "function", "through", "the", "master", "network", "interface", "(", "eauth", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/__init__.py#L61-L85
[ "def", "master_call", "(", "self", ",", "*", "*", "kwargs", ")", ":", "load", "=", "kwargs", "load", "[", "'cmd'", "]", "=", "'wheel'", "interface", "=", "self", ".", "opts", "[", "'interface'", "]", "if", "interface", "==", "'0.0.0.0'", ":", "interfac...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
WheelClient.cmd_async
Execute a function asynchronously; eauth is respected This function requires that :conf_master:`external_auth` is configured and the user is authorized .. code-block:: python >>> wheel.cmd_async({ 'fun': 'key.finger', 'match': 'jerry', ...
salt/wheel/__init__.py
def cmd_async(self, low): ''' Execute a function asynchronously; eauth is respected This function requires that :conf_master:`external_auth` is configured and the user is authorized .. code-block:: python >>> wheel.cmd_async({ 'fun': 'key.finger', ...
def cmd_async(self, low): ''' Execute a function asynchronously; eauth is respected This function requires that :conf_master:`external_auth` is configured and the user is authorized .. code-block:: python >>> wheel.cmd_async({ 'fun': 'key.finger', ...
[ "Execute", "a", "function", "asynchronously", ";", "eauth", "is", "respected" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/__init__.py#L109-L128
[ "def", "cmd_async", "(", "self", ",", "low", ")", ":", "fun", "=", "low", ".", "pop", "(", "'fun'", ")", "return", "self", ".", "asynchronous", "(", "fun", ",", "low", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
WheelClient.cmd
Execute a function .. code-block:: python >>> wheel.cmd('key.finger', ['jerry']) {'minions': {'jerry': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4:6e:ca'}}
salt/wheel/__init__.py
def cmd(self, fun, arg=None, pub_data=None, kwarg=None, print_event=True, full_return=False): ''' Execute a function .. code-block:: python >>> wheel.cmd('key.finger', ['jerry']) {'minions': {'jerry': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4:6e:ca'}} ''' ...
def cmd(self, fun, arg=None, pub_data=None, kwarg=None, print_event=True, full_return=False): ''' Execute a function .. code-block:: python >>> wheel.cmd('key.finger', ['jerry']) {'minions': {'jerry': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4:6e:ca'}} ''' ...
[ "Execute", "a", "function" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/__init__.py#L130-L144
[ "def", "cmd", "(", "self", ",", "fun", ",", "arg", "=", "None", ",", "pub_data", "=", "None", ",", "kwarg", "=", "None", ",", "print_event", "=", "True", ",", "full_return", "=", "False", ")", ":", "return", "super", "(", "WheelClient", ",", "self", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_add_var
Add a new var to the make.conf. If using layman, the source line for the layman make.conf needs to be at the very end of the config. This ensures that the new var will be above the source line.
salt/modules/makeconf.py
def _add_var(var, value): ''' Add a new var to the make.conf. If using layman, the source line for the layman make.conf needs to be at the very end of the config. This ensures that the new var will be above the source line. ''' makeconf = _get_makeconf() layman = 'source /var/lib/layman/...
def _add_var(var, value): ''' Add a new var to the make.conf. If using layman, the source line for the layman make.conf needs to be at the very end of the config. This ensures that the new var will be above the source line. ''' makeconf = _get_makeconf() layman = 'source /var/lib/layman/...
[ "Add", "a", "new", "var", "to", "the", "make", ".", "conf", ".", "If", "using", "layman", "the", "source", "line", "for", "the", "layman", "make", ".", "conf", "needs", "to", "be", "at", "the", "very", "end", "of", "the", "config", ".", "This", "en...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/makeconf.py#L36-L54
[ "def", "_add_var", "(", "var", ",", "value", ")", ":", "makeconf", "=", "_get_makeconf", "(", ")", "layman", "=", "'source /var/lib/layman/make.conf'", "fullvar", "=", "'{0}=\"{1}\"'", ".", "format", "(", "var", ",", "value", ")", "if", "__salt__", "[", "'fi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_var
Set a variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.set_var 'LINGUAS' 'en'
salt/modules/makeconf.py
def set_var(var, value): ''' Set a variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.set_var 'LINGUAS' 'en' ...
def set_var(var, value): ''' Set a variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.set_var 'LINGUAS' 'en' ...
[ "Set", "a", "variable", "in", "the", "make", ".", "conf" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/makeconf.py#L57-L85
[ "def", "set_var", "(", "var", ",", "value", ")", ":", "makeconf", "=", "_get_makeconf", "(", ")", "old_value", "=", "get_var", "(", "var", ")", "# If var already in file, replace its value", "if", "old_value", "is", "not", "None", ":", "__salt__", "[", "'file....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove_var
Remove a variable from the make.conf Return a dict containing the new value for the variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.remove_var 'LINGUAS'
salt/modules/makeconf.py
def remove_var(var): ''' Remove a variable from the make.conf Return a dict containing the new value for the variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.remove_var 'LINGUAS' ...
def remove_var(var): ''' Remove a variable from the make.conf Return a dict containing the new value for the variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.remove_var 'LINGUAS' ...
[ "Remove", "a", "variable", "from", "the", "make", ".", "conf" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/makeconf.py#L88-L112
[ "def", "remove_var", "(", "var", ")", ":", "makeconf", "=", "_get_makeconf", "(", ")", "old_value", "=", "get_var", "(", "var", ")", "# If var is in file", "if", "old_value", "is", "not", "None", ":", "__salt__", "[", "'file.sed'", "]", "(", "makeconf", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
append_var
Add to or create a new variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.append_var 'LINGUAS' 'en'
salt/modules/makeconf.py
def append_var(var, value): ''' Add to or create a new variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.append_...
def append_var(var, value): ''' Add to or create a new variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.append_...
[ "Add", "to", "or", "create", "a", "new", "variable", "in", "the", "make", ".", "conf" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/makeconf.py#L115-L143
[ "def", "append_var", "(", "var", ",", "value", ")", ":", "makeconf", "=", "_get_makeconf", "(", ")", "old_value", "=", "get_var", "(", "var", ")", "# If var already in file, add to its value", "if", "old_value", "is", "not", "None", ":", "appended_value", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
trim_var
Remove a value from a variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.trim_var 'LINGUAS' 'en'
salt/modules/makeconf.py
def trim_var(var, value): ''' Remove a value from a variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.trim_var '...
def trim_var(var, value): ''' Remove a value from a variable in the make.conf Return a dict containing the new value for variable:: {'<variable>': {'old': '<old-value>', 'new': '<new-value>'}} CLI Example: .. code-block:: bash salt '*' makeconf.trim_var '...
[ "Remove", "a", "value", "from", "a", "variable", "in", "the", "make", ".", "conf" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/makeconf.py#L146-L170
[ "def", "trim_var", "(", "var", ",", "value", ")", ":", "makeconf", "=", "_get_makeconf", "(", ")", "old_value", "=", "get_var", "(", "var", ")", "# If var in file, trim value from its value", "if", "old_value", "is", "not", "None", ":", "__salt__", "[", "'file...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_var
Get the value of a variable in make.conf Return the value of the variable or None if the variable is not in make.conf CLI Example: .. code-block:: bash salt '*' makeconf.get_var 'LINGUAS'
salt/modules/makeconf.py
def get_var(var): ''' Get the value of a variable in make.conf Return the value of the variable or None if the variable is not in make.conf CLI Example: .. code-block:: bash salt '*' makeconf.get_var 'LINGUAS' ''' makeconf = _get_makeconf() # Open makeconf with salt.u...
def get_var(var): ''' Get the value of a variable in make.conf Return the value of the variable or None if the variable is not in make.conf CLI Example: .. code-block:: bash salt '*' makeconf.get_var 'LINGUAS' ''' makeconf = _get_makeconf() # Open makeconf with salt.u...
[ "Get", "the", "value", "of", "a", "variable", "in", "make", ".", "conf" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/makeconf.py#L173-L199
[ "def", "get_var", "(", "var", ")", ":", "makeconf", "=", "_get_makeconf", "(", ")", "# Open makeconf", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "makeconf", ")", "as", "fn_", ":", "conf_file", "=", "salt", ".", "utils", ".", "data"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
var_contains
Verify if variable contains a value in make.conf Return True if value is set for var CLI Example: .. code-block:: bash salt '*' makeconf.var_contains 'LINGUAS' 'en'
salt/modules/makeconf.py
def var_contains(var, value): ''' Verify if variable contains a value in make.conf Return True if value is set for var CLI Example: .. code-block:: bash salt '*' makeconf.var_contains 'LINGUAS' 'en' ''' setval = get_var(var) # Remove any escaping that was needed to past throu...
def var_contains(var, value): ''' Verify if variable contains a value in make.conf Return True if value is set for var CLI Example: .. code-block:: bash salt '*' makeconf.var_contains 'LINGUAS' 'en' ''' setval = get_var(var) # Remove any escaping that was needed to past throu...
[ "Verify", "if", "variable", "contains", "a", "value", "in", "make", ".", "conf" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/makeconf.py#L202-L219
[ "def", "var_contains", "(", "var", ",", "value", ")", ":", "setval", "=", "get_var", "(", "var", ")", "# Remove any escaping that was needed to past through salt", "value", "=", "value", ".", "replace", "(", "'\\\\'", ",", "''", ")", "if", "setval", "is", "Non...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_carbon
Context manager to ensure the clean creation and destruction of a socket. host The IP or hostname of the carbon server port The port that carbon is listening on
salt/returners/carbon_return.py
def _carbon(host, port): ''' Context manager to ensure the clean creation and destruction of a socket. host The IP or hostname of the carbon server port The port that carbon is listening on ''' carbon_sock = None try: carbon_sock = socket.socket(socket.AF_INET, sock...
def _carbon(host, port): ''' Context manager to ensure the clean creation and destruction of a socket. host The IP or hostname of the carbon server port The port that carbon is listening on ''' carbon_sock = None try: carbon_sock = socket.socket(socket.AF_INET, sock...
[ "Context", "manager", "to", "ensure", "the", "clean", "creation", "and", "destruction", "of", "a", "socket", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/carbon_return.py#L129-L157
[ "def", "_carbon", "(", "host", ",", "port", ")", ":", "carbon_sock", "=", "None", "try", ":", "carbon_sock", "=", "socket", ".", "socket", "(", "socket", ".", "AF_INET", ",", "socket", ".", "SOCK_STREAM", ",", "socket", ".", "IPPROTO_TCP", ")", "carbon_s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_send_picklemetrics
Format metrics for the carbon pickle protocol
salt/returners/carbon_return.py
def _send_picklemetrics(metrics): ''' Format metrics for the carbon pickle protocol ''' metrics = [(metric_name, (timestamp, value)) for (metric_name, value, timestamp) in metrics] data = cPickle.dumps(metrics, -1) payload = struct.pack(b'!L', len(data)) + data return paylo...
def _send_picklemetrics(metrics): ''' Format metrics for the carbon pickle protocol ''' metrics = [(metric_name, (timestamp, value)) for (metric_name, value, timestamp) in metrics] data = cPickle.dumps(metrics, -1) payload = struct.pack(b'!L', len(data)) + data return paylo...
[ "Format", "metrics", "for", "the", "carbon", "pickle", "protocol" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/carbon_return.py#L160-L171
[ "def", "_send_picklemetrics", "(", "metrics", ")", ":", "metrics", "=", "[", "(", "metric_name", ",", "(", "timestamp", ",", "value", ")", ")", "for", "(", "metric_name", ",", "value", ",", "timestamp", ")", "in", "metrics", "]", "data", "=", "cPickle", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_send_textmetrics
Format metrics for the carbon plaintext protocol
salt/returners/carbon_return.py
def _send_textmetrics(metrics): ''' Format metrics for the carbon plaintext protocol ''' data = [' '.join(map(six.text_type, metric)) for metric in metrics] + [''] return '\n'.join(data)
def _send_textmetrics(metrics): ''' Format metrics for the carbon plaintext protocol ''' data = [' '.join(map(six.text_type, metric)) for metric in metrics] + [''] return '\n'.join(data)
[ "Format", "metrics", "for", "the", "carbon", "plaintext", "protocol" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/carbon_return.py#L174-L181
[ "def", "_send_textmetrics", "(", "metrics", ")", ":", "data", "=", "[", "' '", ".", "join", "(", "map", "(", "six", ".", "text_type", ",", "metric", ")", ")", "for", "metric", "in", "metrics", "]", "+", "[", "''", "]", "return", "'\\n'", ".", "join...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_walk
Recursively include metrics from *value*. path The dot-separated path of the metric. value A dictionary or value from a dictionary. If a dictionary, ``_walk`` will be called again with the each key/value pair as a new set of metrics. metrics The list of metrics that ...
salt/returners/carbon_return.py
def _walk(path, value, metrics, timestamp, skip): ''' Recursively include metrics from *value*. path The dot-separated path of the metric. value A dictionary or value from a dictionary. If a dictionary, ``_walk`` will be called again with the each key/value pair as a new set of ...
def _walk(path, value, metrics, timestamp, skip): ''' Recursively include metrics from *value*. path The dot-separated path of the metric. value A dictionary or value from a dictionary. If a dictionary, ``_walk`` will be called again with the each key/value pair as a new set of ...
[ "Recursively", "include", "metrics", "from", "*", "value", "*", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/carbon_return.py#L184-L224
[ "def", "_walk", "(", "path", ",", "value", ",", "metrics", ",", "timestamp", ",", "skip", ")", ":", "log", ".", "trace", "(", "'Carbon return walking path: %s, value: %s, metrics: %s, '", "'timestamp: %s'", ",", "path", ",", "value", ",", "metrics", ",", "timest...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_send
Send the data to carbon
salt/returners/carbon_return.py
def _send(saltdata, metric_base, opts): ''' Send the data to carbon ''' host = opts.get('host') port = opts.get('port') skip = opts.get('skip') metric_base_pattern = opts.get('carbon.metric_base_pattern') mode = opts.get('mode').lower() if 'mode' in opts else 'text' log.debug('Carb...
def _send(saltdata, metric_base, opts): ''' Send the data to carbon ''' host = opts.get('host') port = opts.get('port') skip = opts.get('skip') metric_base_pattern = opts.get('carbon.metric_base_pattern') mode = opts.get('mode').lower() if 'mode' in opts else 'text' log.debug('Carb...
[ "Send", "the", "data", "to", "carbon" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/carbon_return.py#L227-L266
[ "def", "_send", "(", "saltdata", ",", "metric_base", ",", "opts", ")", ":", "host", "=", "opts", ".", "get", "(", "'host'", ")", "port", "=", "opts", ".", "get", "(", "'port'", ")", "skip", "=", "opts", ".", "get", "(", "'skip'", ")", "metric_base_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
event_return
Return event data to remote carbon server Provide a list of events to be stored in carbon
salt/returners/carbon_return.py
def event_return(events): ''' Return event data to remote carbon server Provide a list of events to be stored in carbon ''' opts = _get_options({}) # Pass in empty ret, since this is a list of events opts['skip'] = True for event in events: log.trace('Carbon returner received event...
def event_return(events): ''' Return event data to remote carbon server Provide a list of events to be stored in carbon ''' opts = _get_options({}) # Pass in empty ret, since this is a list of events opts['skip'] = True for event in events: log.trace('Carbon returner received event...
[ "Return", "event", "data", "to", "remote", "carbon", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/carbon_return.py#L269-L281
[ "def", "event_return", "(", "events", ")", ":", "opts", "=", "_get_options", "(", "{", "}", ")", "# Pass in empty ret, since this is a list of events", "opts", "[", "'skip'", "]", "=", "True", "for", "event", "in", "events", ":", "log", ".", "trace", "(", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
returner
Return data to a remote carbon server using the text metric protocol Each metric will look like:: [module].[function].[minion_id].[metric path [...]].[metric name]
salt/returners/carbon_return.py
def returner(ret): ''' Return data to a remote carbon server using the text metric protocol Each metric will look like:: [module].[function].[minion_id].[metric path [...]].[metric name] ''' opts = _get_options(ret) metric_base = ret['fun'] # Strip the hostname from the carbon bas...
def returner(ret): ''' Return data to a remote carbon server using the text metric protocol Each metric will look like:: [module].[function].[minion_id].[metric path [...]].[metric name] ''' opts = _get_options(ret) metric_base = ret['fun'] # Strip the hostname from the carbon bas...
[ "Return", "data", "to", "a", "remote", "carbon", "server", "using", "the", "text", "metric", "protocol" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/carbon_return.py#L284-L302
[ "def", "returner", "(", "ret", ")", ":", "opts", "=", "_get_options", "(", "ret", ")", "metric_base", "=", "ret", "[", "'fun'", "]", "# Strip the hostname from the carbon base if we are returning from virt", "# module since then we will get stable metric bases even if the VM is...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Check to see if a stack exists. CLI Example: .. code-block:: bash salt myminion boto_cfn.exists mystack region=us-east-1
salt/modules/boto_cfn.py
def exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if a stack exists. CLI Example: .. code-block:: bash salt myminion boto_cfn.exists mystack region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) try: ...
def exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if a stack exists. CLI Example: .. code-block:: bash salt myminion boto_cfn.exists mystack region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) try: ...
[ "Check", "to", "see", "if", "a", "stack", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cfn.py#L71-L90
[ "def", "exists", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
describe
Describe a stack. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt myminion boto_cfn.describe mystack region=us-east-1
salt/modules/boto_cfn.py
def describe(name, region=None, key=None, keyid=None, profile=None): ''' Describe a stack. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt myminion boto_cfn.describe mystack region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profi...
def describe(name, region=None, key=None, keyid=None, profile=None): ''' Describe a stack. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt myminion boto_cfn.describe mystack region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profi...
[ "Describe", "a", "stack", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cfn.py#L93-L133
[ "def", "describe", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a CFN stack. CLI Example: .. code-block:: bash salt myminion boto_cfn.create mystack template_url='https://s3.amazonaws.com/bucket/template.cft' \ region=us-east-1
salt/modules/boto_cfn.py
def create(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=None, timeout_in_minutes=None, capabilities=None, tags=None, on_failure=None, stack_policy_body=None, stack_policy_url=None, region=None, key=None, keyid=None, profile=None): ''' ...
def create(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=None, timeout_in_minutes=None, capabilities=None, tags=None, on_failure=None, stack_policy_body=None, stack_policy_url=None, region=None, key=None, keyid=None, profile=None): ''' ...
[ "Create", "a", "CFN", "stack", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cfn.py#L136-L158
[ "def", "create", "(", "name", ",", "template_body", "=", "None", ",", "template_url", "=", "None", ",", "parameters", "=", "None", ",", "notification_arns", "=", "None", ",", "disable_rollback", "=", "None", ",", "timeout_in_minutes", "=", "None", ",", "capa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_stack
Update a CFN stack. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt myminion boto_cfn.update_stack mystack template_url='https://s3.amazonaws.com/bucket/template.cft' \ region=us-east-1
salt/modules/boto_cfn.py
def update_stack(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=False, timeout_in_minutes=None, capabilities=None, tags=None, use_previous_template=None, stack_policy_during_update_body=None, stack_policy_during_update_url=None, ...
def update_stack(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=False, timeout_in_minutes=None, capabilities=None, tags=None, use_previous_template=None, stack_policy_during_update_body=None, stack_policy_during_update_url=None, ...
[ "Update", "a", "CFN", "stack", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cfn.py#L161-L190
[ "def", "update_stack", "(", "name", ",", "template_body", "=", "None", ",", "template_url", "=", "None", ",", "parameters", "=", "None", ",", "notification_arns", "=", "None", ",", "disable_rollback", "=", "False", ",", "timeout_in_minutes", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Delete a CFN stack. CLI Example: .. code-block:: bash salt myminion boto_cfn.delete mystack region=us-east-1
salt/modules/boto_cfn.py
def delete(name, region=None, key=None, keyid=None, profile=None): ''' Delete a CFN stack. CLI Example: .. code-block:: bash salt myminion boto_cfn.delete mystack region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) try: return conn....
def delete(name, region=None, key=None, keyid=None, profile=None): ''' Delete a CFN stack. CLI Example: .. code-block:: bash salt myminion boto_cfn.delete mystack region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) try: return conn....
[ "Delete", "a", "CFN", "stack", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cfn.py#L193-L211
[ "def", "delete", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_template
Check to see if attributes are set on a CFN stack. CLI Example: .. code-block:: bash salt myminion boto_cfn.get_template mystack
salt/modules/boto_cfn.py
def get_template(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if attributes are set on a CFN stack. CLI Example: .. code-block:: bash salt myminion boto_cfn.get_template mystack ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
def get_template(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if attributes are set on a CFN stack. CLI Example: .. code-block:: bash salt myminion boto_cfn.get_template mystack ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
[ "Check", "to", "see", "if", "attributes", "are", "set", "on", "a", "CFN", "stack", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cfn.py#L214-L234
[ "def", "get_template", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
validate_template
Validate cloudformation template .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt myminion boto_cfn.validate_template mystack-template
salt/modules/boto_cfn.py
def validate_template(template_body=None, template_url=None, region=None, key=None, keyid=None, profile=None): ''' Validate cloudformation template .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt myminion boto_cfn.validate_template mystack-template ''' conn = _g...
def validate_template(template_body=None, template_url=None, region=None, key=None, keyid=None, profile=None): ''' Validate cloudformation template .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt myminion boto_cfn.validate_template mystack-template ''' conn = _g...
[ "Validate", "cloudformation", "template" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cfn.py#L237-L258
[ "def", "validate_template", "(", "template_body", "=", "None", ",", "template_url", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "regi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run
Run the specified service with an action. .. versionadded:: 2015.8.1 name Service name. action Action name (like start, stop, reload, restart). CLI Example: .. code-block:: bash salt '*' service.run apache2 reload salt '*' service.run postgresql initdb
salt/modules/service.py
def run(name, action): ''' Run the specified service with an action. .. versionadded:: 2015.8.1 name Service name. action Action name (like start, stop, reload, restart). CLI Example: .. code-block:: bash salt '*' service.run apache2 reload salt '*' s...
def run(name, action): ''' Run the specified service with an action. .. versionadded:: 2015.8.1 name Service name. action Action name (like start, stop, reload, restart). CLI Example: .. code-block:: bash salt '*' service.run apache2 reload salt '*' s...
[ "Run", "the", "specified", "service", "with", "an", "action", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/service.py#L60-L83
[ "def", "run", "(", "name", ",", "action", ")", ":", "cmd", "=", "os", ".", "path", ".", "join", "(", "_GRAINMAP", ".", "get", "(", "__grains__", ".", "get", "(", "'os'", ")", ",", "'/etc/init.d'", ")", ",", "name", ")", "+", "' '", "+", "action",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
Return the status for a service. If the name contains globbing, a dict mapping service name to PID or empty string is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of the service to check sig (str): Signatu...
salt/modules/service.py
def status(name, sig=None): ''' Return the status for a service. If the name contains globbing, a dict mapping service name to PID or empty string is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of the ser...
def status(name, sig=None): ''' Return the status for a service. If the name contains globbing, a dict mapping service name to PID or empty string is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of the ser...
[ "Return", "the", "status", "for", "a", "service", ".", "If", "the", "name", "contains", "globbing", "a", "dict", "mapping", "service", "name", "to", "PID", "or", "empty", "string", "is", "returned", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/service.py#L125-L161
[ "def", "status", "(", "name", ",", "sig", "=", "None", ")", ":", "if", "sig", ":", "return", "__salt__", "[", "'status.pid'", "]", "(", "sig", ")", "contains_globbing", "=", "bool", "(", "re", ".", "search", "(", "r'\\*|\\?|\\[.+\\]'", ",", "name", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all
Return a list of all available services CLI Example: .. code-block:: bash salt '*' service.get_all
salt/modules/service.py
def get_all(): ''' Return a list of all available services CLI Example: .. code-block:: bash salt '*' service.get_all ''' if not os.path.isdir(_GRAINMAP.get(__grains__.get('os'), '/etc/init.d')): return [] return sorted(os.listdir(_GRAINMAP.get(__grains__.get('os'), '/etc/...
def get_all(): ''' Return a list of all available services CLI Example: .. code-block:: bash salt '*' service.get_all ''' if not os.path.isdir(_GRAINMAP.get(__grains__.get('os'), '/etc/init.d')): return [] return sorted(os.listdir(_GRAINMAP.get(__grains__.get('os'), '/etc/...
[ "Return", "a", "list", "of", "all", "available", "services" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/service.py#L207-L219
[ "def", "get_all", "(", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "_GRAINMAP", ".", "get", "(", "__grains__", ".", "get", "(", "'os'", ")", ",", "'/etc/init.d'", ")", ")", ":", "return", "[", "]", "return", "sorted", "(", "os", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_auth
Set up neutron credentials
salt/pillar/neutron.py
def _auth(profile=None): ''' Set up neutron credentials ''' credentials = __salt__['config.option'](profile) kwargs = { 'username': credentials['keystone.user'], 'password': credentials['keystone.password'], 'tenant_name': credentials['keystone.tenant'], 'auth_url': c...
def _auth(profile=None): ''' Set up neutron credentials ''' credentials = __salt__['config.option'](profile) kwargs = { 'username': credentials['keystone.user'], 'password': credentials['keystone.password'], 'tenant_name': credentials['keystone.tenant'], 'auth_url': c...
[ "Set", "up", "neutron", "credentials" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/neutron.py#L68-L82
[ "def", "_auth", "(", "profile", "=", "None", ")", ":", "credentials", "=", "__salt__", "[", "'config.option'", "]", "(", "profile", ")", "kwargs", "=", "{", "'username'", ":", "credentials", "[", "'keystone.user'", "]", ",", "'password'", ":", "credentials",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Check neutron for all data
salt/pillar/neutron.py
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 conf): ''' Check neutron for all data ''' comps = conf.split() profile = None if comps[0]: profile = comps[0] conn = _auth(profile) ret = {} networks = conn.list_networks() for netw...
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 conf): ''' Check neutron for all data ''' comps = conf.split() profile = None if comps[0]: profile = comps[0] conn = _auth(profile) ret = {} networks = conn.list_networks() for netw...
[ "Check", "neutron", "for", "all", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/neutron.py#L85-L105
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "conf", ")", ":", "comps", "=", "conf", ".", "split", "(", ")", "profile", "=", "None", "if", "comps", "[", "0", "]", ":", "profile", "=", "comps", "[", "0", "]", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure that the named database is present with the specified options name The name of the database to manage containment Defaults to NONE options Can be a list of strings, a dictionary, or a list of dictionaries
salt/states/mssql_database.py
def present(name, containment='NONE', options=None, **kwargs): ''' Ensure that the named database is present with the specified options name The name of the database to manage containment Defaults to NONE options Can be a list of strings, a dictionary, or a list of dictionar...
def present(name, containment='NONE', options=None, **kwargs): ''' Ensure that the named database is present with the specified options name The name of the database to manage containment Defaults to NONE options Can be a list of strings, a dictionary, or a list of dictionar...
[ "Ensure", "that", "the", "named", "database", "is", "present", "with", "the", "specified", "options" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mssql_database.py#L36-L67
[ "def", "present", "(", "name", ",", "containment", "=", "'NONE'", ",", "options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_file_client
Read in the ``file_client`` option and return the correct type of file server
salt/fileclient.py
def get_file_client(opts, pillar=False): ''' Read in the ``file_client`` option and return the correct type of file server ''' client = opts.get('file_client', 'remote') if pillar and client == 'local': client = 'pillar' return { 'remote': RemoteClient, 'local': FSCli...
def get_file_client(opts, pillar=False): ''' Read in the ``file_client`` option and return the correct type of file server ''' client = opts.get('file_client', 'remote') if pillar and client == 'local': client = 'pillar' return { 'remote': RemoteClient, 'local': FSCli...
[ "Read", "in", "the", "file_client", "option", "and", "return", "the", "correct", "type", "of", "file", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L52-L64
[ "def", "get_file_client", "(", "opts", ",", "pillar", "=", "False", ")", ":", "client", "=", "opts", ".", "get", "(", "'file_client'", ",", "'remote'", ")", "if", "pillar", "and", "client", "==", "'local'", ":", "client", "=", "'pillar'", "return", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
decode_dict_keys_to_str
Convert top level keys from bytes to strings if possible. This is necessary because Python 3 makes a distinction between these types.
salt/fileclient.py
def decode_dict_keys_to_str(src): ''' Convert top level keys from bytes to strings if possible. This is necessary because Python 3 makes a distinction between these types. ''' if not six.PY3 or not isinstance(src, dict): return src output = {} for key, val in six.iteritems(src):...
def decode_dict_keys_to_str(src): ''' Convert top level keys from bytes to strings if possible. This is necessary because Python 3 makes a distinction between these types. ''' if not six.PY3 or not isinstance(src, dict): return src output = {} for key, val in six.iteritems(src):...
[ "Convert", "top", "level", "keys", "from", "bytes", "to", "strings", "if", "possible", ".", "This", "is", "necessary", "because", "Python", "3", "makes", "a", "distinction", "between", "these", "types", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L67-L84
[ "def", "decode_dict_keys_to_str", "(", "src", ")", ":", "if", "not", "six", ".", "PY3", "or", "not", "isinstance", "(", "src", ",", "dict", ")", ":", "return", "src", "output", "=", "{", "}", "for", "key", ",", "val", "in", "six", ".", "iteritems", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client._check_proto
Make sure that this path is intended for the salt master and trim it
salt/fileclient.py
def _check_proto(self, path): ''' Make sure that this path is intended for the salt master and trim it ''' if not path.startswith('salt://'): raise MinionError('Unsupported path: {0}'.format(path)) file_path, saltenv = salt.utils.url.parse(path) return file_pa...
def _check_proto(self, path): ''' Make sure that this path is intended for the salt master and trim it ''' if not path.startswith('salt://'): raise MinionError('Unsupported path: {0}'.format(path)) file_path, saltenv = salt.utils.url.parse(path) return file_pa...
[ "Make", "sure", "that", "this", "path", "is", "intended", "for", "the", "salt", "master", "and", "trim", "it" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L109-L116
[ "def", "_check_proto", "(", "self", ",", "path", ")", ":", "if", "not", "path", ".", "startswith", "(", "'salt://'", ")", ":", "raise", "MinionError", "(", "'Unsupported path: {0}'", ".", "format", "(", "path", ")", ")", "file_path", ",", "saltenv", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client._file_local_list
Helper util to return a list of files in a directory
salt/fileclient.py
def _file_local_list(self, dest): ''' Helper util to return a list of files in a directory ''' if os.path.isdir(dest): destdir = dest else: destdir = os.path.dirname(dest) filelist = set() for root, dirs, files in salt.utils.path.os_walk(...
def _file_local_list(self, dest): ''' Helper util to return a list of files in a directory ''' if os.path.isdir(dest): destdir = dest else: destdir = os.path.dirname(dest) filelist = set() for root, dirs, files in salt.utils.path.os_walk(...
[ "Helper", "util", "to", "return", "a", "list", "of", "files", "in", "a", "directory" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L118-L134
[ "def", "_file_local_list", "(", "self", ",", "dest", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "dest", ")", ":", "destdir", "=", "dest", "else", ":", "destdir", "=", "os", ".", "path", ".", "dirname", "(", "dest", ")", "filelist", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client._cache_loc
Return the local location to cache the file, cache dirs will be made
salt/fileclient.py
def _cache_loc(self, path, saltenv='base', cachedir=None): ''' Return the local location to cache the file, cache dirs will be made ''' cachedir = self.get_cachedir(cachedir) dest = salt.utils.path.join(cachedir, 'files', ...
def _cache_loc(self, path, saltenv='base', cachedir=None): ''' Return the local location to cache the file, cache dirs will be made ''' cachedir = self.get_cachedir(cachedir) dest = salt.utils.path.join(cachedir, 'files', ...
[ "Return", "the", "local", "location", "to", "cache", "the", "file", "cache", "dirs", "will", "be", "made" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L137-L160
[ "def", "_cache_loc", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ")", ":", "cachedir", "=", "self", ".", "get_cachedir", "(", "cachedir", ")", "dest", "=", "salt", ".", "utils", ".", "path", ".", "join", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.get_file
Copies a file from the local files or master depending on implementation
salt/fileclient.py
def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, cachedir=None): ''' Copies a file from the local files or master depending on implementation ''' rais...
def get_file(self, path, dest='', makedirs=False, saltenv='base', gzip=None, cachedir=None): ''' Copies a file from the local files or master depending on implementation ''' rais...
[ "Copies", "a", "file", "from", "the", "local", "files", "or", "master", "depending", "on", "implementation" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L169-L180
[ "def", "get_file", "(", "self", ",", "path", ",", "dest", "=", "''", ",", "makedirs", "=", "False", ",", "saltenv", "=", "'base'", ",", "gzip", "=", "None", ",", "cachedir", "=", "None", ")", ":", "raise", "NotImplementedError" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.cache_file
Pull a file down from the file server and store it in the minion file cache
salt/fileclient.py
def cache_file(self, path, saltenv='base', cachedir=None, source_hash=None): ''' Pull a file down from the file server and store it in the minion file cache ''' return self.get_url( path, '', True, saltenv, cachedir=cachedir, source_hash=source_hash)
def cache_file(self, path, saltenv='base', cachedir=None, source_hash=None): ''' Pull a file down from the file server and store it in the minion file cache ''' return self.get_url( path, '', True, saltenv, cachedir=cachedir, source_hash=source_hash)
[ "Pull", "a", "file", "down", "from", "the", "file", "server", "and", "store", "it", "in", "the", "minion", "file", "cache" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L188-L194
[ "def", "cache_file", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ",", "source_hash", "=", "None", ")", ":", "return", "self", ".", "get_url", "(", "path", ",", "''", ",", "True", ",", "saltenv", ",", "cached...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.cache_files
Download a list of files stored on the master and put them in the minion file cache
salt/fileclient.py
def cache_files(self, paths, saltenv='base', cachedir=None): ''' Download a list of files stored on the master and put them in the minion file cache ''' ret = [] if isinstance(paths, six.string_types): paths = paths.split(',') for path in paths: ...
def cache_files(self, paths, saltenv='base', cachedir=None): ''' Download a list of files stored on the master and put them in the minion file cache ''' ret = [] if isinstance(paths, six.string_types): paths = paths.split(',') for path in paths: ...
[ "Download", "a", "list", "of", "files", "stored", "on", "the", "master", "and", "put", "them", "in", "the", "minion", "file", "cache" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L196-L206
[ "def", "cache_files", "(", "self", ",", "paths", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ")", ":", "ret", "=", "[", "]", "if", "isinstance", "(", "paths", ",", "six", ".", "string_types", ")", ":", "paths", "=", "paths", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.cache_master
Download and cache all files on a master in a specified environment
salt/fileclient.py
def cache_master(self, saltenv='base', cachedir=None): ''' Download and cache all files on a master in a specified environment ''' ret = [] for path in self.file_list(saltenv): ret.append( self.cache_file( salt.utils.url.create(path...
def cache_master(self, saltenv='base', cachedir=None): ''' Download and cache all files on a master in a specified environment ''' ret = [] for path in self.file_list(saltenv): ret.append( self.cache_file( salt.utils.url.create(path...
[ "Download", "and", "cache", "all", "files", "on", "a", "master", "in", "a", "specified", "environment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L208-L218
[ "def", "cache_master", "(", "self", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ")", ":", "ret", "=", "[", "]", "for", "path", "in", "self", ".", "file_list", "(", "saltenv", ")", ":", "ret", ".", "append", "(", "self", ".", "cache...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.cache_dir
Download all of the files in a subdir of the master
salt/fileclient.py
def cache_dir(self, path, saltenv='base', include_empty=False, include_pat=None, exclude_pat=None, cachedir=None): ''' Download all of the files in a subdir of the master ''' ret = [] path = self._check_proto(salt.utils.data.decode(path)) # We want to m...
def cache_dir(self, path, saltenv='base', include_empty=False, include_pat=None, exclude_pat=None, cachedir=None): ''' Download all of the files in a subdir of the master ''' ret = [] path = self._check_proto(salt.utils.data.decode(path)) # We want to m...
[ "Download", "all", "of", "the", "files", "in", "a", "subdir", "of", "the", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L220-L269
[ "def", "cache_dir", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ",", "include_empty", "=", "False", ",", "include_pat", "=", "None", ",", "exclude_pat", "=", "None", ",", "cachedir", "=", "None", ")", ":", "ret", "=", "[", "]", "path", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.cache_local_file
Cache a local file on the minion in the localfiles cache
salt/fileclient.py
def cache_local_file(self, path, **kwargs): ''' Cache a local file on the minion in the localfiles cache ''' dest = os.path.join(self.opts['cachedir'], 'localfiles', path.lstrip('/')) destdir = os.path.dirname(dest) if not os.path.isdir(destdi...
def cache_local_file(self, path, **kwargs): ''' Cache a local file on the minion in the localfiles cache ''' dest = os.path.join(self.opts['cachedir'], 'localfiles', path.lstrip('/')) destdir = os.path.dirname(dest) if not os.path.isdir(destdi...
[ "Cache", "a", "local", "file", "on", "the", "minion", "in", "the", "localfiles", "cache" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L271-L283
[ "def", "cache_local_file", "(", "self", ",", "path", ",", "*", "*", "kwargs", ")", ":", "dest", "=", "os", ".", "path", ".", "join", "(", "self", ".", "opts", "[", "'cachedir'", "]", ",", "'localfiles'", ",", "path", ".", "lstrip", "(", "'/'", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.file_local_list
List files in the local minion files and localfiles caches
salt/fileclient.py
def file_local_list(self, saltenv='base'): ''' List files in the local minion files and localfiles caches ''' filesdest = os.path.join(self.opts['cachedir'], 'files', saltenv) localfilesdest = os.path.join(self.opts['cachedir'], 'localfiles') fdest = self._file_local_lis...
def file_local_list(self, saltenv='base'): ''' List files in the local minion files and localfiles caches ''' filesdest = os.path.join(self.opts['cachedir'], 'files', saltenv) localfilesdest = os.path.join(self.opts['cachedir'], 'localfiles') fdest = self._file_local_lis...
[ "List", "files", "in", "the", "local", "minion", "files", "and", "localfiles", "caches" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L285-L294
[ "def", "file_local_list", "(", "self", ",", "saltenv", "=", "'base'", ")", ":", "filesdest", "=", "os", ".", "path", ".", "join", "(", "self", ".", "opts", "[", "'cachedir'", "]", ",", "'files'", ",", "saltenv", ")", "localfilesdest", "=", "os", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.is_cached
Returns the full path to a file if it is cached locally on the minion otherwise returns a blank string
salt/fileclient.py
def is_cached(self, path, saltenv='base', cachedir=None): ''' Returns the full path to a file if it is cached locally on the minion otherwise returns a blank string ''' if path.startswith('salt://'): path, senv = salt.utils.url.parse(path) if senv: ...
def is_cached(self, path, saltenv='base', cachedir=None): ''' Returns the full path to a file if it is cached locally on the minion otherwise returns a blank string ''' if path.startswith('salt://'): path, senv = salt.utils.url.parse(path) if senv: ...
[ "Returns", "the", "full", "path", "to", "a", "file", "if", "it", "is", "cached", "locally", "on", "the", "minion", "otherwise", "returns", "a", "blank", "string" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L314-L342
[ "def", "is_cached", "(", "self", ",", "path", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ")", ":", "if", "path", ".", "startswith", "(", "'salt://'", ")", ":", "path", ",", "senv", "=", "salt", ".", "utils", ".", "url", ".", "pars...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.cache_dest
Return the expected cache location for the specified URL and environment.
salt/fileclient.py
def cache_dest(self, url, saltenv='base', cachedir=None): ''' Return the expected cache location for the specified URL and environment. ''' proto = urlparse(url).scheme if proto == '': # Local file path return url if proto == 'salt': ...
def cache_dest(self, url, saltenv='base', cachedir=None): ''' Return the expected cache location for the specified URL and environment. ''' proto = urlparse(url).scheme if proto == '': # Local file path return url if proto == 'salt': ...
[ "Return", "the", "expected", "cache", "location", "for", "the", "specified", "URL", "and", "environment", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L344-L365
[ "def", "cache_dest", "(", "self", ",", "url", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ")", ":", "proto", "=", "urlparse", "(", "url", ")", ".", "scheme", "if", "proto", "==", "''", ":", "# Local file path", "return", "url", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.list_states
Return a list of all available sls modules on the master for a given environment
salt/fileclient.py
def list_states(self, saltenv): ''' Return a list of all available sls modules on the master for a given environment ''' states = set() for path in self.file_list(saltenv): if salt.utils.platform.is_windows(): path = path.replace('\\', '/') ...
def list_states(self, saltenv): ''' Return a list of all available sls modules on the master for a given environment ''' states = set() for path in self.file_list(saltenv): if salt.utils.platform.is_windows(): path = path.replace('\\', '/') ...
[ "Return", "a", "list", "of", "all", "available", "sls", "modules", "on", "the", "master", "for", "a", "given", "environment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L367-L382
[ "def", "list_states", "(", "self", ",", "saltenv", ")", ":", "states", "=", "set", "(", ")", "for", "path", "in", "self", ".", "file_list", "(", "saltenv", ")", ":", "if", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "pa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.get_state
Get a state file from the master and store it in the local minion cache; return the location of the file
salt/fileclient.py
def get_state(self, sls, saltenv, cachedir=None): ''' Get a state file from the master and store it in the local minion cache; return the location of the file ''' if '.' in sls: sls = sls.replace('.', '/') sls_url = salt.utils.url.create(sls + '.sls') ...
def get_state(self, sls, saltenv, cachedir=None): ''' Get a state file from the master and store it in the local minion cache; return the location of the file ''' if '.' in sls: sls = sls.replace('.', '/') sls_url = salt.utils.url.create(sls + '.sls') ...
[ "Get", "a", "state", "file", "from", "the", "master", "and", "store", "it", "in", "the", "local", "minion", "cache", ";", "return", "the", "location", "of", "the", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L384-L397
[ "def", "get_state", "(", "self", ",", "sls", ",", "saltenv", ",", "cachedir", "=", "None", ")", ":", "if", "'.'", "in", "sls", ":", "sls", "=", "sls", ".", "replace", "(", "'.'", ",", "'/'", ")", "sls_url", "=", "salt", ".", "utils", ".", "url", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.get_dir
Get a directory recursively from the salt-master
salt/fileclient.py
def get_dir(self, path, dest='', saltenv='base', gzip=None, cachedir=None): ''' Get a directory recursively from the salt-master ''' ret = [] # Strip trailing slash path = self._check_proto(path).rstrip('/') # Break up the path into a list containi...
def get_dir(self, path, dest='', saltenv='base', gzip=None, cachedir=None): ''' Get a directory recursively from the salt-master ''' ret = [] # Strip trailing slash path = self._check_proto(path).rstrip('/') # Break up the path into a list containi...
[ "Get", "a", "directory", "recursively", "from", "the", "salt", "-", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L399-L456
[ "def", "get_dir", "(", "self", ",", "path", ",", "dest", "=", "''", ",", "saltenv", "=", "'base'", ",", "gzip", "=", "None", ",", "cachedir", "=", "None", ")", ":", "ret", "=", "[", "]", "# Strip trailing slash", "path", "=", "self", ".", "_check_pro...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.get_url
Get a single file from a URL.
salt/fileclient.py
def get_url(self, url, dest, makedirs=False, saltenv='base', no_cache=False, cachedir=None, source_hash=None): ''' Get a single file from a URL. ''' url_data = urlparse(url) url_scheme = url_data.scheme url_path = os.path.join( url_data.net...
def get_url(self, url, dest, makedirs=False, saltenv='base', no_cache=False, cachedir=None, source_hash=None): ''' Get a single file from a URL. ''' url_data = urlparse(url) url_scheme = url_data.scheme url_path = os.path.join( url_data.net...
[ "Get", "a", "single", "file", "from", "a", "URL", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L458-L740
[ "def", "get_url", "(", "self", ",", "url", ",", "dest", ",", "makedirs", "=", "False", ",", "saltenv", "=", "'base'", ",", "no_cache", "=", "False", ",", "cachedir", "=", "None", ",", "source_hash", "=", "None", ")", ":", "url_data", "=", "urlparse", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Client.get_template
Cache a file then process it as a template
salt/fileclient.py
def get_template( self, url, dest, template='jinja', makedirs=False, saltenv='base', cachedir=None, **kwargs): ''' Cache a file then process it as a template ''' if 'env' in kwargs: ...
def get_template( self, url, dest, template='jinja', makedirs=False, saltenv='base', cachedir=None, **kwargs): ''' Cache a file then process it as a template ''' if 'env' in kwargs: ...
[ "Cache", "a", "file", "then", "process", "it", "as", "a", "template" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileclient.py#L742-L792
[ "def", "get_template", "(", "self", ",", "url", ",", "dest", ",", "template", "=", "'jinja'", ",", "makedirs", "=", "False", ",", "saltenv", "=", "'base'", ",", "cachedir", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs"...
e8541fd6e744ab0df786c0f76102e41631f45d46