id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34,700 | saltstack/salt | salt/modules/lxd.py | profile_delete | def profile_delete(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Deletes a profile.
name :
The name of the profile to delete.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remo... | python | def profile_delete(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Deletes a profile.
name :
The name of the profile to delete.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remo... | [
"def",
"profile_delete",
"(",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"profile",
"=",
"profile_get",
"(",
"name",
",",
"remote_addr",
",",
"cert",
",",
"key"... | Deletes a profile.
name :
The name of the profile to delete.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
... | [
"Deletes",
"a",
"profile",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2100-L2148 |
34,701 | saltstack/salt | salt/modules/lxd.py | profile_config_get | def profile_config_get(name, config_key, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Get a profile config item.
name :
The name of the profile to get the config item from.
config_key :
The key for the item to retrieve.
remot... | python | def profile_config_get(name, config_key, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Get a profile config item.
name :
The name of the profile to get the config item from.
config_key :
The key for the item to retrieve.
remot... | [
"def",
"profile_config_get",
"(",
"name",
",",
"config_key",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"profile",
"=",
"profile_get",
"(",
"name",
",",
"remote_addr",
",... | Get a profile config item.
name :
The name of the profile to get the config item from.
config_key :
The key for the item to retrieve.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its ... | [
"Get",
"a",
"profile",
"config",
"item",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2151-L2201 |
34,702 | saltstack/salt | salt/modules/lxd.py | profile_config_set | def profile_config_set(name, config_key, config_value,
remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Set a profile config item.
name :
The name of the profile to set the config item to.
config_key :
The items key... | python | def profile_config_set(name, config_key, config_value,
remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Set a profile config item.
name :
The name of the profile to set the config item to.
config_key :
The items key... | [
"def",
"profile_config_set",
"(",
"name",
",",
"config_key",
",",
"config_value",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"profile",
"=",
"profile_get",
"(",
"name",
"... | Set a profile config item.
name :
The name of the profile to set the config item to.
config_key :
The items key.
config_value :
Its items value.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
... | [
"Set",
"a",
"profile",
"config",
"item",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2204-L2260 |
34,703 | saltstack/salt | salt/modules/lxd.py | profile_config_delete | def profile_config_delete(name, config_key, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Delete a profile config item.
name :
The name of the profile to delete the config item.
config_key :
The config key for the value to retrieve.... | python | def profile_config_delete(name, config_key, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Delete a profile config item.
name :
The name of the profile to delete the config item.
config_key :
The config key for the value to retrieve.... | [
"def",
"profile_config_delete",
"(",
"name",
",",
"config_key",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"profile",
"=",
"profile_get",
"(",
"name",
",",
"remote_addr",
... | Delete a profile config item.
name :
The name of the profile to delete the config item.
config_key :
The config key for the value to retrieve.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr... | [
"Delete",
"a",
"profile",
"config",
"item",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2263-L2315 |
34,704 | saltstack/salt | salt/modules/lxd.py | profile_device_get | def profile_device_get(name, device_name, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Get a profile device.
name :
The name of the profile to get the device from.
device_name :
The name of the device to retrieve.
remote_addr... | python | def profile_device_get(name, device_name, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Get a profile device.
name :
The name of the profile to get the device from.
device_name :
The name of the device to retrieve.
remote_addr... | [
"def",
"profile_device_get",
"(",
"name",
",",
"device_name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"profile",
"=",
"profile_get",
"(",
"name",
",",
"remote_addr",
"... | Get a profile device.
name :
The name of the profile to get the device from.
device_name :
The name of the device to retrieve.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP A... | [
"Get",
"a",
"profile",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2318-L2368 |
34,705 | saltstack/salt | salt/modules/lxd.py | profile_device_set | def profile_device_set(name, device_name, device_type='disk',
remote_addr=None,
cert=None, key=None, verify_cert=True,
**kwargs):
''' Set a profile device.
name :
The name of the profile to set the device to.
device_n... | python | def profile_device_set(name, device_name, device_type='disk',
remote_addr=None,
cert=None, key=None, verify_cert=True,
**kwargs):
''' Set a profile device.
name :
The name of the profile to set the device to.
device_n... | [
"def",
"profile_device_set",
"(",
"name",
",",
"device_name",
",",
"device_type",
"=",
"'disk'",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"pr... | Set a profile device.
name :
The name of the profile to set the device to.
device_name :
The name of the device to set.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!... | [
"Set",
"a",
"profile",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2371-L2430 |
34,706 | saltstack/salt | salt/modules/lxd.py | profile_device_delete | def profile_device_delete(name, device_name, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Delete a profile device.
name :
The name of the profile to delete the device.
device_name :
The name of the device to delete.
remote... | python | def profile_device_delete(name, device_name, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Delete a profile device.
name :
The name of the profile to delete the device.
device_name :
The name of the device to delete.
remote... | [
"def",
"profile_device_delete",
"(",
"name",
",",
"device_name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"profile",
"=",
"profile_get",
"(",
"name",
",",
"remote_addr",
... | Delete a profile device.
name :
The name of the profile to delete the device.
device_name :
The name of the device to delete.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Ad... | [
"Delete",
"a",
"profile",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2433-L2486 |
34,707 | saltstack/salt | salt/modules/lxd.py | image_list | def image_list(list_aliases=False, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Lists all images from the LXD.
list_aliases :
Return a dict with the fingerprint as key and
a list of aliases as value instead.
remote_addr :
An URL ... | python | def image_list(list_aliases=False, remote_addr=None,
cert=None, key=None, verify_cert=True):
''' Lists all images from the LXD.
list_aliases :
Return a dict with the fingerprint as key and
a list of aliases as value instead.
remote_addr :
An URL ... | [
"def",
"image_list",
"(",
"list_aliases",
"=",
"False",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"client",
"=",
"pylxd_client_get",
"(",
"remote_addr",
",",
"cert",
","... | Lists all images from the LXD.
list_aliases :
Return a dict with the fingerprint as key and
a list of aliases as value instead.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!... | [
"Lists",
"all",
"images",
"from",
"the",
"LXD",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2492-L2539 |
34,708 | saltstack/salt | salt/modules/lxd.py | image_get | def image_get(fingerprint,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
_raw=False):
''' Get an image by its fingerprint
fingerprint :
The fingerprint of the image to retrieve
remote_addr :
An... | python | def image_get(fingerprint,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
_raw=False):
''' Get an image by its fingerprint
fingerprint :
The fingerprint of the image to retrieve
remote_addr :
An... | [
"def",
"image_get",
"(",
"fingerprint",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
",",
"_raw",
"=",
"False",
")",
":",
"client",
"=",
"pylxd_client_get",
"(",
"remote_addr",
",",
... | Get an image by its fingerprint
fingerprint :
The fingerprint of the image to retrieve
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserv... | [
"Get",
"an",
"image",
"by",
"its",
"fingerprint"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2542-L2600 |
34,709 | saltstack/salt | salt/modules/lxd.py | image_get_by_alias | def image_get_by_alias(alias,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
_raw=False):
''' Get an image by an alias
alias :
The alias of the image to retrieve
... | python | def image_get_by_alias(alias,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
_raw=False):
''' Get an image by an alias
alias :
The alias of the image to retrieve
... | [
"def",
"image_get_by_alias",
"(",
"alias",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
",",
"_raw",
"=",
"False",
")",
":",
"client",
"=",
"pylxd_client_get",
"(",
"remote_addr",
",... | Get an image by an alias
alias :
The alias of the image to retrieve
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
... | [
"Get",
"an",
"image",
"by",
"an",
"alias"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2603-L2661 |
34,710 | saltstack/salt | salt/modules/lxd.py | image_delete | def image_delete(image,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
''' Delete an image by an alias or fingerprint
name :
The alias or fingerprint of the image to delete,
can be a obj for the states.
... | python | def image_delete(image,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
''' Delete an image by an alias or fingerprint
name :
The alias or fingerprint of the image to delete,
can be a obj for the states.
... | [
"def",
"image_delete",
"(",
"image",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"image",
"=",
"_verify_image",
"(",
"image",
",",
"remote_addr",
",",
"cert",
",",
"key"... | Delete an image by an alias or fingerprint
name :
The alias or fingerprint of the image to delete,
can be a obj for the states.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
... | [
"Delete",
"an",
"image",
"by",
"an",
"alias",
"or",
"fingerprint"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2664-L2710 |
34,711 | saltstack/salt | salt/modules/lxd.py | image_from_simplestreams | def image_from_simplestreams(server,
alias,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
aliases=None,
pu... | python | def image_from_simplestreams(server,
alias,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
aliases=None,
pu... | [
"def",
"image_from_simplestreams",
"(",
"server",
",",
"alias",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
",",
"aliases",
"=",
"None",
",",
"public",
"=",
"False",
",",
"auto_upda... | Create an image from simplestreams
server :
Simplestreams server URI
alias :
The alias of the image to retrieve
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
... | [
"Create",
"an",
"image",
"from",
"simplestreams"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2713-L2793 |
34,712 | saltstack/salt | salt/modules/lxd.py | image_from_file | def image_from_file(filename,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
aliases=None,
public=False,
saltenv='base',
_raw=False):
''' Create a... | python | def image_from_file(filename,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
aliases=None,
public=False,
saltenv='base',
_raw=False):
''' Create a... | [
"def",
"image_from_file",
"(",
"filename",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
",",
"aliases",
"=",
"None",
",",
"public",
"=",
"False",
",",
"saltenv",
"=",
"'base'",
","... | Create an image from a file
filename :
The filename of the rootfs
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
... | [
"Create",
"an",
"image",
"from",
"a",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2875-L2954 |
34,713 | saltstack/salt | salt/modules/lxd.py | image_copy_lxd | def image_copy_lxd(source,
src_remote_addr,
src_cert,
src_key,
src_verify_cert,
remote_addr,
cert,
key,
verify_cert=True,
aliases=None,
... | python | def image_copy_lxd(source,
src_remote_addr,
src_cert,
src_key,
src_verify_cert,
remote_addr,
cert,
key,
verify_cert=True,
aliases=None,
... | [
"def",
"image_copy_lxd",
"(",
"source",
",",
"src_remote_addr",
",",
"src_cert",
",",
"src_key",
",",
"src_verify_cert",
",",
"remote_addr",
",",
"cert",
",",
"key",
",",
"verify_cert",
"=",
"True",
",",
"aliases",
"=",
"None",
",",
"public",
"=",
"None",
... | Copy an image from another LXD instance
source :
An alias or a fingerprint of the source.
src_remote_addr :
An URL to the source remote daemon
Examples:
https://mysourceserver.lan:8443
src_cert :
PEM Formatted SSL Certificate for the source
Examples:
... | [
"Copy",
"an",
"image",
"from",
"another",
"LXD",
"instance"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L2957-L3074 |
34,714 | saltstack/salt | salt/modules/lxd.py | image_alias_add | def image_alias_add(image,
alias,
description='',
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
''' Create an alias on the given image
image :
An image alias, a fi... | python | def image_alias_add(image,
alias,
description='',
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
''' Create an alias on the given image
image :
An image alias, a fi... | [
"def",
"image_alias_add",
"(",
"image",
",",
"alias",
",",
"description",
"=",
"''",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"image",
"=",
"_verify_image",
"(",
"ima... | Create an alias on the given image
image :
An image alias, a fingerprint or a image object
alias :
The alias to add
description :
Description of the alias
remote_addr :
An URL to a remote Server, you also have to give cert and key if
... | [
"Create",
"an",
"alias",
"on",
"the",
"given",
"image"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3077-L3133 |
34,715 | saltstack/salt | salt/modules/lxd.py | snapshots_all | def snapshots_all(container, remote_addr=None, cert=None, key=None, verify_cert=True):
'''
Get all snapshots for a container
container :
The name of the container to get.
remote_addr :
An URL to a remote server. The 'cert' and 'key' fields must also be
provided if 'remote_addr'... | python | def snapshots_all(container, remote_addr=None, cert=None, key=None, verify_cert=True):
'''
Get all snapshots for a container
container :
The name of the container to get.
remote_addr :
An URL to a remote server. The 'cert' and 'key' fields must also be
provided if 'remote_addr'... | [
"def",
"snapshots_all",
"(",
"container",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"containers",
"=",
"container_get",
"(",
"container",
",",
"remote_addr",
",",
"cert",
... | Get all snapshots for a container
container :
The name of the container to get.
remote_addr :
An URL to a remote server. The 'cert' and 'key' fields must also be
provided if 'remote_addr' is defined.
Examples:
https://myserver.lan:8443
/var/lib/mysocket... | [
"Get",
"all",
"snapshots",
"for",
"a",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3195-L3241 |
34,716 | saltstack/salt | salt/modules/lxd.py | snapshots_create | def snapshots_create(container, name=None, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Create a snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote s... | python | def snapshots_create(container, name=None, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Create a snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote s... | [
"def",
"snapshots_create",
"(",
"container",
",",
"name",
"=",
"None",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"cont",
"=",
"container_get",
"(",
"container",
",",
"... | Create a snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote server. The 'cert' and 'key' fields must also be
provided if 'remote_addr' is defined.
Examples:
https://m... | [
"Create",
"a",
"snapshot",
"for",
"a",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3244-L3296 |
34,717 | saltstack/salt | salt/modules/lxd.py | snapshots_delete | def snapshots_delete(container, name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Delete a snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote server... | python | def snapshots_delete(container, name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Delete a snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote server... | [
"def",
"snapshots_delete",
"(",
"container",
",",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"cont",
"=",
"container_get",
"(",
"container",
",",
"remote_addr",
"... | Delete a snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote server. The 'cert' and 'key' fields must also be
provided if 'remote_addr' is defined.
Examples:
https://m... | [
"Delete",
"a",
"snapshot",
"for",
"a",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3299-L3351 |
34,718 | saltstack/salt | salt/modules/lxd.py | snapshots_get | def snapshots_get(container, name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Get information about snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote... | python | def snapshots_get(container, name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Get information about snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote... | [
"def",
"snapshots_get",
"(",
"container",
",",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"container",
",",
"remote_addr",
... | Get information about snapshot for a container
container :
The name of the container to get.
name :
The name of the snapshot.
remote_addr :
An URL to a remote server. The 'cert' and 'key' fields must also be
provided if 'remote_addr' is defined.
Examples:
... | [
"Get",
"information",
"about",
"snapshot",
"for",
"a",
"container"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3354-L3397 |
34,719 | saltstack/salt | salt/modules/lxd.py | normalize_input_values | def normalize_input_values(config, devices):
'''
normalize config input so returns can be put into mongodb, which doesn't like `.`
This is not meant to be used on the commandline.
CLI Examples:
.. code-block:: bash
salt '*' lxd.normalize_input_values config={} devices={}
'''
if i... | python | def normalize_input_values(config, devices):
'''
normalize config input so returns can be put into mongodb, which doesn't like `.`
This is not meant to be used on the commandline.
CLI Examples:
.. code-block:: bash
salt '*' lxd.normalize_input_values config={} devices={}
'''
if i... | [
"def",
"normalize_input_values",
"(",
"config",
",",
"devices",
")",
":",
"if",
"isinstance",
"(",
"config",
",",
"list",
")",
":",
"if",
"(",
"config",
"and",
"'key'",
"in",
"config",
"[",
"0",
"]",
"and",
"'value'",
"in",
"config",
"[",
"0",
"]",
"... | normalize config input so returns can be put into mongodb, which doesn't like `.`
This is not meant to be used on the commandline.
CLI Examples:
.. code-block:: bash
salt '*' lxd.normalize_input_values config={} devices={} | [
"normalize",
"config",
"input",
"so",
"returns",
"can",
"be",
"put",
"into",
"mongodb",
"which",
"doesn",
"t",
"like",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3404-L3443 |
34,720 | saltstack/salt | salt/modules/lxd.py | _set_property_dict_item | def _set_property_dict_item(obj, prop, key, value):
''' Sets the dict item key of the attr from obj.
Basicaly it does getattr(obj, prop)[key] = value.
For the disk device we added some checks to make
device changes on the CLI saver.
'''
attr = getattr(obj, prop)
if prop == 'de... | python | def _set_property_dict_item(obj, prop, key, value):
''' Sets the dict item key of the attr from obj.
Basicaly it does getattr(obj, prop)[key] = value.
For the disk device we added some checks to make
device changes on the CLI saver.
'''
attr = getattr(obj, prop)
if prop == 'de... | [
"def",
"_set_property_dict_item",
"(",
"obj",
",",
"prop",
",",
"key",
",",
"value",
")",
":",
"attr",
"=",
"getattr",
"(",
"obj",
",",
"prop",
")",
"if",
"prop",
"==",
"'devices'",
":",
"device_type",
"=",
"value",
"[",
"'type'",
"]",
"if",
"device_ty... | Sets the dict item key of the attr from obj.
Basicaly it does getattr(obj, prop)[key] = value.
For the disk device we added some checks to make
device changes on the CLI saver. | [
"Sets",
"the",
"dict",
"item",
"key",
"of",
"the",
"attr",
"from",
"obj",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3607-L3643 |
34,721 | saltstack/salt | salt/modules/lxd.py | _pylxd_model_to_dict | def _pylxd_model_to_dict(obj):
'''Translates a plyxd model object to a dict'''
marshalled = {}
for key in obj.__attributes__.keys():
if hasattr(obj, key):
marshalled[key] = getattr(obj, key)
return marshalled | python | def _pylxd_model_to_dict(obj):
'''Translates a plyxd model object to a dict'''
marshalled = {}
for key in obj.__attributes__.keys():
if hasattr(obj, key):
marshalled[key] = getattr(obj, key)
return marshalled | [
"def",
"_pylxd_model_to_dict",
"(",
"obj",
")",
":",
"marshalled",
"=",
"{",
"}",
"for",
"key",
"in",
"obj",
".",
"__attributes__",
".",
"keys",
"(",
")",
":",
"if",
"hasattr",
"(",
"obj",
",",
"key",
")",
":",
"marshalled",
"[",
"key",
"]",
"=",
"... | Translates a plyxd model object to a dict | [
"Translates",
"a",
"plyxd",
"model",
"object",
"to",
"a",
"dict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L3699-L3705 |
34,722 | saltstack/salt | salt/modules/proxy.py | set_ftp_proxy | def set_ftp_proxy(server,
port,
user=None,
password=None,
network_service="Ethernet",
bypass_hosts=None):
'''
Sets the ftp proxy settings
server
The proxy server to use
port
The port used by the p... | python | def set_ftp_proxy(server,
port,
user=None,
password=None,
network_service="Ethernet",
bypass_hosts=None):
'''
Sets the ftp proxy settings
server
The proxy server to use
port
The port used by the p... | [
"def",
"set_ftp_proxy",
"(",
"server",
",",
"port",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"network_service",
"=",
"\"Ethernet\"",
",",
"bypass_hosts",
"=",
"None",
")",
":",
"if",
"__grains__",
"[",
"'os'",
"]",
"==",
"'Windows'",
... | Sets the ftp proxy settings
server
The proxy server to use
port
The port used by the proxy server
user
The username to use for the proxy server if required
password
The password to use if required by the server
network_service
The network service to apply... | [
"Sets",
"the",
"ftp",
"proxy",
"settings"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/proxy.py#L306-L352 |
34,723 | saltstack/salt | salt/modules/proxy.py | get_proxy_bypass | def get_proxy_bypass(network_service="Ethernet"):
'''
Returns the current domains that can bypass the proxy
network_service
The network service to get the bypass domains from, this is only
necessary on macOS
CLI Example:
.. code-block:: bash
salt '*' proxy.get_proxy_bypas... | python | def get_proxy_bypass(network_service="Ethernet"):
'''
Returns the current domains that can bypass the proxy
network_service
The network service to get the bypass domains from, this is only
necessary on macOS
CLI Example:
.. code-block:: bash
salt '*' proxy.get_proxy_bypas... | [
"def",
"get_proxy_bypass",
"(",
"network_service",
"=",
"\"Ethernet\"",
")",
":",
"if",
"__grains__",
"[",
"'os'",
"]",
"==",
"'Windows'",
":",
"reg_val",
"=",
"__utils__",
"[",
"'reg.read_value'",
"]",
"(",
"hive",
"=",
"'HKEY_CURRENT_USER'",
",",
"key",
"=",... | Returns the current domains that can bypass the proxy
network_service
The network service to get the bypass domains from, this is only
necessary on macOS
CLI Example:
.. code-block:: bash
salt '*' proxy.get_proxy_bypass | [
"Returns",
"the",
"current",
"domains",
"that",
"can",
"bypass",
"the",
"proxy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/proxy.py#L355-L384 |
34,724 | saltstack/salt | salt/modules/proxy.py | set_proxy_bypass | def set_proxy_bypass(domains, network_service="Ethernet"):
'''
Sets the domains that can bypass the proxy
domains
An array of domains allowed to bypass the proxy
network_service
The network service to apply the changes to, this only necessary on
macOS
CLI Example:
.. ... | python | def set_proxy_bypass(domains, network_service="Ethernet"):
'''
Sets the domains that can bypass the proxy
domains
An array of domains allowed to bypass the proxy
network_service
The network service to apply the changes to, this only necessary on
macOS
CLI Example:
.. ... | [
"def",
"set_proxy_bypass",
"(",
"domains",
",",
"network_service",
"=",
"\"Ethernet\"",
")",
":",
"servers_str",
"=",
"' '",
".",
"join",
"(",
"domains",
")",
"cmd",
"=",
"'networksetup -setproxybypassdomains {0} {1}'",
".",
"format",
"(",
"network_service",
",",
... | Sets the domains that can bypass the proxy
domains
An array of domains allowed to bypass the proxy
network_service
The network service to apply the changes to, this only necessary on
macOS
CLI Example:
.. code-block:: bash
salt '*' proxy.set_proxy_bypass "['127.0.0.1... | [
"Sets",
"the",
"domains",
"that",
"can",
"bypass",
"the",
"proxy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/proxy.py#L387-L409 |
34,725 | saltstack/salt | salt/modules/proxy.py | set_proxy_win | def set_proxy_win(server, port, types=None, bypass_hosts=None):
'''
Sets the http proxy settings, only works with Windows.
server
The proxy server to use
password
The password to use if required by the server
types
The types of proxy connections should be setup with this s... | python | def set_proxy_win(server, port, types=None, bypass_hosts=None):
'''
Sets the http proxy settings, only works with Windows.
server
The proxy server to use
password
The password to use if required by the server
types
The types of proxy connections should be setup with this s... | [
"def",
"set_proxy_win",
"(",
"server",
",",
"port",
",",
"types",
"=",
"None",
",",
"bypass_hosts",
"=",
"None",
")",
":",
"if",
"__grains__",
"[",
"'os'",
"]",
"==",
"'Windows'",
":",
"return",
"_set_proxy_windows",
"(",
"server",
"=",
"server",
",",
"p... | Sets the http proxy settings, only works with Windows.
server
The proxy server to use
password
The password to use if required by the server
types
The types of proxy connections should be setup with this server. Valid
types are:
- ``http``
- ``http... | [
"Sets",
"the",
"http",
"proxy",
"settings",
"only",
"works",
"with",
"Windows",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/proxy.py#L412-L443 |
34,726 | saltstack/salt | salt/utils/smb.py | get_conn | def get_conn(host='', username=None, password=None, port=445):
'''
Get an SMB connection
'''
if HAS_IMPACKET and not HAS_SMBPROTOCOL:
salt.utils.versions.warn_until(
'Sodium',
'Support of impacket has been depricated and will be '
'removed in Sodium. Please in... | python | def get_conn(host='', username=None, password=None, port=445):
'''
Get an SMB connection
'''
if HAS_IMPACKET and not HAS_SMBPROTOCOL:
salt.utils.versions.warn_until(
'Sodium',
'Support of impacket has been depricated and will be '
'removed in Sodium. Please in... | [
"def",
"get_conn",
"(",
"host",
"=",
"''",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"port",
"=",
"445",
")",
":",
"if",
"HAS_IMPACKET",
"and",
"not",
"HAS_SMBPROTOCOL",
":",
"salt",
".",
"utils",
".",
"versions",
".",
"warn_unti... | Get an SMB connection | [
"Get",
"an",
"SMB",
"connection"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/smb.py#L176-L192 |
34,727 | saltstack/salt | salt/utils/smb.py | _mkdirs_impacket | def _mkdirs_impacket(path, share='C$', conn=None, host=None, username=None, password=None):
'''
Recursively create a directory structure on an SMB share
Paths should be passed in with forward-slash delimiters, and should not
start with a forward-slash.
'''
if conn is None:
conn = get_co... | python | def _mkdirs_impacket(path, share='C$', conn=None, host=None, username=None, password=None):
'''
Recursively create a directory structure on an SMB share
Paths should be passed in with forward-slash delimiters, and should not
start with a forward-slash.
'''
if conn is None:
conn = get_co... | [
"def",
"_mkdirs_impacket",
"(",
"path",
",",
"share",
"=",
"'C$'",
",",
"conn",
"=",
"None",
",",
"host",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"if",
"conn",
"is",
"None",
":",
"conn",
"=",
"get_conn",
"... | Recursively create a directory structure on an SMB share
Paths should be passed in with forward-slash delimiters, and should not
start with a forward-slash. | [
"Recursively",
"create",
"a",
"directory",
"structure",
"on",
"an",
"SMB",
"share"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/smb.py#L195-L217 |
34,728 | saltstack/salt | salt/utils/smb.py | StrHandle.string | def string(self, writesize=None):
'''
Looks like a file handle
'''
if not self.finished:
self.finished = True
return self.content
return '' | python | def string(self, writesize=None):
'''
Looks like a file handle
'''
if not self.finished:
self.finished = True
return self.content
return '' | [
"def",
"string",
"(",
"self",
",",
"writesize",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"finished",
":",
"self",
".",
"finished",
"=",
"True",
"return",
"self",
".",
"content",
"return",
"''"
] | Looks like a file handle | [
"Looks",
"like",
"a",
"file",
"handle"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/smb.py#L150-L157 |
34,729 | saltstack/salt | salt/utils/extend.py | _get_template | def _get_template(path, option_key):
'''
Get the contents of a template file and provide it as a module type
:param path: path to the template.yml file
:type path: ``str``
:param option_key: The unique key of this template
:type option_key: ``str``
:returns: Details about the template
... | python | def _get_template(path, option_key):
'''
Get the contents of a template file and provide it as a module type
:param path: path to the template.yml file
:type path: ``str``
:param option_key: The unique key of this template
:type option_key: ``str``
:returns: Details about the template
... | [
"def",
"_get_template",
"(",
"path",
",",
"option_key",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"path",
",",
"'r'",
")",
"as",
"template_f",
":",
"template",
"=",
"deserialize",
"(",
"template_f",
")",
"info",
"=",
"(",... | Get the contents of a template file and provide it as a module type
:param path: path to the template.yml file
:type path: ``str``
:param option_key: The unique key of this template
:type option_key: ``str``
:returns: Details about the template
:rtype: ``tuple`` | [
"Get",
"the",
"contents",
"of",
"a",
"template",
"file",
"and",
"provide",
"it",
"as",
"a",
"module",
"type"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/extend.py#L45-L61 |
34,730 | saltstack/salt | salt/utils/extend.py | _fetch_templates | def _fetch_templates(src):
'''
Fetch all of the templates in the src directory
:param src: The source path
:type src: ``str``
:rtype: ``list`` of ``tuple``
:returns: ``list`` of ('key', 'description')
'''
templates = []
log.debug('Listing contents of %s', src)
for item in os.l... | python | def _fetch_templates(src):
'''
Fetch all of the templates in the src directory
:param src: The source path
:type src: ``str``
:rtype: ``list`` of ``tuple``
:returns: ``list`` of ('key', 'description')
'''
templates = []
log.debug('Listing contents of %s', src)
for item in os.l... | [
"def",
"_fetch_templates",
"(",
"src",
")",
":",
"templates",
"=",
"[",
"]",
"log",
".",
"debug",
"(",
"'Listing contents of %s'",
",",
"src",
")",
"for",
"item",
"in",
"os",
".",
"listdir",
"(",
"src",
")",
":",
"s",
"=",
"os",
".",
"path",
".",
"... | Fetch all of the templates in the src directory
:param src: The source path
:type src: ``str``
:rtype: ``list`` of ``tuple``
:returns: ``list`` of ('key', 'description') | [
"Fetch",
"all",
"of",
"the",
"templates",
"in",
"the",
"src",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/extend.py#L64-L85 |
34,731 | saltstack/salt | salt/utils/extend.py | _mergetree | def _mergetree(src, dst):
'''
Akin to shutils.copytree but over existing directories, does a recursive merge copy.
:param src: The source path
:type src: ``str``
:param dst: The destination path
:type dst: ``str``
'''
for item in os.listdir(src):
s = os.path.join(src, item)
... | python | def _mergetree(src, dst):
'''
Akin to shutils.copytree but over existing directories, does a recursive merge copy.
:param src: The source path
:type src: ``str``
:param dst: The destination path
:type dst: ``str``
'''
for item in os.listdir(src):
s = os.path.join(src, item)
... | [
"def",
"_mergetree",
"(",
"src",
",",
"dst",
")",
":",
"for",
"item",
"in",
"os",
".",
"listdir",
"(",
"src",
")",
":",
"s",
"=",
"os",
".",
"path",
".",
"join",
"(",
"src",
",",
"item",
")",
"d",
"=",
"os",
".",
"path",
".",
"join",
"(",
"... | Akin to shutils.copytree but over existing directories, does a recursive merge copy.
:param src: The source path
:type src: ``str``
:param dst: The destination path
:type dst: ``str`` | [
"Akin",
"to",
"shutils",
".",
"copytree",
"but",
"over",
"existing",
"directories",
"does",
"a",
"recursive",
"merge",
"copy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/extend.py#L88-L109 |
34,732 | saltstack/salt | salt/utils/extend.py | run | def run(extension=None, name=None, description=None, salt_dir=None, merge=False, temp_dir=None):
'''
A template factory for extending the salt ecosystem
:param extension: The extension type, e.g. 'module', 'state', if omitted, user will be prompted
:type extension: ``str``
:param name: Python-fri... | python | def run(extension=None, name=None, description=None, salt_dir=None, merge=False, temp_dir=None):
'''
A template factory for extending the salt ecosystem
:param extension: The extension type, e.g. 'module', 'state', if omitted, user will be prompted
:type extension: ``str``
:param name: Python-fri... | [
"def",
"run",
"(",
"extension",
"=",
"None",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"salt_dir",
"=",
"None",
",",
"merge",
"=",
"False",
",",
"temp_dir",
"=",
"None",
")",
":",
"if",
"not",
"HAS_CLICK",
":",
"print",
"(",
"... | A template factory for extending the salt ecosystem
:param extension: The extension type, e.g. 'module', 'state', if omitted, user will be prompted
:type extension: ``str``
:param name: Python-friendly name for the module, if omitted, user will be prompted
:type name: ``str``
:param description... | [
"A",
"template",
"factory",
"for",
"extending",
"the",
"salt",
"ecosystem"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/extend.py#L213-L304 |
34,733 | saltstack/salt | salt/modules/npm.py | _check_valid_version | def _check_valid_version():
'''
Check the version of npm to ensure this module will work. Currently
npm must be at least version 1.2.
'''
# Locate the full path to npm
npm_path = salt.utils.path.which('npm')
# pylint: disable=no-member
res = salt.modules.cmdmod.run('{npm} --version'.fo... | python | def _check_valid_version():
'''
Check the version of npm to ensure this module will work. Currently
npm must be at least version 1.2.
'''
# Locate the full path to npm
npm_path = salt.utils.path.which('npm')
# pylint: disable=no-member
res = salt.modules.cmdmod.run('{npm} --version'.fo... | [
"def",
"_check_valid_version",
"(",
")",
":",
"# Locate the full path to npm",
"npm_path",
"=",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'npm'",
")",
"# pylint: disable=no-member",
"res",
"=",
"salt",
".",
"modules",
".",
"cmdmod",
".",
"run",
"(... | Check the version of npm to ensure this module will work. Currently
npm must be at least version 1.2. | [
"Check",
"the",
"version",
"of",
"npm",
"to",
"ensure",
"this",
"module",
"will",
"work",
".",
"Currently",
"npm",
"must",
"be",
"at",
"least",
"version",
"1",
".",
"2",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/npm.py#L47-L65 |
34,734 | saltstack/salt | salt/modules/npm.py | install | def install(pkg=None,
pkgs=None,
dir=None,
runas=None,
registry=None,
env=None,
dry_run=False,
silent=True):
'''
Install an NPM package.
If no directory is specified, the package will be installed globally. If
no packag... | python | def install(pkg=None,
pkgs=None,
dir=None,
runas=None,
registry=None,
env=None,
dry_run=False,
silent=True):
'''
Install an NPM package.
If no directory is specified, the package will be installed globally. If
no packag... | [
"def",
"install",
"(",
"pkg",
"=",
"None",
",",
"pkgs",
"=",
"None",
",",
"dir",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"registry",
"=",
"None",
",",
"env",
"=",
"None",
",",
"dry_run",
"=",
"False",
",",
"silent",
"=",
"True",
")",
":",
... | Install an NPM package.
If no directory is specified, the package will be installed globally. If
no package is specified, the dependencies (from package.json) of the
package in the given directory will be installed.
pkg
A package name in any format accepted by NPM, including a version
... | [
"Install",
"an",
"NPM",
"package",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/npm.py#L68-L182 |
34,735 | saltstack/salt | salt/modules/npm.py | uninstall | def uninstall(pkg, dir=None, runas=None, env=None):
'''
Uninstall an NPM package.
If no directory is specified, the package will be uninstalled globally.
pkg
A package name in any format accepted by NPM
dir
The target directory from which to uninstall the package, or None for
... | python | def uninstall(pkg, dir=None, runas=None, env=None):
'''
Uninstall an NPM package.
If no directory is specified, the package will be uninstalled globally.
pkg
A package name in any format accepted by NPM
dir
The target directory from which to uninstall the package, or None for
... | [
"def",
"uninstall",
"(",
"pkg",
",",
"dir",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"# Protect against injection",
"if",
"pkg",
":",
"pkg",
"=",
"_cmd_quote",
"(",
"pkg",
")",
"env",
"=",
"env",
"or",
"{",
"}",
"i... | Uninstall an NPM package.
If no directory is specified, the package will be uninstalled globally.
pkg
A package name in any format accepted by NPM
dir
The target directory from which to uninstall the package, or None for
global installation
runas
The user to run NPM w... | [
"Uninstall",
"an",
"NPM",
"package",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/npm.py#L185-L237 |
34,736 | saltstack/salt | salt/modules/npm.py | list_ | def list_(pkg=None, dir=None, runas=None, env=None, depth=None):
'''
List installed NPM packages.
If no directory is specified, this will return the list of globally-
installed packages.
pkg
Limit package listing by name
dir
The directory whose packages will be listed, or None... | python | def list_(pkg=None, dir=None, runas=None, env=None, depth=None):
'''
List installed NPM packages.
If no directory is specified, this will return the list of globally-
installed packages.
pkg
Limit package listing by name
dir
The directory whose packages will be listed, or None... | [
"def",
"list_",
"(",
"pkg",
"=",
"None",
",",
"dir",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"None",
",",
"depth",
"=",
"None",
")",
":",
"env",
"=",
"env",
"or",
"{",
"}",
"if",
"runas",
":",
"uid",
"=",
"salt",
".",
"utils"... | List installed NPM packages.
If no directory is specified, this will return the list of globally-
installed packages.
pkg
Limit package listing by name
dir
The directory whose packages will be listed, or None for global
installation
runas
The user to run NPM with
... | [
"List",
"installed",
"NPM",
"packages",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/npm.py#L240-L309 |
34,737 | saltstack/salt | salt/modules/npm.py | cache_clean | def cache_clean(path=None, runas=None, env=None, force=False):
'''
Clean cached NPM packages.
If no path for a specific package is provided the entire cache will be cleared.
path
The cache subpath to delete, or None to clear the entire cache
runas
The user to run NPM with
env... | python | def cache_clean(path=None, runas=None, env=None, force=False):
'''
Clean cached NPM packages.
If no path for a specific package is provided the entire cache will be cleared.
path
The cache subpath to delete, or None to clear the entire cache
runas
The user to run NPM with
env... | [
"def",
"cache_clean",
"(",
"path",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"env",
"=",
"env",
"or",
"{",
"}",
"if",
"runas",
":",
"uid",
"=",
"salt",
".",
"utils",
".",
"user",
".",... | Clean cached NPM packages.
If no path for a specific package is provided the entire cache will be cleared.
path
The cache subpath to delete, or None to clear the entire cache
runas
The user to run NPM with
env
Environment variables to set when invoking npm. Uses the same ``en... | [
"Clean",
"cached",
"NPM",
"packages",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/npm.py#L312-L361 |
34,738 | saltstack/salt | salt/modules/npm.py | cache_list | def cache_list(path=None, runas=None, env=None):
'''
List NPM cached packages.
If no path for a specific package is provided this will list all the cached packages.
path
The cache subpath to list, or None to list the entire cache
runas
The user to run NPM with
env
Env... | python | def cache_list(path=None, runas=None, env=None):
'''
List NPM cached packages.
If no path for a specific package is provided this will list all the cached packages.
path
The cache subpath to list, or None to list the entire cache
runas
The user to run NPM with
env
Env... | [
"def",
"cache_list",
"(",
"path",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"env",
"=",
"env",
"or",
"{",
"}",
"if",
"runas",
":",
"uid",
"=",
"salt",
".",
"utils",
".",
"user",
".",
"get_uid",
"(",
"runas",
")"... | List NPM cached packages.
If no path for a specific package is provided this will list all the cached packages.
path
The cache subpath to list, or None to list the entire cache
runas
The user to run NPM with
env
Environment variables to set when invoking npm. Uses the same ``... | [
"List",
"NPM",
"cached",
"packages",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/npm.py#L364-L406 |
34,739 | saltstack/salt | salt/modules/npm.py | cache_path | def cache_path(runas=None, env=None):
'''
List path of the NPM cache directory.
runas
The user to run NPM with
env
Environment variables to set when invoking npm. Uses the same ``env``
format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
function.
C... | python | def cache_path(runas=None, env=None):
'''
List path of the NPM cache directory.
runas
The user to run NPM with
env
Environment variables to set when invoking npm. Uses the same ``env``
format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
function.
C... | [
"def",
"cache_path",
"(",
"runas",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"env",
"=",
"env",
"or",
"{",
"}",
"if",
"runas",
":",
"uid",
"=",
"salt",
".",
"utils",
".",
"user",
".",
"get_uid",
"(",
"runas",
")",
"if",
"uid",
":",
"env",... | List path of the NPM cache directory.
runas
The user to run NPM with
env
Environment variables to set when invoking npm. Uses the same ``env``
format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
function.
CLI Example:
.. code-block:: bash
sal... | [
"List",
"path",
"of",
"the",
"NPM",
"cache",
"directory",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/npm.py#L409-L440 |
34,740 | saltstack/salt | salt/modules/ipmi.py | raw_command | def raw_command(netfn, command, bridge_request=None, data=(), retry=True, delay_xmit=None, **kwargs):
'''
Send raw ipmi command
This allows arbitrary IPMI bytes to be issued. This is commonly used
for certain vendor specific commands.
:param netfn: Net function number
:param command: Command ... | python | def raw_command(netfn, command, bridge_request=None, data=(), retry=True, delay_xmit=None, **kwargs):
'''
Send raw ipmi command
This allows arbitrary IPMI bytes to be issued. This is commonly used
for certain vendor specific commands.
:param netfn: Net function number
:param command: Command ... | [
"def",
"raw_command",
"(",
"netfn",
",",
"command",
",",
"bridge_request",
"=",
"None",
",",
"data",
"=",
"(",
")",
",",
"retry",
"=",
"True",
",",
"delay_xmit",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"with",
"_IpmiSession",
"(",
"*",
"*",
... | Send raw ipmi command
This allows arbitrary IPMI bytes to be issued. This is commonly used
for certain vendor specific commands.
:param netfn: Net function number
:param command: Command value
:param bridge_request: The target slave address and channel number for
the bridg... | [
"Send",
"raw",
"ipmi",
"command"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipmi.py#L121-L156 |
34,741 | saltstack/salt | salt/modules/ipmi.py | get_sensor_data | def get_sensor_data(**kwargs):
'''
Get sensor readings
Iterates sensor reading objects
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
CLI Example:
.. code-block:: bash
salt-call ipmi.get_se... | python | def get_sensor_data(**kwargs):
'''
Get sensor readings
Iterates sensor reading objects
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
CLI Example:
.. code-block:: bash
salt-call ipmi.get_se... | [
"def",
"get_sensor_data",
"(",
"*",
"*",
"kwargs",
")",
":",
"import",
"ast",
"with",
"_IpmiCommand",
"(",
"*",
"*",
"kwargs",
")",
"as",
"s",
":",
"data",
"=",
"{",
"}",
"for",
"reading",
"in",
"s",
".",
"get_sensor_data",
"(",
")",
":",
"if",
"re... | Get sensor readings
Iterates sensor reading objects
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
CLI Example:
.. code-block:: bash
salt-call ipmi.get_sensor_data api_host=127.0.0.1 api_user=admin... | [
"Get",
"sensor",
"readings"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipmi.py#L605-L631 |
34,742 | saltstack/salt | salt/modules/ipmi.py | get_channel_max_user_count | def get_channel_max_user_count(channel=14, **kwargs):
'''
Get max users in channel
:param channel: number [1:7]
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
:return: int -- often 16
CLI Examples:
... | python | def get_channel_max_user_count(channel=14, **kwargs):
'''
Get max users in channel
:param channel: number [1:7]
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
:return: int -- often 16
CLI Examples:
... | [
"def",
"get_channel_max_user_count",
"(",
"channel",
"=",
"14",
",",
"*",
"*",
"kwargs",
")",
":",
"access",
"=",
"get_user_access",
"(",
"channel",
"=",
"channel",
",",
"uid",
"=",
"1",
",",
"*",
"*",
"kwargs",
")",
"return",
"access",
"[",
"'channel_in... | Get max users in channel
:param channel: number [1:7]
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
:return: int -- often 16
CLI Examples:
.. code-block:: bash
salt-call ipmi.get_channel_max_us... | [
"Get",
"max",
"users",
"in",
"channel"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipmi.py#L767-L787 |
34,743 | saltstack/salt | salt/modules/ipmi.py | get_user | def get_user(uid, channel=14, **kwargs):
'''
Get user from uid and access on channel
:param uid: user number [1:16]
:param channel: number [1:7]
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
Return D... | python | def get_user(uid, channel=14, **kwargs):
'''
Get user from uid and access on channel
:param uid: user number [1:16]
:param channel: number [1:7]
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
Return D... | [
"def",
"get_user",
"(",
"uid",
",",
"channel",
"=",
"14",
",",
"*",
"*",
"kwargs",
")",
":",
"name",
"=",
"get_user_name",
"(",
"uid",
",",
"*",
"*",
"kwargs",
")",
"access",
"=",
"get_user_access",
"(",
"uid",
",",
"channel",
",",
"*",
"*",
"kwarg... | Get user from uid and access on channel
:param uid: user number [1:16]
:param channel: number [1:7]
:param kwargs:
- api_host=127.0.0.1
- api_user=admin
- api_pass=example
- api_port=623
- api_kg=None
Return Data
.. code-block:: none
name: (str)
... | [
"Get",
"user",
"from",
"uid",
"and",
"access",
"on",
"channel"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ipmi.py#L790-L826 |
34,744 | saltstack/salt | salt/beacons/napalm_beacon.py | validate | def validate(config):
'''
Validate the beacon configuration.
'''
# Must be a list of dicts.
if not isinstance(config, list):
return False, 'Configuration for napalm beacon must be a list.'
for mod in config:
fun = mod.keys()[0]
fun_cfg = mod.values()[0]
if not isi... | python | def validate(config):
'''
Validate the beacon configuration.
'''
# Must be a list of dicts.
if not isinstance(config, list):
return False, 'Configuration for napalm beacon must be a list.'
for mod in config:
fun = mod.keys()[0]
fun_cfg = mod.values()[0]
if not isi... | [
"def",
"validate",
"(",
"config",
")",
":",
"# Must be a list of dicts.",
"if",
"not",
"isinstance",
"(",
"config",
",",
"list",
")",
":",
"return",
"False",
",",
"'Configuration for napalm beacon must be a list.'",
"for",
"mod",
"in",
"config",
":",
"fun",
"=",
... | Validate the beacon configuration. | [
"Validate",
"the",
"beacon",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/napalm_beacon.py#L281-L295 |
34,745 | saltstack/salt | salt/beacons/napalm_beacon.py | beacon | def beacon(config):
'''
Watch napalm function and fire events.
'''
log.debug('Executing napalm beacon with config:')
log.debug(config)
ret = []
for mod in config:
if not mod:
continue
event = {}
fun = mod.keys()[0]
fun_cfg = mod.values()[0]
... | python | def beacon(config):
'''
Watch napalm function and fire events.
'''
log.debug('Executing napalm beacon with config:')
log.debug(config)
ret = []
for mod in config:
if not mod:
continue
event = {}
fun = mod.keys()[0]
fun_cfg = mod.values()[0]
... | [
"def",
"beacon",
"(",
"config",
")",
":",
"log",
".",
"debug",
"(",
"'Executing napalm beacon with config:'",
")",
"log",
".",
"debug",
"(",
"config",
")",
"ret",
"=",
"[",
"]",
"for",
"mod",
"in",
"config",
":",
"if",
"not",
"mod",
":",
"continue",
"e... | Watch napalm function and fire events. | [
"Watch",
"napalm",
"function",
"and",
"fire",
"events",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/napalm_beacon.py#L298-L345 |
34,746 | saltstack/salt | salt/modules/ilo.py | __execute_cmd | def __execute_cmd(name, xml):
'''
Execute ilom commands
'''
ret = {name.replace('_', ' '): {}}
id_num = 0
tmp_dir = os.path.join(__opts__['cachedir'], 'tmp')
if not os.path.isdir(tmp_dir):
os.mkdir(tmp_dir)
with tempfile.NamedTemporaryFile(dir=tmp_dir,
... | python | def __execute_cmd(name, xml):
'''
Execute ilom commands
'''
ret = {name.replace('_', ' '): {}}
id_num = 0
tmp_dir = os.path.join(__opts__['cachedir'], 'tmp')
if not os.path.isdir(tmp_dir):
os.mkdir(tmp_dir)
with tempfile.NamedTemporaryFile(dir=tmp_dir,
... | [
"def",
"__execute_cmd",
"(",
"name",
",",
"xml",
")",
":",
"ret",
"=",
"{",
"name",
".",
"replace",
"(",
"'_'",
",",
"' '",
")",
":",
"{",
"}",
"}",
"id_num",
"=",
"0",
"tmp_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"__opts__",
"[",
"'cac... | Execute ilom commands | [
"Execute",
"ilom",
"commands"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ilo.py#L32-L75 |
34,747 | saltstack/salt | salt/states/rdp.py | enabled | def enabled(name):
'''
Enable the RDP service and make sure access to the RDP
port is allowed in the firewall configuration
'''
ret = {'name': name,
'result': True,
'changes': {},
'comment': ''}
stat = __salt__['rdp.status']()
if not stat:
if __opts... | python | def enabled(name):
'''
Enable the RDP service and make sure access to the RDP
port is allowed in the firewall configuration
'''
ret = {'name': name,
'result': True,
'changes': {},
'comment': ''}
stat = __salt__['rdp.status']()
if not stat:
if __opts... | [
"def",
"enabled",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"stat",
"=",
"__salt__",
"[",
"'rdp.status'",
"]",
"(",
")",
"if",
"... | Enable the RDP service and make sure access to the RDP
port is allowed in the firewall configuration | [
"Enable",
"the",
"RDP",
"service",
"and",
"make",
"sure",
"access",
"to",
"the",
"RDP",
"port",
"is",
"allowed",
"in",
"the",
"firewall",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rdp.py#L15-L38 |
34,748 | saltstack/salt | salt/states/rdp.py | disabled | def disabled(name):
'''
Disable the RDP service
'''
ret = {'name': name,
'result': True,
'changes': {},
'comment': ''}
stat = __salt__['rdp.status']()
if stat:
if __opts__['test']:
ret['result'] = None
ret['comment'] = 'RDP will ... | python | def disabled(name):
'''
Disable the RDP service
'''
ret = {'name': name,
'result': True,
'changes': {},
'comment': ''}
stat = __salt__['rdp.status']()
if stat:
if __opts__['test']:
ret['result'] = None
ret['comment'] = 'RDP will ... | [
"def",
"disabled",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"stat",
"=",
"__salt__",
"[",
"'rdp.status'",
"]",
"(",
")",
"if",
... | Disable the RDP service | [
"Disable",
"the",
"RDP",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rdp.py#L41-L63 |
34,749 | saltstack/salt | salt/states/kapacitor.py | task_absent | def task_absent(name):
'''
Ensure that a task is absent from Kapacitor.
name
Name of the task.
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
task = __salt__['kapacitor.get_task'](name)
if task:
if __opts__['test']:
ret['result'] = None
... | python | def task_absent(name):
'''
Ensure that a task is absent from Kapacitor.
name
Name of the task.
'''
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
task = __salt__['kapacitor.get_task'](name)
if task:
if __opts__['test']:
ret['result'] = None
... | [
"def",
"task_absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"task",
"=",
"__salt__",
"[",
"'kapacitor.get_task'",
"]",
"(",
"nam... | Ensure that a task is absent from Kapacitor.
name
Name of the task. | [
"Ensure",
"that",
"a",
"task",
"is",
"absent",
"from",
"Kapacitor",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kapacitor.py#L174-L202 |
34,750 | saltstack/salt | salt/modules/win_ntp.py | set_servers | def set_servers(*servers):
'''
Set Windows to use a list of NTP servers
CLI Example:
.. code-block:: bash
salt '*' ntp.set_servers 'pool.ntp.org' 'us.pool.ntp.org'
'''
service_name = 'w32time'
if not __salt__['service.status'](service_name):
if not __salt__['service.start'... | python | def set_servers(*servers):
'''
Set Windows to use a list of NTP servers
CLI Example:
.. code-block:: bash
salt '*' ntp.set_servers 'pool.ntp.org' 'us.pool.ntp.org'
'''
service_name = 'w32time'
if not __salt__['service.status'](service_name):
if not __salt__['service.start'... | [
"def",
"set_servers",
"(",
"*",
"servers",
")",
":",
"service_name",
"=",
"'w32time'",
"if",
"not",
"__salt__",
"[",
"'service.status'",
"]",
"(",
"service_name",
")",
":",
"if",
"not",
"__salt__",
"[",
"'service.start'",
"]",
"(",
"service_name",
")",
":",
... | Set Windows to use a list of NTP servers
CLI Example:
.. code-block:: bash
salt '*' ntp.set_servers 'pool.ntp.org' 'us.pool.ntp.org' | [
"Set",
"Windows",
"to",
"use",
"a",
"list",
"of",
"NTP",
"servers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ntp.py#L30-L57 |
34,751 | saltstack/salt | salt/modules/win_ntp.py | get_servers | def get_servers():
'''
Get list of configured NTP servers
CLI Example:
.. code-block:: bash
salt '*' ntp.get_servers
'''
cmd = ['w32tm', '/query', '/configuration']
lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
for line in lines:
try:
if... | python | def get_servers():
'''
Get list of configured NTP servers
CLI Example:
.. code-block:: bash
salt '*' ntp.get_servers
'''
cmd = ['w32tm', '/query', '/configuration']
lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
for line in lines:
try:
if... | [
"def",
"get_servers",
"(",
")",
":",
"cmd",
"=",
"[",
"'w32tm'",
",",
"'/query'",
",",
"'/configuration'",
"]",
"lines",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
".",
"splitlines",
"(",
")",
"for",
"li... | Get list of configured NTP servers
CLI Example:
.. code-block:: bash
salt '*' ntp.get_servers | [
"Get",
"list",
"of",
"configured",
"NTP",
"servers"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ntp.py#L60-L79 |
34,752 | saltstack/salt | salt/modules/junos.py | facts_refresh | def facts_refresh():
'''
Reload the facts dictionary from the device. Usually only needed if,
the device configuration is changed by some other actor.
This function will also refresh the facts stored in the salt grains.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.facts_... | python | def facts_refresh():
'''
Reload the facts dictionary from the device. Usually only needed if,
the device configuration is changed by some other actor.
This function will also refresh the facts stored in the salt grains.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.facts_... | [
"def",
"facts_refresh",
"(",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"try",
":",
"conn",
".",
"facts_refresh",
"(",
")",
"except",
"Exception",
"as",
"except... | Reload the facts dictionary from the device. Usually only needed if,
the device configuration is changed by some other actor.
This function will also refresh the facts stored in the salt grains.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.facts_refresh | [
"Reload",
"the",
"facts",
"dictionary",
"from",
"the",
"device",
".",
"Usually",
"only",
"needed",
"if",
"the",
"device",
"configuration",
"is",
"changed",
"by",
"some",
"other",
"actor",
".",
"This",
"function",
"will",
"also",
"refresh",
"the",
"facts",
"s... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L106-L134 |
34,753 | saltstack/salt | salt/modules/junos.py | facts | def facts():
'''
Displays the facts gathered during the connection.
These facts are also stored in Salt grains.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.facts
'''
ret = {}
try:
ret['facts'] = __proxy__['junos.get_serialized_facts']()
ret['out'... | python | def facts():
'''
Displays the facts gathered during the connection.
These facts are also stored in Salt grains.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.facts
'''
ret = {}
try:
ret['facts'] = __proxy__['junos.get_serialized_facts']()
ret['out'... | [
"def",
"facts",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"try",
":",
"ret",
"[",
"'facts'",
"]",
"=",
"__proxy__",
"[",
"'junos.get_serialized_facts'",
"]",
"(",
")",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"except",
"Exception",
"as",
"exception",
":",
"... | Displays the facts gathered during the connection.
These facts are also stored in Salt grains.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.facts | [
"Displays",
"the",
"facts",
"gathered",
"during",
"the",
"connection",
".",
"These",
"facts",
"are",
"also",
"stored",
"in",
"Salt",
"grains",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L137-L156 |
34,754 | saltstack/salt | salt/modules/junos.py | rpc | def rpc(cmd=None, dest=None, **kwargs):
'''
This function executes the RPC provided as arguments on the junos device.
The returned data can be stored in a file.
cmd
The RPC to be executed
dest
Destination file where the RPC output is stored. Note that the file
will be store... | python | def rpc(cmd=None, dest=None, **kwargs):
'''
This function executes the RPC provided as arguments on the junos device.
The returned data can be stored in a file.
cmd
The RPC to be executed
dest
Destination file where the RPC output is stored. Note that the file
will be store... | [
"def",
"rpc",
"(",
"cmd",
"=",
"None",
",",
"dest",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"if",
"cmd",
"is",
... | This function executes the RPC provided as arguments on the junos device.
The returned data can be stored in a file.
cmd
The RPC to be executed
dest
Destination file where the RPC output is stored. Note that the file
will be stored on the proxy minion. To push the files to the mast... | [
"This",
"function",
"executes",
"the",
"RPC",
"provided",
"as",
"arguments",
"on",
"the",
"junos",
"device",
".",
"The",
"returned",
"data",
"can",
"be",
"stored",
"in",
"a",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L160-L275 |
34,755 | saltstack/salt | salt/modules/junos.py | set_hostname | def set_hostname(hostname=None, **kwargs):
'''
Set the device's hostname
hostname
The name to be set
comment
Provide a comment to the commit
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
confirm
Provide time in minutes for commit confirmation. If this op... | python | def set_hostname(hostname=None, **kwargs):
'''
Set the device's hostname
hostname
The name to be set
comment
Provide a comment to the commit
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
confirm
Provide time in minutes for commit confirmation. If this op... | [
"def",
"set_hostname",
"(",
"hostname",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"if",
"hostname",
"is",
"None",
":",
"ret",
"[",
"'message'",
"]",
"=",
"'Pl... | Set the device's hostname
hostname
The name to be set
comment
Provide a comment to the commit
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
confirm
Provide time in minutes for commit confirmation. If this option is
specified, the commit will be rolled back... | [
"Set",
"the",
"device",
"s",
"hostname"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L279-L353 |
34,756 | saltstack/salt | salt/modules/junos.py | commit | def commit(**kwargs):
'''
To commit the changes loaded in the candidate configuration.
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
comment
Provide a comment for the commit
confirm
Provide time in minutes for commit confirmation. If this option is
specified, the... | python | def commit(**kwargs):
'''
To commit the changes loaded in the candidate configuration.
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
comment
Provide a comment for the commit
confirm
Provide time in minutes for commit confirmation. If this option is
specified, the... | [
"def",
"commit",
"(",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"op",
"=",
"dict",
"(",
")",
"if",
"'__pub_arg'",
"in",
"kwargs",
":",
"if",
"kwargs",
"[",
"'__pub_arg'",
"]",
... | To commit the changes loaded in the candidate configuration.
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
comment
Provide a comment for the commit
confirm
Provide time in minutes for commit confirmation. If this option is
specified, the commit will be rolled back in the... | [
"To",
"commit",
"the",
"changes",
"loaded",
"in",
"the",
"candidate",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L357-L440 |
34,757 | saltstack/salt | salt/modules/junos.py | rollback | def rollback(**kwargs):
'''
Roll back the last committed configuration changes and commit
id : 0
The rollback ID value (0-49)
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
comment
Provide a comment for the commit
confirm
Provide time in minutes for commit ... | python | def rollback(**kwargs):
'''
Roll back the last committed configuration changes and commit
id : 0
The rollback ID value (0-49)
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
comment
Provide a comment for the commit
confirm
Provide time in minutes for commit ... | [
"def",
"rollback",
"(",
"*",
"*",
"kwargs",
")",
":",
"id_",
"=",
"kwargs",
".",
"pop",
"(",
"'id'",
",",
"0",
")",
"ret",
"=",
"{",
"}",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"op",
"=",
"dict",
"(",
")",
"if",
"'__pub_a... | Roll back the last committed configuration changes and commit
id : 0
The rollback ID value (0-49)
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
comment
Provide a comment for the commit
confirm
Provide time in minutes for commit confirmation. If this option is
... | [
"Roll",
"back",
"the",
"last",
"committed",
"configuration",
"changes",
"and",
"commit"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L444-L531 |
34,758 | saltstack/salt | salt/modules/junos.py | diff | def diff(**kwargs):
'''
Returns the difference between the candidate and the current configuration
id : 0
The rollback ID value (0-49)
CLI Example:
.. code-block:: bash
salt 'device_name' junos.diff 3
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
id_ = kwargs.po... | python | def diff(**kwargs):
'''
Returns the difference between the candidate and the current configuration
id : 0
The rollback ID value (0-49)
CLI Example:
.. code-block:: bash
salt 'device_name' junos.diff 3
'''
kwargs = salt.utils.args.clean_kwargs(**kwargs)
id_ = kwargs.po... | [
"def",
"diff",
"(",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"id_",
"=",
"kwargs",
".",
"pop",
"(",
"'id'",
",",
"0",
")",
"if",
"kwargs",
":",
"salt",
".... | Returns the difference between the candidate and the current configuration
id : 0
The rollback ID value (0-49)
CLI Example:
.. code-block:: bash
salt 'device_name' junos.diff 3 | [
"Returns",
"the",
"difference",
"between",
"the",
"candidate",
"and",
"the",
"current",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L534-L562 |
34,759 | saltstack/salt | salt/modules/junos.py | ping | def ping(dest_ip=None, **kwargs):
'''
Send a ping RPC to a device
dest_ip
The IP of the device to ping
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
rapid : False
When ``True``, executes ping at 100pps instead of 1pps
ttl
Maximum number of IP routers (IP... | python | def ping(dest_ip=None, **kwargs):
'''
Send a ping RPC to a device
dest_ip
The IP of the device to ping
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
rapid : False
When ``True``, executes ping at 100pps instead of 1pps
ttl
Maximum number of IP routers (IP... | [
"def",
"ping",
"(",
"dest_ip",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"if",
"dest_ip",
"is",
"None",
":",
"ret",
"[",
"'message'",
"]",
"=",
"'Please speci... | Send a ping RPC to a device
dest_ip
The IP of the device to ping
dev_timeout : 30
The NETCONF RPC timeout (in seconds)
rapid : False
When ``True``, executes ping at 100pps instead of 1pps
ttl
Maximum number of IP routers (IP hops) allowed between source and
dest... | [
"Send",
"a",
"ping",
"RPC",
"to",
"a",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L566-L625 |
34,760 | saltstack/salt | salt/modules/junos.py | zeroize | def zeroize():
'''
Resets the device to default factory settings
CLI Example:
.. code-block:: bash
salt 'device_name' junos.zeroize
'''
conn = __proxy__['junos.conn']()
ret = {}
ret['out'] = True
try:
conn.cli('request system zeroize')
ret['message'] = 'Com... | python | def zeroize():
'''
Resets the device to default factory settings
CLI Example:
.. code-block:: bash
salt 'device_name' junos.zeroize
'''
conn = __proxy__['junos.conn']()
ret = {}
ret['out'] = True
try:
conn.cli('request system zeroize')
ret['message'] = 'Com... | [
"def",
"zeroize",
"(",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"try",
":",
"conn",
".",
"cli",
"(",
"'request system zeroize'",
")",
"ret",
"[",
"'message'",... | Resets the device to default factory settings
CLI Example:
.. code-block:: bash
salt 'device_name' junos.zeroize | [
"Resets",
"the",
"device",
"to",
"default",
"factory",
"settings"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L978-L998 |
34,761 | saltstack/salt | salt/modules/junos.py | install_os | def install_os(path=None, **kwargs):
'''
Installs the given image on the device. After the installation is complete\
the device is rebooted,
if reboot=True is given as a keyworded argument.
path (required)
Path where the image file is present on the proxy minion
remote_path :
... | python | def install_os(path=None, **kwargs):
'''
Installs the given image on the device. After the installation is complete\
the device is rebooted,
if reboot=True is given as a keyworded argument.
path (required)
Path where the image file is present on the proxy minion
remote_path :
... | [
"def",
"install_os",
"(",
"path",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"op",
"=",
"{",
"}",
"if",
"'__pub_arg'",... | Installs the given image on the device. After the installation is complete\
the device is rebooted,
if reboot=True is given as a keyworded argument.
path (required)
Path where the image file is present on the proxy minion
remote_path :
If the value of path is a file path on the local... | [
"Installs",
"the",
"given",
"image",
"on",
"the",
"device",
".",
"After",
"the",
"installation",
"is",
"complete",
"\\",
"the",
"device",
"is",
"rebooted",
"if",
"reboot",
"=",
"True",
"is",
"given",
"as",
"a",
"keyworded",
"argument",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L1002-L1112 |
34,762 | saltstack/salt | salt/modules/junos.py | file_copy | def file_copy(src=None, dest=None):
'''
Copies the file from the local device to the junos device
src
The source path where the file is kept.
dest
The destination path on the where the file will be copied
CLI Example:
.. code-block:: bash
salt 'device_name' junos.fil... | python | def file_copy(src=None, dest=None):
'''
Copies the file from the local device to the junos device
src
The source path where the file is kept.
dest
The destination path on the where the file will be copied
CLI Example:
.. code-block:: bash
salt 'device_name' junos.fil... | [
"def",
"file_copy",
"(",
"src",
"=",
"None",
",",
"dest",
"=",
"None",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"if",
"src",
"is",
"None",
":",
"ret",
"... | Copies the file from the local device to the junos device
src
The source path where the file is kept.
dest
The destination path on the where the file will be copied
CLI Example:
.. code-block:: bash
salt 'device_name' junos.file_copy /home/m2/info.txt info_copy.txt | [
"Copies",
"the",
"file",
"from",
"the",
"local",
"device",
"to",
"the",
"junos",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L1115-L1160 |
34,763 | saltstack/salt | salt/modules/junos.py | lock | def lock():
'''
Attempts an exclusive lock on the candidate configuration. This
is a non-blocking call.
.. note::
When locking, it is important to remember to call
:py:func:`junos.unlock <salt.modules.junos.unlock>` once finished. If
locking during orchestration, remember to inc... | python | def lock():
'''
Attempts an exclusive lock on the candidate configuration. This
is a non-blocking call.
.. note::
When locking, it is important to remember to call
:py:func:`junos.unlock <salt.modules.junos.unlock>` once finished. If
locking during orchestration, remember to inc... | [
"def",
"lock",
"(",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"try",
":",
"conn",
".",
"cu",
".",
"lock",
"(",
")",
"ret",
"[",
"'message'",
"]",
"=",
... | Attempts an exclusive lock on the candidate configuration. This
is a non-blocking call.
.. note::
When locking, it is important to remember to call
:py:func:`junos.unlock <salt.modules.junos.unlock>` once finished. If
locking during orchestration, remember to include a step in the
... | [
"Attempts",
"an",
"exclusive",
"lock",
"on",
"the",
"candidate",
"configuration",
".",
"This",
"is",
"a",
"non",
"-",
"blocking",
"call",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L1163-L1190 |
34,764 | saltstack/salt | salt/modules/junos.py | unlock | def unlock():
'''
Unlocks the candidate configuration.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.unlock
'''
conn = __proxy__['junos.conn']()
ret = {}
ret['out'] = True
try:
conn.cu.unlock()
ret['message'] = "Successfully unlocked the config... | python | def unlock():
'''
Unlocks the candidate configuration.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.unlock
'''
conn = __proxy__['junos.conn']()
ret = {}
ret['out'] = True
try:
conn.cu.unlock()
ret['message'] = "Successfully unlocked the config... | [
"def",
"unlock",
"(",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"try",
":",
"conn",
".",
"cu",
".",
"unlock",
"(",
")",
"ret",
"[",
"'message'",
"]",
"="... | Unlocks the candidate configuration.
CLI Example:
.. code-block:: bash
salt 'device_name' junos.unlock | [
"Unlocks",
"the",
"candidate",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L1193-L1214 |
34,765 | saltstack/salt | salt/modules/junos.py | load | def load(path=None, **kwargs):
'''
Loads the configuration from the file provided onto the device.
path (required)
Path where the configuration/template file is present. If the file has
a ``.conf`` extension, the content is treated as text format. If the
file has a ``.xml`` extensio... | python | def load(path=None, **kwargs):
'''
Loads the configuration from the file provided onto the device.
path (required)
Path where the configuration/template file is present. If the file has
a ``.conf`` extension, the content is treated as text format. If the
file has a ``.xml`` extensio... | [
"def",
"load",
"(",
"path",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"if",
"path",
"is",
"None",
":",
"ret",
"[",
... | Loads the configuration from the file provided onto the device.
path (required)
Path where the configuration/template file is present. If the file has
a ``.conf`` extension, the content is treated as text format. If the
file has a ``.xml`` extension, the content is treated as XML format. If... | [
"Loads",
"the",
"configuration",
"from",
"the",
"file",
"provided",
"onto",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L1217-L1341 |
34,766 | saltstack/salt | salt/modules/junos.py | commit_check | def commit_check():
'''
Perform a commit check on the configuration
CLI Example:
.. code-block:: bash
salt 'device_name' junos.commit_check
'''
conn = __proxy__['junos.conn']()
ret = {}
ret['out'] = True
try:
conn.cu.commit_check()
ret['message'] = 'Commit ... | python | def commit_check():
'''
Perform a commit check on the configuration
CLI Example:
.. code-block:: bash
salt 'device_name' junos.commit_check
'''
conn = __proxy__['junos.conn']()
ret = {}
ret['out'] = True
try:
conn.cu.commit_check()
ret['message'] = 'Commit ... | [
"def",
"commit_check",
"(",
")",
":",
"conn",
"=",
"__proxy__",
"[",
"'junos.conn'",
"]",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'out'",
"]",
"=",
"True",
"try",
":",
"conn",
".",
"cu",
".",
"commit_check",
"(",
")",
"ret",
"[",
"'message'",
... | Perform a commit check on the configuration
CLI Example:
.. code-block:: bash
salt 'device_name' junos.commit_check | [
"Perform",
"a",
"commit",
"check",
"on",
"the",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/junos.py#L1344-L1364 |
34,767 | saltstack/salt | salt/modules/guestfs.py | mount | def mount(location, access='rw', root=None):
'''
Mount an image
CLI Example:
.. code-block:: bash
salt '*' guest.mount /srv/images/fedora.qcow
'''
if root is None:
root = os.path.join(
tempfile.gettempdir(),
'guest',
location.lstrip(os.sep).... | python | def mount(location, access='rw', root=None):
'''
Mount an image
CLI Example:
.. code-block:: bash
salt '*' guest.mount /srv/images/fedora.qcow
'''
if root is None:
root = os.path.join(
tempfile.gettempdir(),
'guest',
location.lstrip(os.sep).... | [
"def",
"mount",
"(",
"location",
",",
"access",
"=",
"'rw'",
",",
"root",
"=",
"None",
")",
":",
"if",
"root",
"is",
"None",
":",
"root",
"=",
"os",
".",
"path",
".",
"join",
"(",
"tempfile",
".",
"gettempdir",
"(",
")",
",",
"'guest'",
",",
"loc... | Mount an image
CLI Example:
.. code-block:: bash
salt '*' guest.mount /srv/images/fedora.qcow | [
"Mount",
"an",
"image"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/guestfs.py#L30-L68 |
34,768 | saltstack/salt | salt/states/drac.py | present | def present(name, password, permission):
'''
Ensure the user exists on the Dell DRAC
name:
The users username
password
The password used to authenticate
permission
The permissions that should be assigned to a user
'''
ret = {'name': name,
'result': True,... | python | def present(name, password, permission):
'''
Ensure the user exists on the Dell DRAC
name:
The users username
password
The password used to authenticate
permission
The permissions that should be assigned to a user
'''
ret = {'name': name,
'result': True,... | [
"def",
"present",
"(",
"name",
",",
"password",
",",
"permission",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"users",
"=",
"__salt__",
"[",
"'d... | Ensure the user exists on the Dell DRAC
name:
The users username
password
The password used to authenticate
permission
The permissions that should be assigned to a user | [
"Ensure",
"the",
"user",
"exists",
"on",
"the",
"Dell",
"DRAC"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/drac.py#L55-L94 |
34,769 | saltstack/salt | salt/states/drac.py | network | def network(ip, netmask, gateway):
'''
Ensure the DRAC network settings are consistent
'''
ret = {'name': ip,
'result': True,
'changes': {},
'comment': ''}
current_network = __salt__['drac.network_info']()
new_network = {}
if ip != current_network['IPv4 set... | python | def network(ip, netmask, gateway):
'''
Ensure the DRAC network settings are consistent
'''
ret = {'name': ip,
'result': True,
'changes': {},
'comment': ''}
current_network = __salt__['drac.network_info']()
new_network = {}
if ip != current_network['IPv4 set... | [
"def",
"network",
"(",
"ip",
",",
"netmask",
",",
"gateway",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"ip",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"current_network",
"=",
"__salt__",
"[",
"... | Ensure the DRAC network settings are consistent | [
"Ensure",
"the",
"DRAC",
"network",
"settings",
"are",
"consistent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/drac.py#L133-L173 |
34,770 | saltstack/salt | salt/transport/client.py | AsyncPushChannel.factory | def factory(opts, **kwargs):
'''
If we have additional IPC transports other than UxD and TCP, add them here
'''
# FIXME for now, just UXD
# Obviously, this makes the factory approach pointless, but we'll extend later
import salt.transport.ipc
return salt.transport... | python | def factory(opts, **kwargs):
'''
If we have additional IPC transports other than UxD and TCP, add them here
'''
# FIXME for now, just UXD
# Obviously, this makes the factory approach pointless, but we'll extend later
import salt.transport.ipc
return salt.transport... | [
"def",
"factory",
"(",
"opts",
",",
"*",
"*",
"kwargs",
")",
":",
"# FIXME for now, just UXD",
"# Obviously, this makes the factory approach pointless, but we'll extend later",
"import",
"salt",
".",
"transport",
".",
"ipc",
"return",
"salt",
".",
"transport",
".",
"ipc... | If we have additional IPC transports other than UxD and TCP, add them here | [
"If",
"we",
"have",
"additional",
"IPC",
"transports",
"other",
"than",
"UxD",
"and",
"TCP",
"add",
"them",
"here"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/client.py#L193-L200 |
34,771 | saltstack/salt | salt/transport/client.py | AsyncPullChannel.factory | def factory(opts, **kwargs):
'''
If we have additional IPC transports other than UXD and TCP, add them here
'''
import salt.transport.ipc
return salt.transport.ipc.IPCMessageServer(opts, **kwargs) | python | def factory(opts, **kwargs):
'''
If we have additional IPC transports other than UXD and TCP, add them here
'''
import salt.transport.ipc
return salt.transport.ipc.IPCMessageServer(opts, **kwargs) | [
"def",
"factory",
"(",
"opts",
",",
"*",
"*",
"kwargs",
")",
":",
"import",
"salt",
".",
"transport",
".",
"ipc",
"return",
"salt",
".",
"transport",
".",
"ipc",
".",
"IPCMessageServer",
"(",
"opts",
",",
"*",
"*",
"kwargs",
")"
] | If we have additional IPC transports other than UXD and TCP, add them here | [
"If",
"we",
"have",
"additional",
"IPC",
"transports",
"other",
"than",
"UXD",
"and",
"TCP",
"add",
"them",
"here"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/client.py#L208-L213 |
34,772 | saltstack/salt | salt/runners/reactor.py | list_ | def list_(saltenv='base', test=None):
'''
List currently configured reactors
CLI Example:
.. code-block:: bash
salt-run reactor.list
'''
sevent = salt.utils.event.get_event(
'master',
__opts__['sock_dir'],
__opts__['transport'],
opts=__o... | python | def list_(saltenv='base', test=None):
'''
List currently configured reactors
CLI Example:
.. code-block:: bash
salt-run reactor.list
'''
sevent = salt.utils.event.get_event(
'master',
__opts__['sock_dir'],
__opts__['transport'],
opts=__o... | [
"def",
"list_",
"(",
"saltenv",
"=",
"'base'",
",",
"test",
"=",
"None",
")",
":",
"sevent",
"=",
"salt",
".",
"utils",
".",
"event",
".",
"get_event",
"(",
"'master'",
",",
"__opts__",
"[",
"'sock_dir'",
"]",
",",
"__opts__",
"[",
"'transport'",
"]",
... | List currently configured reactors
CLI Example:
.. code-block:: bash
salt-run reactor.list | [
"List",
"currently",
"configured",
"reactors"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/reactor.py#L36-L59 |
34,773 | saltstack/salt | salt/runners/reactor.py | add | def add(event, reactors, saltenv='base', test=None):
'''
Add a new reactor
CLI Example:
.. code-block:: bash
salt-run reactor.add 'salt/cloud/*/destroyed' reactors='/srv/reactor/destroy/*.sls'
'''
if isinstance(reactors, string_types):
reactors = [reactors]
sevent = salt.... | python | def add(event, reactors, saltenv='base', test=None):
'''
Add a new reactor
CLI Example:
.. code-block:: bash
salt-run reactor.add 'salt/cloud/*/destroyed' reactors='/srv/reactor/destroy/*.sls'
'''
if isinstance(reactors, string_types):
reactors = [reactors]
sevent = salt.... | [
"def",
"add",
"(",
"event",
",",
"reactors",
",",
"saltenv",
"=",
"'base'",
",",
"test",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"reactors",
",",
"string_types",
")",
":",
"reactors",
"=",
"[",
"reactors",
"]",
"sevent",
"=",
"salt",
".",
"ut... | Add a new reactor
CLI Example:
.. code-block:: bash
salt-run reactor.add 'salt/cloud/*/destroyed' reactors='/srv/reactor/destroy/*.sls' | [
"Add",
"a",
"new",
"reactor"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/reactor.py#L62-L90 |
34,774 | saltstack/salt | salt/output/virt_query.py | output | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Display output for the salt-run virt.query function
'''
out = ''
for id_ in data['data']:
out += '{0}\n'.format(id_)
for vm_ in data['data'][id_]['vm_info']:
out += ' {0}\n'.format(vm_)
vm_dat... | python | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Display output for the salt-run virt.query function
'''
out = ''
for id_ in data['data']:
out += '{0}\n'.format(id_)
for vm_ in data['data'][id_]['vm_info']:
out += ' {0}\n'.format(vm_)
vm_dat... | [
"def",
"output",
"(",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"out",
"=",
"''",
"for",
"id_",
"in",
"data",
"[",
"'data'",
"]",
":",
"out",
"+=",
"'{0}\\n'",
".",
"format",
"(",
"id_",
")",
"for",
"vm_",
"in",
... | Display output for the salt-run virt.query function | [
"Display",
"output",
"for",
"the",
"salt",
"-",
"run",
"virt",
".",
"query",
"function"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/virt_query.py#L17-L50 |
34,775 | saltstack/salt | salt/modules/win_ip.py | _interface_configs | def _interface_configs():
'''
Return all interface configs
'''
cmd = ['netsh', 'interface', 'ip', 'show', 'config']
lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
ret = {}
current_iface = None
current_ip_list = None
for line in lines:
line = line.strip()
... | python | def _interface_configs():
'''
Return all interface configs
'''
cmd = ['netsh', 'interface', 'ip', 'show', 'config']
lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
ret = {}
current_iface = None
current_ip_list = None
for line in lines:
line = line.strip()
... | [
"def",
"_interface_configs",
"(",
")",
":",
"cmd",
"=",
"[",
"'netsh'",
",",
"'interface'",
",",
"'ip'",
",",
"'show'",
",",
"'config'",
"]",
"lines",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=",
"False",
")",
".",
"spl... | Return all interface configs | [
"Return",
"all",
"interface",
"configs"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L37-L90 |
34,776 | saltstack/salt | salt/modules/win_ip.py | is_enabled | def is_enabled(iface):
'''
Returns ``True`` if interface is enabled, otherwise ``False``
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.is_enabled 'Local Area Connection #2'
'''
cmd = ['netsh', 'interface', 'show', 'interface', 'name={0}'.format(iface)]
iface_fou... | python | def is_enabled(iface):
'''
Returns ``True`` if interface is enabled, otherwise ``False``
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.is_enabled 'Local Area Connection #2'
'''
cmd = ['netsh', 'interface', 'show', 'interface', 'name={0}'.format(iface)]
iface_fou... | [
"def",
"is_enabled",
"(",
"iface",
")",
":",
"cmd",
"=",
"[",
"'netsh'",
",",
"'interface'",
",",
"'show'",
",",
"'interface'",
",",
"'name={0}'",
".",
"format",
"(",
"iface",
")",
"]",
"iface_found",
"=",
"False",
"for",
"line",
"in",
"__salt__",
"[",
... | Returns ``True`` if interface is enabled, otherwise ``False``
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.is_enabled 'Local Area Connection #2' | [
"Returns",
"True",
"if",
"interface",
"is",
"enabled",
"otherwise",
"False"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L133-L153 |
34,777 | saltstack/salt | salt/modules/win_ip.py | enable | def enable(iface):
'''
Enable an interface
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.enable 'Local Area Connection #2'
'''
if is_enabled(iface):
return True
cmd = ['netsh', 'interface', 'set', 'interface',
'name={0}'.format(iface),
... | python | def enable(iface):
'''
Enable an interface
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.enable 'Local Area Connection #2'
'''
if is_enabled(iface):
return True
cmd = ['netsh', 'interface', 'set', 'interface',
'name={0}'.format(iface),
... | [
"def",
"enable",
"(",
"iface",
")",
":",
"if",
"is_enabled",
"(",
"iface",
")",
":",
"return",
"True",
"cmd",
"=",
"[",
"'netsh'",
",",
"'interface'",
",",
"'set'",
",",
"'interface'",
",",
"'name={0}'",
".",
"format",
"(",
"iface",
")",
",",
"'admin=E... | Enable an interface
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.enable 'Local Area Connection #2' | [
"Enable",
"an",
"interface"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L169-L185 |
34,778 | saltstack/salt | salt/modules/win_ip.py | disable | def disable(iface):
'''
Disable an interface
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.disable 'Local Area Connection #2'
'''
if is_disabled(iface):
return True
cmd = ['netsh', 'interface', 'set', 'interface',
'name={0}'.format(iface),
... | python | def disable(iface):
'''
Disable an interface
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.disable 'Local Area Connection #2'
'''
if is_disabled(iface):
return True
cmd = ['netsh', 'interface', 'set', 'interface',
'name={0}'.format(iface),
... | [
"def",
"disable",
"(",
"iface",
")",
":",
"if",
"is_disabled",
"(",
"iface",
")",
":",
"return",
"True",
"cmd",
"=",
"[",
"'netsh'",
",",
"'interface'",
",",
"'set'",
",",
"'interface'",
",",
"'name={0}'",
".",
"format",
"(",
"iface",
")",
",",
"'admin... | Disable an interface
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.disable 'Local Area Connection #2' | [
"Disable",
"an",
"interface"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L188-L204 |
34,779 | saltstack/salt | salt/modules/win_ip.py | get_subnet_length | def get_subnet_length(mask):
'''
Convenience function to convert the netmask to the CIDR subnet length
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0
'''
if not salt.utils.validate.net.netmask(mask):
raise SaltInvocationError(
... | python | def get_subnet_length(mask):
'''
Convenience function to convert the netmask to the CIDR subnet length
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0
'''
if not salt.utils.validate.net.netmask(mask):
raise SaltInvocationError(
... | [
"def",
"get_subnet_length",
"(",
"mask",
")",
":",
"if",
"not",
"salt",
".",
"utils",
".",
"validate",
".",
"net",
".",
"netmask",
"(",
"mask",
")",
":",
"raise",
"SaltInvocationError",
"(",
"'\\'{0}\\' is not a valid netmask'",
".",
"format",
"(",
"mask",
"... | Convenience function to convert the netmask to the CIDR subnet length
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0 | [
"Convenience",
"function",
"to",
"convert",
"the",
"netmask",
"to",
"the",
"CIDR",
"subnet",
"length"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L207-L221 |
34,780 | saltstack/salt | salt/modules/win_ip.py | set_static_ip | def set_static_ip(iface, addr, gateway=None, append=False):
'''
Set static IP configuration on a Windows NIC
iface
The name of the interface to manage
addr
IP address with subnet length (ex. ``10.1.2.3/24``). The
:mod:`ip.get_subnet_length <salt.modules.win_ip.get_subnet_length... | python | def set_static_ip(iface, addr, gateway=None, append=False):
'''
Set static IP configuration on a Windows NIC
iface
The name of the interface to manage
addr
IP address with subnet length (ex. ``10.1.2.3/24``). The
:mod:`ip.get_subnet_length <salt.modules.win_ip.get_subnet_length... | [
"def",
"set_static_ip",
"(",
"iface",
",",
"addr",
",",
"gateway",
"=",
"None",
",",
"append",
"=",
"False",
")",
":",
"def",
"_find_addr",
"(",
"iface",
",",
"addr",
",",
"timeout",
"=",
"1",
")",
":",
"ip",
",",
"cidr",
"=",
"addr",
".",
"rsplit"... | Set static IP configuration on a Windows NIC
iface
The name of the interface to manage
addr
IP address with subnet length (ex. ``10.1.2.3/24``). The
:mod:`ip.get_subnet_length <salt.modules.win_ip.get_subnet_length>`
function can be used to calculate the subnet length from a ne... | [
"Set",
"static",
"IP",
"configuration",
"on",
"a",
"Windows",
"NIC"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L224-L304 |
34,781 | saltstack/salt | salt/modules/win_ip.py | set_static_dns | def set_static_dns(iface, *addrs):
'''
Set static DNS configuration on a Windows NIC
Args:
iface (str): The name of the interface to set
addrs (*):
One or more DNS servers to be added. To clear the list of DNS
servers pass an empty list (``[]``). If undefined or ``... | python | def set_static_dns(iface, *addrs):
'''
Set static DNS configuration on a Windows NIC
Args:
iface (str): The name of the interface to set
addrs (*):
One or more DNS servers to be added. To clear the list of DNS
servers pass an empty list (``[]``). If undefined or ``... | [
"def",
"set_static_dns",
"(",
"iface",
",",
"*",
"addrs",
")",
":",
"if",
"addrs",
"is",
"(",
")",
"or",
"str",
"(",
"addrs",
"[",
"0",
"]",
")",
".",
"lower",
"(",
")",
"==",
"'none'",
":",
"return",
"{",
"'Interface'",
":",
"iface",
",",
"'DNS ... | Set static DNS configuration on a Windows NIC
Args:
iface (str): The name of the interface to set
addrs (*):
One or more DNS servers to be added. To clear the list of DNS
servers pass an empty list (``[]``). If undefined or ``None`` no
changes will be made.
... | [
"Set",
"static",
"DNS",
"configuration",
"on",
"a",
"Windows",
"NIC"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L322-L373 |
34,782 | saltstack/salt | salt/modules/win_ip.py | get_default_gateway | def get_default_gateway():
'''
Set DNS source to DHCP on Windows
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.get_default_gateway
'''
try:
return next(iter(
x.split()[-1] for x in __salt__['cmd.run'](
['netsh', 'interface', 'ip',... | python | def get_default_gateway():
'''
Set DNS source to DHCP on Windows
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.get_default_gateway
'''
try:
return next(iter(
x.split()[-1] for x in __salt__['cmd.run'](
['netsh', 'interface', 'ip',... | [
"def",
"get_default_gateway",
"(",
")",
":",
"try",
":",
"return",
"next",
"(",
"iter",
"(",
"x",
".",
"split",
"(",
")",
"[",
"-",
"1",
"]",
"for",
"x",
"in",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"[",
"'netsh'",
",",
"'interface'",
",",
"'ip'",... | Set DNS source to DHCP on Windows
CLI Example:
.. code-block:: bash
salt -G 'os_family:Windows' ip.get_default_gateway | [
"Set",
"DNS",
"source",
"to",
"DHCP",
"on",
"Windows"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_ip.py#L406-L425 |
34,783 | saltstack/salt | salt/modules/mac_group.py | _list_gids | def _list_gids():
'''
Return a list of gids in use
'''
output = __salt__['cmd.run'](
['dscacheutil', '-q', 'group'],
output_loglevel='quiet',
python_shell=False
)
ret = set()
for line in salt.utils.itertools.split(output, '\n'):
if line.startswith('gid:'):
... | python | def _list_gids():
'''
Return a list of gids in use
'''
output = __salt__['cmd.run'](
['dscacheutil', '-q', 'group'],
output_loglevel='quiet',
python_shell=False
)
ret = set()
for line in salt.utils.itertools.split(output, '\n'):
if line.startswith('gid:'):
... | [
"def",
"_list_gids",
"(",
")",
":",
"output",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"[",
"'dscacheutil'",
",",
"'-q'",
",",
"'group'",
"]",
",",
"output_loglevel",
"=",
"'quiet'",
",",
"python_shell",
"=",
"False",
")",
"ret",
"=",
"set",
"(",
"... | Return a list of gids in use | [
"Return",
"a",
"list",
"of",
"gids",
"in",
"use"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_group.py#L75-L88 |
34,784 | saltstack/salt | salt/modules/mac_group.py | _format_info | def _format_info(data):
'''
Return formatted information in a pretty way.
'''
return {'name': data.gr_name,
'gid': data.gr_gid,
'passwd': data.gr_passwd,
'members': data.gr_mem} | python | def _format_info(data):
'''
Return formatted information in a pretty way.
'''
return {'name': data.gr_name,
'gid': data.gr_gid,
'passwd': data.gr_passwd,
'members': data.gr_mem} | [
"def",
"_format_info",
"(",
"data",
")",
":",
"return",
"{",
"'name'",
":",
"data",
".",
"gr_name",
",",
"'gid'",
":",
"data",
".",
"gr_gid",
",",
"'passwd'",
":",
"data",
".",
"gr_passwd",
",",
"'members'",
":",
"data",
".",
"gr_mem",
"}"
] | Return formatted information in a pretty way. | [
"Return",
"formatted",
"information",
"in",
"a",
"pretty",
"way",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_group.py#L199-L206 |
34,785 | saltstack/salt | salt/pillar/cobbler.py | ext_pillar | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
key=None,
only=()):
'''
Read pillar data from Cobbler via its API.
'''
url = __opts__['cobbler.url']
user = __opts__['cobbler.user']
password = __opts__['cobbler.password']
log.info("Quer... | python | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
key=None,
only=()):
'''
Read pillar data from Cobbler via its API.
'''
url = __opts__['cobbler.url']
user = __opts__['cobbler.user']
password = __opts__['cobbler.password']
log.info("Quer... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"# pylint: disable=W0613",
"key",
"=",
"None",
",",
"only",
"=",
"(",
")",
")",
":",
"url",
"=",
"__opts__",
"[",
"'cobbler.url'",
"]",
"user",
"=",
"__opts__",
"[",
"'cobbler.user'",
"]",
"passwor... | Read pillar data from Cobbler via its API. | [
"Read",
"pillar",
"data",
"from",
"Cobbler",
"via",
"its",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cobbler.py#L44-L72 |
34,786 | saltstack/salt | salt/states/rvm.py | _check_ruby | def _check_ruby(ret, ruby, user=None):
'''
Check that ruby is installed
'''
match_version = True
match_micro_version = False
micro_version_regex = re.compile(r'-([0-9]{4}\.[0-9]{2}|p[0-9]+)$')
if micro_version_regex.search(ruby):
match_micro_version = True
if re.search('^[a-z]+$'... | python | def _check_ruby(ret, ruby, user=None):
'''
Check that ruby is installed
'''
match_version = True
match_micro_version = False
micro_version_regex = re.compile(r'-([0-9]{4}\.[0-9]{2}|p[0-9]+)$')
if micro_version_regex.search(ruby):
match_micro_version = True
if re.search('^[a-z]+$'... | [
"def",
"_check_ruby",
"(",
"ret",
",",
"ruby",
",",
"user",
"=",
"None",
")",
":",
"match_version",
"=",
"True",
"match_micro_version",
"=",
"False",
"micro_version_regex",
"=",
"re",
".",
"compile",
"(",
"r'-([0-9]{4}\\.[0-9]{2}|p[0-9]+)$'",
")",
"if",
"micro_v... | Check that ruby is installed | [
"Check",
"that",
"ruby",
"is",
"installed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rvm.py#L141-L166 |
34,787 | saltstack/salt | salt/states/rvm.py | installed | def installed(name, default=False, user=None, opts=None, env=None):
'''
Verify that the specified ruby is installed with RVM. RVM is
installed when necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user... | python | def installed(name, default=False, user=None, opts=None, env=None):
'''
Verify that the specified ruby is installed with RVM. RVM is
installed when necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user... | [
"def",
"installed",
"(",
"name",
",",
"default",
"=",
"False",
",",
"user",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''... | Verify that the specified ruby is installed with RVM. RVM is
installed when necessary.
name
The version of ruby to install
default : False
Whether to make this ruby the default.
user: None
The user to run rvm as.
env: None
A list of environment variables to set (i... | [
"Verify",
"that",
"the",
"specified",
"ruby",
"is",
"installed",
"with",
"RVM",
".",
"RVM",
"is",
"installed",
"when",
"necessary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rvm.py#L169-L205 |
34,788 | saltstack/salt | salt/states/rvm.py | gemset_present | def gemset_present(name, ruby='default', user=None):
'''
Verify that the gemset is present.
name
The name of the gemset.
ruby: default
The ruby version this gemset belongs to.
user: None
The user to run rvm as.
.. versionadded:: 0.17.0
'''
ret = {'name': n... | python | def gemset_present(name, ruby='default', user=None):
'''
Verify that the gemset is present.
name
The name of the gemset.
ruby: default
The ruby version this gemset belongs to.
user: None
The user to run rvm as.
.. versionadded:: 0.17.0
'''
ret = {'name': n... | [
"def",
"gemset_present",
"(",
"name",
",",
"ruby",
"=",
"'default'",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"ret",... | Verify that the gemset is present.
name
The name of the gemset.
ruby: default
The ruby version this gemset belongs to.
user: None
The user to run rvm as.
.. versionadded:: 0.17.0 | [
"Verify",
"that",
"the",
"gemset",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rvm.py#L208-L253 |
34,789 | saltstack/salt | salt/pillar/sqlcipher.py | ext_pillar | def ext_pillar(minion_id,
pillar,
*args,
**kwargs):
'''
Execute queries against SQLCipher, merge and return as a dict
'''
return SQLCipherExtPillar().fetch(minion_id, pillar, *args, **kwargs) | python | def ext_pillar(minion_id,
pillar,
*args,
**kwargs):
'''
Execute queries against SQLCipher, merge and return as a dict
'''
return SQLCipherExtPillar().fetch(minion_id, pillar, *args, **kwargs) | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"SQLCipherExtPillar",
"(",
")",
".",
"fetch",
"(",
"minion_id",
",",
"pillar",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | Execute queries against SQLCipher, merge and return as a dict | [
"Execute",
"queries",
"against",
"SQLCipher",
"merge",
"and",
"return",
"as",
"a",
"dict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sqlcipher.py#L130-L137 |
34,790 | saltstack/salt | salt/pillar/sqlcipher.py | SQLCipherExtPillar._get_cursor | def _get_cursor(self):
'''
Yield a SQLCipher cursor
'''
_options = self._get_options()
conn = sqlcipher.connect(_options.get('database'),
timeout=float(_options.get('timeout')))
conn.execute('pragma key="{0}"'.format(_options.get('pass')))... | python | def _get_cursor(self):
'''
Yield a SQLCipher cursor
'''
_options = self._get_options()
conn = sqlcipher.connect(_options.get('database'),
timeout=float(_options.get('timeout')))
conn.execute('pragma key="{0}"'.format(_options.get('pass')))... | [
"def",
"_get_cursor",
"(",
"self",
")",
":",
"_options",
"=",
"self",
".",
"_get_options",
"(",
")",
"conn",
"=",
"sqlcipher",
".",
"connect",
"(",
"_options",
".",
"get",
"(",
"'database'",
")",
",",
"timeout",
"=",
"float",
"(",
"_options",
".",
"get... | Yield a SQLCipher cursor | [
"Yield",
"a",
"SQLCipher",
"cursor"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sqlcipher.py#L113-L127 |
34,791 | saltstack/salt | salt/modules/ldap3.py | _convert_exception | def _convert_exception(e):
'''Convert an ldap backend exception to an LDAPError and raise it.'''
args = ('exception in ldap backend: {0}'.format(repr(e)), e)
if six.PY2:
six.reraise(LDAPError, args, sys.exc_info()[2])
else:
six.raise_from(LDAPError(*args), e) | python | def _convert_exception(e):
'''Convert an ldap backend exception to an LDAPError and raise it.'''
args = ('exception in ldap backend: {0}'.format(repr(e)), e)
if six.PY2:
six.reraise(LDAPError, args, sys.exc_info()[2])
else:
six.raise_from(LDAPError(*args), e) | [
"def",
"_convert_exception",
"(",
"e",
")",
":",
"args",
"=",
"(",
"'exception in ldap backend: {0}'",
".",
"format",
"(",
"repr",
"(",
"e",
")",
")",
",",
"e",
")",
"if",
"six",
".",
"PY2",
":",
"six",
".",
"reraise",
"(",
"LDAPError",
",",
"args",
... | Convert an ldap backend exception to an LDAPError and raise it. | [
"Convert",
"an",
"ldap",
"backend",
"exception",
"to",
"an",
"LDAPError",
"and",
"raise",
"it",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L53-L59 |
34,792 | saltstack/salt | salt/modules/ldap3.py | _bind | def _bind(l, bind=None):
'''Bind helper.'''
if bind is None:
return
method = bind.get('method', 'simple')
if method is None:
return
elif method == 'simple':
l.simple_bind_s(bind.get('dn', ''), bind.get('password', ''))
elif method == 'sasl':
sasl_class = getattr(l... | python | def _bind(l, bind=None):
'''Bind helper.'''
if bind is None:
return
method = bind.get('method', 'simple')
if method is None:
return
elif method == 'simple':
l.simple_bind_s(bind.get('dn', ''), bind.get('password', ''))
elif method == 'sasl':
sasl_class = getattr(l... | [
"def",
"_bind",
"(",
"l",
",",
"bind",
"=",
"None",
")",
":",
"if",
"bind",
"is",
"None",
":",
"return",
"method",
"=",
"bind",
".",
"get",
"(",
"'method'",
",",
"'simple'",
")",
"if",
"method",
"is",
"None",
":",
"return",
"elif",
"method",
"==",
... | Bind helper. | [
"Bind",
"helper",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L62-L81 |
34,793 | saltstack/salt | salt/modules/ldap3.py | connect | def connect(connect_spec=None):
'''Connect and optionally bind to an LDAP server.
:param connect_spec:
This can be an LDAP connection object returned by a previous
call to :py:func:`connect` (in which case the argument is
simply returned), ``None`` (in which case an empty dict is
... | python | def connect(connect_spec=None):
'''Connect and optionally bind to an LDAP server.
:param connect_spec:
This can be an LDAP connection object returned by a previous
call to :py:func:`connect` (in which case the argument is
simply returned), ``None`` (in which case an empty dict is
... | [
"def",
"connect",
"(",
"connect_spec",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"connect_spec",
",",
"_connect_ctx",
")",
":",
"return",
"connect_spec",
"if",
"connect_spec",
"is",
"None",
":",
"connect_spec",
"=",
"{",
"}",
"backend_name",
"=",
"conn... | Connect and optionally bind to an LDAP server.
:param connect_spec:
This can be an LDAP connection object returned by a previous
call to :py:func:`connect` (in which case the argument is
simply returned), ``None`` (in which case an empty dict is
used), or a dict with the following k... | [
"Connect",
"and",
"optionally",
"bind",
"to",
"an",
"LDAP",
"server",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L109-L306 |
34,794 | saltstack/salt | salt/modules/ldap3.py | search | def search(connect_spec, base, scope='subtree', filterstr='(objectClass=*)',
attrlist=None, attrsonly=0):
'''Search an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param base:
Distinguished name of ... | python | def search(connect_spec, base, scope='subtree', filterstr='(objectClass=*)',
attrlist=None, attrsonly=0):
'''Search an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param base:
Distinguished name of ... | [
"def",
"search",
"(",
"connect_spec",
",",
"base",
",",
"scope",
"=",
"'subtree'",
",",
"filterstr",
"=",
"'(objectClass=*)'",
",",
"attrlist",
"=",
"None",
",",
"attrsonly",
"=",
"0",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"scope",
"="... | Search an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param base:
Distinguished name of the entry at which to start the search.
:param scope:
One of the following:
* ``'subtree'``
... | [
"Search",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L309-L369 |
34,795 | saltstack/salt | salt/modules/ldap3.py | add | def add(connect_spec, dn, attributes):
'''Add an entry to an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param attributes:
Non-empty dict mapping each ... | python | def add(connect_spec, dn, attributes):
'''Add an entry to an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param attributes:
Non-empty dict mapping each ... | [
"def",
"add",
"(",
"connect_spec",
",",
"dn",
",",
"attributes",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"# convert the \"iterable of values\" to lists in case that's what",
"# addModlist() expects (also to ensure that the caller's objects",
"# are not modified)"... | Add an entry to an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:param attributes:
Non-empty dict mapping each of the new entry's attributes to a
non... | [
"Add",
"an",
"entry",
"to",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L372-L417 |
34,796 | saltstack/salt | salt/modules/ldap3.py | delete | def delete(connect_spec, dn):
'''Delete an entry from an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:returns:
``True`` if successful, raises an excepti... | python | def delete(connect_spec, dn):
'''Delete an entry from an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:returns:
``True`` if successful, raises an excepti... | [
"def",
"delete",
"(",
"connect_spec",
",",
"dn",
")",
":",
"l",
"=",
"connect",
"(",
"connect_spec",
")",
"log",
".",
"info",
"(",
"'deleting entry: dn: %s'",
",",
"repr",
"(",
"dn",
")",
")",
"try",
":",
"l",
".",
"c",
".",
"delete_s",
"(",
"dn",
... | Delete an entry from an LDAP database.
:param connect_spec:
See the documentation for the ``connect_spec`` parameter for
:py:func:`connect`.
:param dn:
Distinguished name of the entry.
:returns:
``True`` if successful, raises an exception otherwise.
CLI example:
... | [
"Delete",
"an",
"entry",
"from",
"an",
"LDAP",
"database",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ldap3.py#L420-L450 |
34,797 | saltstack/salt | salt/states/grafana.py | _parse_profile | def _parse_profile(profile):
'''
From a pillar key, or a dictionary, return index and host keys.
'''
if isinstance(profile, string_types):
_profile = __salt__['config.option'](profile)
if not _profile:
msg = 'Pillar key for profile {0} not found.'.format(profile)
... | python | def _parse_profile(profile):
'''
From a pillar key, or a dictionary, return index and host keys.
'''
if isinstance(profile, string_types):
_profile = __salt__['config.option'](profile)
if not _profile:
msg = 'Pillar key for profile {0} not found.'.format(profile)
... | [
"def",
"_parse_profile",
"(",
"profile",
")",
":",
"if",
"isinstance",
"(",
"profile",
",",
"string_types",
")",
":",
"_profile",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"if",
"not",
"_profile",
":",
"msg",
"=",
"'Pillar key for pr... | From a pillar key, or a dictionary, return index and host keys. | [
"From",
"a",
"pillar",
"key",
"or",
"a",
"dictionary",
"return",
"index",
"and",
"host",
"keys",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana.py#L189-L202 |
34,798 | saltstack/salt | salt/states/grafana.py | _rows_differ | def _rows_differ(row, _row):
'''
Check if grafana dashboard row and _row differ
'''
row_copy = copy.deepcopy(row)
_row_copy = copy.deepcopy(_row)
# Strip id from all panels in both rows, since they are always generated.
for panel in row_copy['panels']:
if 'id' in panel:
d... | python | def _rows_differ(row, _row):
'''
Check if grafana dashboard row and _row differ
'''
row_copy = copy.deepcopy(row)
_row_copy = copy.deepcopy(_row)
# Strip id from all panels in both rows, since they are always generated.
for panel in row_copy['panels']:
if 'id' in panel:
d... | [
"def",
"_rows_differ",
"(",
"row",
",",
"_row",
")",
":",
"row_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"row",
")",
"_row_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"_row",
")",
"# Strip id from all panels in both rows, since they are always generated.",
"for",
"p... | Check if grafana dashboard row and _row differ | [
"Check",
"if",
"grafana",
"dashboard",
"row",
"and",
"_row",
"differ"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana.py#L205-L219 |
34,799 | saltstack/salt | salt/states/grafana.py | dashboard_absent | def dashboard_absent(
name,
hosts=None,
profile='grafana'):
'''
Ensure the named grafana dashboard is deleted.
name
Name of the grafana dashboard.
profile
A pillar key or dict that contains a list of hosts and an
elasticsearch index to use.
'''
r... | python | def dashboard_absent(
name,
hosts=None,
profile='grafana'):
'''
Ensure the named grafana dashboard is deleted.
name
Name of the grafana dashboard.
profile
A pillar key or dict that contains a list of hosts and an
elasticsearch index to use.
'''
r... | [
"def",
"dashboard_absent",
"(",
"name",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"'grafana'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
... | Ensure the named grafana dashboard is deleted.
name
Name of the grafana dashboard.
profile
A pillar key or dict that contains a list of hosts and an
elasticsearch index to use. | [
"Ensure",
"the",
"named",
"grafana",
"dashboard",
"is",
"deleted",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana.py#L372-L416 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.