partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
dns_check
Return the ip resolved by dns, but do not exit on failure, only raise an exception. Obeys system preference for IPv4/6 address resolution - this can be overridden by the ipv6 flag. Tries to connect to the address before considering it useful. If no address can be reached, the first one resolved is used ...
salt/utils/network.py
def dns_check(addr, port=80, safe=False, ipv6=None, attempt_connect=True): ''' Return the ip resolved by dns, but do not exit on failure, only raise an exception. Obeys system preference for IPv4/6 address resolution - this can be overridden by the ipv6 flag. Tries to connect to the address before c...
def dns_check(addr, port=80, safe=False, ipv6=None, attempt_connect=True): ''' Return the ip resolved by dns, but do not exit on failure, only raise an exception. Obeys system preference for IPv4/6 address resolution - this can be overridden by the ipv6 flag. Tries to connect to the address before c...
[ "Return", "the", "ip", "resolved", "by", "dns", "but", "do", "not", "exit", "on", "failure", "only", "raise", "an", "exception", ".", "Obeys", "system", "preference", "for", "IPv4", "/", "6", "address", "resolution", "-", "this", "can", "be", "overridden",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/network.py#L1912-L2002
[ "def", "dns_check", "(", "addr", ",", "port", "=", "80", ",", "safe", "=", "False", ",", "ipv6", "=", "None", ",", "attempt_connect", "=", "True", ")", ":", "error", "=", "False", "lookup", "=", "addr", "seen_ipv6", "=", "False", "family", "=", "sock...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
parse_host_port
Takes a string argument specifying host or host:port. Returns a (hostname, port) or (ip_address, port) tuple. If no port is given, the second (port) element of the returned tuple will be None. host:port argument, for example, is accepted in the forms of: - hostname - hostname:1234 - host...
salt/utils/network.py
def parse_host_port(host_port): """ Takes a string argument specifying host or host:port. Returns a (hostname, port) or (ip_address, port) tuple. If no port is given, the second (port) element of the returned tuple will be None. host:port argument, for example, is accepted in the forms of: -...
def parse_host_port(host_port): """ Takes a string argument specifying host or host:port. Returns a (hostname, port) or (ip_address, port) tuple. If no port is given, the second (port) element of the returned tuple will be None. host:port argument, for example, is accepted in the forms of: -...
[ "Takes", "a", "string", "argument", "specifying", "host", "or", "host", ":", "port", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/network.py#L2005-L2054
[ "def", "parse_host_port", "(", "host_port", ")", ":", "host", ",", "port", "=", "None", ",", "None", "# default", "_s_", "=", "host_port", "[", ":", "]", "if", "_s_", "[", "0", "]", "==", "\"[\"", ":", "if", "\"]\"", "in", "host_port", ":", "host", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_fqdn
Verify if hostname conforms to be a FQDN. :param hostname: text string with the name of the host :return: bool, True if hostname is correct FQDN, False otherwise
salt/utils/network.py
def is_fqdn(hostname): """ Verify if hostname conforms to be a FQDN. :param hostname: text string with the name of the host :return: bool, True if hostname is correct FQDN, False otherwise """ compliant = re.compile(r"(?!-)[A-Z\d\-\_]{1,63}(?<!-)$", re.IGNORECASE) return "." in hostname an...
def is_fqdn(hostname): """ Verify if hostname conforms to be a FQDN. :param hostname: text string with the name of the host :return: bool, True if hostname is correct FQDN, False otherwise """ compliant = re.compile(r"(?!-)[A-Z\d\-\_]{1,63}(?<!-)$", re.IGNORECASE) return "." in hostname an...
[ "Verify", "if", "hostname", "conforms", "to", "be", "a", "FQDN", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/network.py#L2057-L2066
[ "def", "is_fqdn", "(", "hostname", ")", ":", "compliant", "=", "re", ".", "compile", "(", "r\"(?!-)[A-Z\\d\\-\\_]{1,63}(?<!-)$\"", ",", "re", ".", "IGNORECASE", ")", "return", "\".\"", "in", "hostname", "and", "len", "(", "hostname", ")", "<", "0xff", "and",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_active_mounts
List active mounts on Linux systems
salt/modules/mount.py
def _active_mounts(ret): ''' List active mounts on Linux systems ''' _list = _list_mounts() filename = '/proc/self/mounts' if not os.access(filename, os.R_OK): msg = 'File not readable {0}' raise CommandExecutionError(msg.format(filename)) with salt.utils.files.fopen(filenam...
def _active_mounts(ret): ''' List active mounts on Linux systems ''' _list = _list_mounts() filename = '/proc/self/mounts' if not os.access(filename, os.R_OK): msg = 'File not readable {0}' raise CommandExecutionError(msg.format(filename)) with salt.utils.files.fopen(filenam...
[ "List", "active", "mounts", "on", "Linux", "systems" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L102-L119
[ "def", "_active_mounts", "(", "ret", ")", ":", "_list", "=", "_list_mounts", "(", ")", "filename", "=", "'/proc/self/mounts'", "if", "not", "os", ".", "access", "(", "filename", ",", "os", ".", "R_OK", ")", ":", "msg", "=", "'File not readable {0}'", "rais...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_active_mounts_aix
List active mounts on AIX systems
salt/modules/mount.py
def _active_mounts_aix(ret): ''' List active mounts on AIX systems ''' for line in __salt__['cmd.run_stdout']('mount -p').split('\n'): comps = re.sub(r"\s+", " ", line).split() if comps: if comps[0] == 'node' or comps[0] == '--------': continue com...
def _active_mounts_aix(ret): ''' List active mounts on AIX systems ''' for line in __salt__['cmd.run_stdout']('mount -p').split('\n'): comps = re.sub(r"\s+", " ", line).split() if comps: if comps[0] == 'node' or comps[0] == '--------': continue com...
[ "List", "active", "mounts", "on", "AIX", "systems" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L122-L152
[ "def", "_active_mounts_aix", "(", "ret", ")", ":", "for", "line", "in", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'mount -p'", ")", ".", "split", "(", "'\\n'", ")", ":", "comps", "=", "re", ".", "sub", "(", "r\"\\s+\"", ",", "\" \"", ",", "line",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_active_mounts_freebsd
List active mounts on FreeBSD systems
salt/modules/mount.py
def _active_mounts_freebsd(ret): ''' List active mounts on FreeBSD systems ''' for line in __salt__['cmd.run_stdout']('mount -p').split('\n'): comps = re.sub(r"\s+", " ", line).split() ret[comps[1]] = {'device': comps[0], 'fstype': comps[2], ...
def _active_mounts_freebsd(ret): ''' List active mounts on FreeBSD systems ''' for line in __salt__['cmd.run_stdout']('mount -p').split('\n'): comps = re.sub(r"\s+", " ", line).split() ret[comps[1]] = {'device': comps[0], 'fstype': comps[2], ...
[ "List", "active", "mounts", "on", "FreeBSD", "systems" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L155-L164
[ "def", "_active_mounts_freebsd", "(", "ret", ")", ":", "for", "line", "in", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'mount -p'", ")", ".", "split", "(", "'\\n'", ")", ":", "comps", "=", "re", ".", "sub", "(", "r\"\\s+\"", ",", "\" \"", ",", "li...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_active_mounts_openbsd
List active mounts on OpenBSD systems
salt/modules/mount.py
def _active_mounts_openbsd(ret): ''' List active mounts on OpenBSD systems ''' for line in __salt__['cmd.run_stdout']('mount -v').split('\n'): comps = re.sub(r"\s+", " ", line).split() parens = re.findall(r'\((.*?)\)', line, re.DOTALL) if len(parens) > 1: nod = __salt...
def _active_mounts_openbsd(ret): ''' List active mounts on OpenBSD systems ''' for line in __salt__['cmd.run_stdout']('mount -v').split('\n'): comps = re.sub(r"\s+", " ", line).split() parens = re.findall(r'\((.*?)\)', line, re.DOTALL) if len(parens) > 1: nod = __salt...
[ "List", "active", "mounts", "on", "OpenBSD", "systems" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L179-L199
[ "def", "_active_mounts_openbsd", "(", "ret", ")", ":", "for", "line", "in", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'mount -v'", ")", ".", "split", "(", "'\\n'", ")", ":", "comps", "=", "re", ".", "sub", "(", "r\"\\s+\"", ",", "\" \"", ",", "li...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_active_mounts_darwin
List active mounts on Mac OS systems
salt/modules/mount.py
def _active_mounts_darwin(ret): ''' List active mounts on Mac OS systems ''' for line in __salt__['cmd.run_stdout']('mount').split('\n'): comps = re.sub(r"\s+", " ", line).split() parens = re.findall(r'\((.*?)\)', line, re.DOTALL)[0].split(", ") ret[comps[2]] = {'device': comps[0...
def _active_mounts_darwin(ret): ''' List active mounts on Mac OS systems ''' for line in __salt__['cmd.run_stdout']('mount').split('\n'): comps = re.sub(r"\s+", " ", line).split() parens = re.findall(r'\((.*?)\)', line, re.DOTALL)[0].split(", ") ret[comps[2]] = {'device': comps[0...
[ "List", "active", "mounts", "on", "Mac", "OS", "systems" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L202-L212
[ "def", "_active_mounts_darwin", "(", "ret", ")", ":", "for", "line", "in", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'mount'", ")", ".", "split", "(", "'\\n'", ")", ":", "comps", "=", "re", ".", "sub", "(", "r\"\\s+\"", ",", "\" \"", ",", "line",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_resolve_user_group_names
Resolve user and group names in related opts
salt/modules/mount.py
def _resolve_user_group_names(opts): ''' Resolve user and group names in related opts ''' name_id_opts = {'uid': 'user.info', 'gid': 'group.info'} for ind, opt in enumerate(opts): if opt.split('=')[0] in name_id_opts: _givenid = opt.split('=')[1] _...
def _resolve_user_group_names(opts): ''' Resolve user and group names in related opts ''' name_id_opts = {'uid': 'user.info', 'gid': 'group.info'} for ind, opt in enumerate(opts): if opt.split('=')[0] in name_id_opts: _givenid = opt.split('=')[1] _...
[ "Resolve", "user", "and", "group", "names", "in", "related", "opts" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L215-L232
[ "def", "_resolve_user_group_names", "(", "opts", ")", ":", "name_id_opts", "=", "{", "'uid'", ":", "'user.info'", ",", "'gid'", ":", "'group.info'", "}", "for", "ind", ",", "opt", "in", "enumerate", "(", "opts", ")", ":", "if", "opt", ".", "split", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
active
List the active mounts. CLI Example: .. code-block:: bash salt '*' mount.active
salt/modules/mount.py
def active(extended=False): ''' List the active mounts. CLI Example: .. code-block:: bash salt '*' mount.active ''' ret = {} if __grains__['os'] == 'FreeBSD': _active_mounts_freebsd(ret) elif 'AIX' in __grains__['kernel']: _active_mounts_aix(ret) elif __gra...
def active(extended=False): ''' List the active mounts. CLI Example: .. code-block:: bash salt '*' mount.active ''' ret = {} if __grains__['os'] == 'FreeBSD': _active_mounts_freebsd(ret) elif 'AIX' in __grains__['kernel']: _active_mounts_aix(ret) elif __gra...
[ "List", "the", "active", "mounts", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L235-L264
[ "def", "active", "(", "extended", "=", "False", ")", ":", "ret", "=", "{", "}", "if", "__grains__", "[", "'os'", "]", "==", "'FreeBSD'", ":", "_active_mounts_freebsd", "(", "ret", ")", "elif", "'AIX'", "in", "__grains__", "[", "'kernel'", "]", ":", "_a...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fstab
.. versionchanged:: 2016.3.2 List the contents of the fstab CLI Example: .. code-block:: bash salt '*' mount.fstab
salt/modules/mount.py
def fstab(config='/etc/fstab'): ''' .. versionchanged:: 2016.3.2 List the contents of the fstab CLI Example: .. code-block:: bash salt '*' mount.fstab ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for ...
def fstab(config='/etc/fstab'): ''' .. versionchanged:: 2016.3.2 List the contents of the fstab CLI Example: .. code-block:: bash salt '*' mount.fstab ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for ...
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "2" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L577-L617
[ "def", "fstab", "(", "config", "=", "'/etc/fstab'", ")", ":", "ret", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "config", ")", ":", "return", "ret", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "config", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_fstab
.. versionchanged:: 2016.3.2 Remove the mount point from the fstab CLI Example: .. code-block:: bash salt '*' mount.rm_fstab /mnt/foo /dev/sdg
salt/modules/mount.py
def rm_fstab(name, device, config='/etc/fstab'): ''' .. versionchanged:: 2016.3.2 Remove the mount point from the fstab CLI Example: .. code-block:: bash salt '*' mount.rm_fstab /mnt/foo /dev/sdg ''' modified = False if __grains__['kernel'] == 'SunOS': criteria = _vf...
def rm_fstab(name, device, config='/etc/fstab'): ''' .. versionchanged:: 2016.3.2 Remove the mount point from the fstab CLI Example: .. code-block:: bash salt '*' mount.rm_fstab /mnt/foo /dev/sdg ''' modified = False if __grains__['kernel'] == 'SunOS': criteria = _vf...
[ "..", "versionchanged", "::", "2016", ".", "3", ".", "2" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L636-L685
[ "def", "rm_fstab", "(", "name", ",", "device", ",", "config", "=", "'/etc/fstab'", ")", ":", "modified", "=", "False", "if", "__grains__", "[", "'kernel'", "]", "==", "'SunOS'", ":", "criteria", "=", "_vfstab_entry", "(", "name", "=", "name", ",", "devic...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_fstab
Verify that this mount is represented in the fstab, change the mount to match the data passed, or add the mount if it is not present. CLI Example: .. code-block:: bash salt '*' mount.set_fstab /mnt/foo /dev/sdz1 ext4
salt/modules/mount.py
def set_fstab( name, device, fstype, opts='defaults', dump=0, pass_num=0, config='/etc/fstab', test=False, match_on='auto', **kwargs): ''' Verify that this mount is represented in the fstab, change the mount to match the data pa...
def set_fstab( name, device, fstype, opts='defaults', dump=0, pass_num=0, config='/etc/fstab', test=False, match_on='auto', **kwargs): ''' Verify that this mount is represented in the fstab, change the mount to match the data pa...
[ "Verify", "that", "this", "mount", "is", "represented", "in", "the", "fstab", "change", "the", "mount", "to", "match", "the", "data", "passed", "or", "add", "the", "mount", "if", "it", "is", "not", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L704-L826
[ "def", "set_fstab", "(", "name", ",", "device", ",", "fstype", ",", "opts", "=", "'defaults'", ",", "dump", "=", "0", ",", "pass_num", "=", "0", ",", "config", "=", "'/etc/fstab'", ",", "test", "=", "False", ",", "match_on", "=", "'auto'", ",", "*", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_automaster
Remove the mount point from the auto_master CLI Example: .. code-block:: bash salt '*' mount.rm_automaster /mnt/foo /dev/sdg
salt/modules/mount.py
def rm_automaster(name, device, config='/etc/auto_salt'): ''' Remove the mount point from the auto_master CLI Example: .. code-block:: bash salt '*' mount.rm_automaster /mnt/foo /dev/sdg ''' contents = automaster(config) if name not in contents: return True # The entry...
def rm_automaster(name, device, config='/etc/auto_salt'): ''' Remove the mount point from the auto_master CLI Example: .. code-block:: bash salt '*' mount.rm_automaster /mnt/foo /dev/sdg ''' contents = automaster(config) if name not in contents: return True # The entry...
[ "Remove", "the", "mount", "point", "from", "the", "auto_master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L958-L1016
[ "def", "rm_automaster", "(", "name", ",", "device", ",", "config", "=", "'/etc/auto_salt'", ")", ":", "contents", "=", "automaster", "(", "config", ")", "if", "name", "not", "in", "contents", ":", "return", "True", "# The entry is present, get rid of it", "lines...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_automaster
Verify that this mount is represented in the auto_salt, change the mount to match the data passed, or add the mount if it is not present. CLI Example: .. code-block:: bash salt '*' mount.set_automaster /mnt/foo /dev/sdz1 ext4
salt/modules/mount.py
def set_automaster( name, device, fstype, opts='', config='/etc/auto_salt', test=False, **kwargs): ''' Verify that this mount is represented in the auto_salt, change the mount to match the data passed, or add the mount if it is not present. CLI Ex...
def set_automaster( name, device, fstype, opts='', config='/etc/auto_salt', test=False, **kwargs): ''' Verify that this mount is represented in the auto_salt, change the mount to match the data passed, or add the mount if it is not present. CLI Ex...
[ "Verify", "that", "this", "mount", "is", "represented", "in", "the", "auto_salt", "change", "the", "mount", "to", "match", "the", "data", "passed", "or", "add", "the", "mount", "if", "it", "is", "not", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1019-L1136
[ "def", "set_automaster", "(", "name", ",", "device", ",", "fstype", ",", "opts", "=", "''", ",", "config", "=", "'/etc/auto_salt'", ",", "test", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# Fix the opts type if it is a list", "if", "isinstance", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
automaster
List the contents of the auto master CLI Example: .. code-block:: bash salt '*' mount.automaster
salt/modules/mount.py
def automaster(config='/etc/auto_salt'): ''' List the contents of the auto master CLI Example: .. code-block:: bash salt '*' mount.automaster ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for line in ifile:...
def automaster(config='/etc/auto_salt'): ''' List the contents of the auto master CLI Example: .. code-block:: bash salt '*' mount.automaster ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for line in ifile:...
[ "List", "the", "contents", "of", "the", "auto", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1139-L1174
[ "def", "automaster", "(", "config", "=", "'/etc/auto_salt'", ")", ":", "ret", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "config", ")", ":", "return", "ret", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "co...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mount
Mount a device CLI Example: .. code-block:: bash salt '*' mount.mount /mnt/foo /dev/sdz1 True
salt/modules/mount.py
def mount(name, device, mkmnt=False, fstype='', opts='defaults', user=None, util='mount'): ''' Mount a device CLI Example: .. code-block:: bash salt '*' mount.mount /mnt/foo /dev/sdz1 True ''' if util != 'mount': # This functionality used to live in img.mount_image if ...
def mount(name, device, mkmnt=False, fstype='', opts='defaults', user=None, util='mount'): ''' Mount a device CLI Example: .. code-block:: bash salt '*' mount.mount /mnt/foo /dev/sdz1 True ''' if util != 'mount': # This functionality used to live in img.mount_image if ...
[ "Mount", "a", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1177-L1230
[ "def", "mount", "(", "name", ",", "device", ",", "mkmnt", "=", "False", ",", "fstype", "=", "''", ",", "opts", "=", "'defaults'", ",", "user", "=", "None", ",", "util", "=", "'mount'", ")", ":", "if", "util", "!=", "'mount'", ":", "# This functionali...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remount
Attempt to remount a device, if the device is not already mounted, mount is called CLI Example: .. code-block:: bash salt '*' mount.remount /mnt/foo /dev/sdz1 True
salt/modules/mount.py
def remount(name, device, mkmnt=False, fstype='', opts='defaults', user=None): ''' Attempt to remount a device, if the device is not already mounted, mount is called CLI Example: .. code-block:: bash salt '*' mount.remount /mnt/foo /dev/sdz1 True ''' force_mount = False if __g...
def remount(name, device, mkmnt=False, fstype='', opts='defaults', user=None): ''' Attempt to remount a device, if the device is not already mounted, mount is called CLI Example: .. code-block:: bash salt '*' mount.remount /mnt/foo /dev/sdz1 True ''' force_mount = False if __g...
[ "Attempt", "to", "remount", "a", "device", "if", "the", "device", "is", "not", "already", "mounted", "mount", "is", "called" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1233-L1288
[ "def", "remount", "(", "name", ",", "device", ",", "mkmnt", "=", "False", ",", "fstype", "=", "''", ",", "opts", "=", "'defaults'", ",", "user", "=", "None", ")", ":", "force_mount", "=", "False", "if", "__grains__", "[", "'os'", "]", "in", "[", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
umount
Attempt to unmount a device by specifying the directory it is mounted on CLI Example: .. code-block:: bash salt '*' mount.umount /mnt/foo .. versionadded:: 2015.5.0 .. code-block:: bash salt '*' mount.umount /mnt/foo /dev/xvdc1
salt/modules/mount.py
def umount(name, device=None, user=None, util='mount'): ''' Attempt to unmount a device by specifying the directory it is mounted on CLI Example: .. code-block:: bash salt '*' mount.umount /mnt/foo .. versionadded:: 2015.5.0 .. code-block:: bash salt '*' mount.umount /mnt/fo...
def umount(name, device=None, user=None, util='mount'): ''' Attempt to unmount a device by specifying the directory it is mounted on CLI Example: .. code-block:: bash salt '*' mount.umount /mnt/foo .. versionadded:: 2015.5.0 .. code-block:: bash salt '*' mount.umount /mnt/fo...
[ "Attempt", "to", "unmount", "a", "device", "by", "specifying", "the", "directory", "it", "is", "mounted", "on" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1291-L1324
[ "def", "umount", "(", "name", ",", "device", "=", "None", ",", "user", "=", "None", ",", "util", "=", "'mount'", ")", ":", "if", "util", "!=", "'mount'", ":", "# This functionality used to live in img.umount_image", "if", "'qemu_nbd.clear'", "in", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_fuse_exec
Returns true if the command passed is a fuse mountable application. CLI Example: .. code-block:: bash salt '*' mount.is_fuse_exec sshfs
salt/modules/mount.py
def is_fuse_exec(cmd): ''' Returns true if the command passed is a fuse mountable application. CLI Example: .. code-block:: bash salt '*' mount.is_fuse_exec sshfs ''' cmd_path = salt.utils.path.which(cmd) # No point in running ldd on a command that doesn't exist if not cmd_pa...
def is_fuse_exec(cmd): ''' Returns true if the command passed is a fuse mountable application. CLI Example: .. code-block:: bash salt '*' mount.is_fuse_exec sshfs ''' cmd_path = salt.utils.path.which(cmd) # No point in running ldd on a command that doesn't exist if not cmd_pa...
[ "Returns", "true", "if", "the", "command", "passed", "is", "a", "fuse", "mountable", "application", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1327-L1346
[ "def", "is_fuse_exec", "(", "cmd", ")", ":", "cmd_path", "=", "salt", ".", "utils", ".", "path", ".", "which", "(", "cmd", ")", "# No point in running ldd on a command that doesn't exist", "if", "not", "cmd_path", ":", "return", "False", "elif", "not", "salt", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
swaps
Return a dict containing information on active swap .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swaps
salt/modules/mount.py
def swaps(): ''' Return a dict containing information on active swap .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swaps ''' ret = {} if __grains__['kernel'] == 'SunOS': for line in __salt__['cmd.run_stdout']('swap -l').splitlines(): ...
def swaps(): ''' Return a dict containing information on active swap .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swaps ''' ret = {} if __grains__['kernel'] == 'SunOS': for line in __salt__['cmd.run_stdout']('swap -l').splitlines(): ...
[ "Return", "a", "dict", "containing", "information", "on", "active", "swap" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1349-L1405
[ "def", "swaps", "(", ")", ":", "ret", "=", "{", "}", "if", "__grains__", "[", "'kernel'", "]", "==", "'SunOS'", ":", "for", "line", "in", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'swap -l'", ")", ".", "splitlines", "(", ")", ":", "if", "line",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
swapon
Activate a swap disk .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swapon /root/swapfile
salt/modules/mount.py
def swapon(name, priority=None): ''' Activate a swap disk .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swapon /root/swapfile ''' ret = {} on_ = swaps() if name in on_: ret['stats'] = on_[name] ret['new'] = False ret...
def swapon(name, priority=None): ''' Activate a swap disk .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swapon /root/swapfile ''' ret = {} on_ = swaps() if name in on_: ret['stats'] = on_[name] ret['new'] = False ret...
[ "Activate", "a", "swap", "disk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1408-L1444
[ "def", "swapon", "(", "name", ",", "priority", "=", "None", ")", ":", "ret", "=", "{", "}", "on_", "=", "swaps", "(", ")", "if", "name", "in", "on_", ":", "ret", "[", "'stats'", "]", "=", "on_", "[", "name", "]", "ret", "[", "'new'", "]", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
swapoff
Deactivate a named swap mount .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swapoff /root/swapfile
salt/modules/mount.py
def swapoff(name): ''' Deactivate a named swap mount .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swapoff /root/swapfile ''' on_ = swaps() if name in on_: if __grains__['kernel'] == 'SunOS': if __grains__['virtual'] != 'zon...
def swapoff(name): ''' Deactivate a named swap mount .. versionchanged:: 2016.3.2 CLI Example: .. code-block:: bash salt '*' mount.swapoff /root/swapfile ''' on_ = swaps() if name in on_: if __grains__['kernel'] == 'SunOS': if __grains__['virtual'] != 'zon...
[ "Deactivate", "a", "named", "swap", "mount" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1447-L1475
[ "def", "swapoff", "(", "name", ")", ":", "on_", "=", "swaps", "(", ")", "if", "name", "in", "on_", ":", "if", "__grains__", "[", "'kernel'", "]", "==", "'SunOS'", ":", "if", "__grains__", "[", "'virtual'", "]", "!=", "'zone'", ":", "__salt__", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
read_mount_cache
.. versionadded:: 2018.3.0 Provide information if the path is mounted CLI Example: .. code-block:: bash salt '*' mount.read_mount_cache /mnt/share
salt/modules/mount.py
def read_mount_cache(name): ''' .. versionadded:: 2018.3.0 Provide information if the path is mounted CLI Example: .. code-block:: bash salt '*' mount.read_mount_cache /mnt/share ''' cache = salt.utils.mount.read_cache(__opts__) if cache: if 'mounts' in cache and cach...
def read_mount_cache(name): ''' .. versionadded:: 2018.3.0 Provide information if the path is mounted CLI Example: .. code-block:: bash salt '*' mount.read_mount_cache /mnt/share ''' cache = salt.utils.mount.read_cache(__opts__) if cache: if 'mounts' in cache and cach...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1497-L1514
[ "def", "read_mount_cache", "(", "name", ")", ":", "cache", "=", "salt", ".", "utils", ".", "mount", ".", "read_cache", "(", "__opts__", ")", "if", "cache", ":", "if", "'mounts'", "in", "cache", "and", "cache", "[", "'mounts'", "]", ":", "if", "name", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
write_mount_cache
.. versionadded:: 2018.3.0 Provide information if the path is mounted :param real_name: The real name of the mount point where the device is mounted. :param device: The device that is being mounted. :param mkmnt: Whether or not the mount point should be created. :param fstype: ...
salt/modules/mount.py
def write_mount_cache(real_name, device, mkmnt, fstype, mount_opts): ''' .. versionadded:: 2018.3.0 Provide information if the path is mounted :param real_name: The real name of the mount point where the device...
def write_mount_cache(real_name, device, mkmnt, fstype, mount_opts): ''' .. versionadded:: 2018.3.0 Provide information if the path is mounted :param real_name: The real name of the mount point where the device...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1517-L1558
[ "def", "write_mount_cache", "(", "real_name", ",", "device", ",", "mkmnt", ",", "fstype", ",", "mount_opts", ")", ":", "cache", "=", "salt", ".", "utils", ".", "mount", ".", "read_cache", "(", "__opts__", ")", "if", "not", "cache", ":", "cache", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_mount_cache
.. versionadded:: 2018.3.0 Provide information if the path is mounted CLI Example: .. code-block:: bash salt '*' mount.delete_mount_cache /mnt/share
salt/modules/mount.py
def delete_mount_cache(real_name): ''' .. versionadded:: 2018.3.0 Provide information if the path is mounted CLI Example: .. code-block:: bash salt '*' mount.delete_mount_cache /mnt/share ''' cache = salt.utils.mount.read_cache(__opts__) if cache: if 'mounts' in cach...
def delete_mount_cache(real_name): ''' .. versionadded:: 2018.3.0 Provide information if the path is mounted CLI Example: .. code-block:: bash salt '*' mount.delete_mount_cache /mnt/share ''' cache = salt.utils.mount.read_cache(__opts__) if cache: if 'mounts' in cach...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1561-L1582
[ "def", "delete_mount_cache", "(", "real_name", ")", ":", "cache", "=", "salt", ".", "utils", ".", "mount", ".", "read_cache", "(", "__opts__", ")", "if", "cache", ":", "if", "'mounts'", "in", "cache", ":", "if", "real_name", "in", "cache", "[", "'mounts'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_filesystems
Return the contents of the filesystems in an OrderedDict config File containing filesystem infomation leading_key True return dictionary keyed by 'name' and value as dictionary with other keys, values (name excluded) OrderedDict({ '/dir' : OrderedDict({'dev': '/dev/hd8', ......
salt/modules/mount.py
def _filesystems(config='/etc/filesystems', leading_key=True): ''' Return the contents of the filesystems in an OrderedDict config File containing filesystem infomation leading_key True return dictionary keyed by 'name' and value as dictionary with other keys, values (name excluded)...
def _filesystems(config='/etc/filesystems', leading_key=True): ''' Return the contents of the filesystems in an OrderedDict config File containing filesystem infomation leading_key True return dictionary keyed by 'name' and value as dictionary with other keys, values (name excluded)...
[ "Return", "the", "contents", "of", "the", "filesystems", "in", "an", "OrderedDict" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1585-L1639
[ "def", "_filesystems", "(", "config", "=", "'/etc/filesystems'", ",", "leading_key", "=", "True", ")", ":", "ret", "=", "OrderedDict", "(", ")", "lines", "=", "[", "]", "parsing_block", "=", "False", "if", "not", "os", ".", "path", ".", "isfile", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
filesystems
.. versionadded:: 2018.3.3 List the contents of the filesystems CLI Example: .. code-block:: bash salt '*' mount.filesystems
salt/modules/mount.py
def filesystems(config='/etc/filesystems'): ''' .. versionadded:: 2018.3.3 List the contents of the filesystems CLI Example: .. code-block:: bash salt '*' mount.filesystems ''' ret = {} if 'AIX' not in __grains__['kernel']: return ret ret_dict = _filesystems(conf...
def filesystems(config='/etc/filesystems'): ''' .. versionadded:: 2018.3.3 List the contents of the filesystems CLI Example: .. code-block:: bash salt '*' mount.filesystems ''' ret = {} if 'AIX' not in __grains__['kernel']: return ret ret_dict = _filesystems(conf...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1642-L1663
[ "def", "filesystems", "(", "config", "=", "'/etc/filesystems'", ")", ":", "ret", "=", "{", "}", "if", "'AIX'", "not", "in", "__grains__", "[", "'kernel'", "]", ":", "return", "ret", "ret_dict", "=", "_filesystems", "(", "config", ")", "if", "ret_dict", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_filesystems
.. versionadded:: 2018.3.3 Verify that this mount is represented in the filesystems, change the mount to match the data passed, or add the mount if it is not present on AIX Provide information if the path is mounted :param name: The name of the mount point where the device is mounted. ...
salt/modules/mount.py
def set_filesystems( name, device, vfstype, opts='-', mount='true', config='/etc/filesystems', test=False, match_on='auto', **kwargs): ''' .. versionadded:: 2018.3.3 Verify that this mount is represented in the filesystems, change the ...
def set_filesystems( name, device, vfstype, opts='-', mount='true', config='/etc/filesystems', test=False, match_on='auto', **kwargs): ''' .. versionadded:: 2018.3.3 Verify that this mount is represented in the filesystems, change the ...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1666-L1810
[ "def", "set_filesystems", "(", "name", ",", "device", ",", "vfstype", ",", "opts", "=", "'-'", ",", "mount", "=", "'true'", ",", "config", "=", "'/etc/filesystems'", ",", "test", "=", "False", ",", "match_on", "=", "'auto'", ",", "*", "*", "kwargs", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_filesystems
.. versionadded:: 2018.3.3 Remove the mount point from the filesystems CLI Example: .. code-block:: bash salt '*' mount.rm_filesystems /mnt/foo /dev/sdg
salt/modules/mount.py
def rm_filesystems(name, device, config='/etc/filesystems'): ''' .. versionadded:: 2018.3.3 Remove the mount point from the filesystems CLI Example: .. code-block:: bash salt '*' mount.rm_filesystems /mnt/foo /dev/sdg ''' modified = False view_lines = [] if 'AIX' not in ...
def rm_filesystems(name, device, config='/etc/filesystems'): ''' .. versionadded:: 2018.3.3 Remove the mount point from the filesystems CLI Example: .. code-block:: bash salt '*' mount.rm_filesystems /mnt/foo /dev/sdg ''' modified = False view_lines = [] if 'AIX' not in ...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L1813-L1857
[ "def", "rm_filesystems", "(", "name", ",", "device", ",", "config", "=", "'/etc/filesystems'", ")", ":", "modified", "=", "False", "view_lines", "=", "[", "]", "if", "'AIX'", "not", "in", "__grains__", "[", "'kernel'", "]", ":", "return", "modified", "crit...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_fstab_entry.pick
Returns an instance with just those keys
salt/modules/mount.py
def pick(self, keys): ''' Returns an instance with just those keys ''' subset = dict([(key, self.criteria[key]) for key in keys]) return self.__class__(**subset)
def pick(self, keys): ''' Returns an instance with just those keys ''' subset = dict([(key, self.criteria[key]) for key in keys]) return self.__class__(**subset)
[ "Returns", "an", "instance", "with", "just", "those", "keys" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L323-L328
[ "def", "pick", "(", "self", ",", "keys", ")", ":", "subset", "=", "dict", "(", "[", "(", "key", ",", "self", ".", "criteria", "[", "key", "]", ")", "for", "key", "in", "keys", "]", ")", "return", "self", ".", "__class__", "(", "*", "*", "subset...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_fstab_entry.match
Compare potentially partial criteria against line
salt/modules/mount.py
def match(self, line): ''' Compare potentially partial criteria against line ''' entry = self.dict_from_line(line) for key, value in six.iteritems(self.criteria): if entry[key] != value: return False return True
def match(self, line): ''' Compare potentially partial criteria against line ''' entry = self.dict_from_line(line) for key, value in six.iteritems(self.criteria): if entry[key] != value: return False return True
[ "Compare", "potentially", "partial", "criteria", "against", "line" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L345-L353
[ "def", "match", "(", "self", ",", "line", ")", ":", "entry", "=", "self", ".", "dict_from_line", "(", "line", ")", "for", "key", ",", "value", "in", "six", ".", "iteritems", "(", "self", ".", "criteria", ")", ":", "if", "entry", "[", "key", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_FileSystemsEntry.match
Compare potentially partial criteria against built filesystems entry dictionary
salt/modules/mount.py
def match(self, fsys_view): ''' Compare potentially partial criteria against built filesystems entry dictionary ''' evalue_dict = fsys_view[1] for key, value in six.viewitems(self.criteria): if key in evalue_dict: if evalue_dict[key] != value: ...
def match(self, fsys_view): ''' Compare potentially partial criteria against built filesystems entry dictionary ''' evalue_dict = fsys_view[1] for key, value in six.viewitems(self.criteria): if key in evalue_dict: if evalue_dict[key] != value: ...
[ "Compare", "potentially", "partial", "criteria", "against", "built", "filesystems", "entry", "dictionary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mount.py#L557-L568
[ "def", "match", "(", "self", ",", "fsys_view", ")", ":", "evalue_dict", "=", "fsys_view", "[", "1", "]", "for", "key", ",", "value", "in", "six", ".", "viewitems", "(", "self", ".", "criteria", ")", ":", "if", "key", "in", "evalue_dict", ":", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
virtual
Returns the __virtual__.
salt/utils/napalm.py
def virtual(opts, virtualname, filename): ''' Returns the __virtual__. ''' if ((HAS_NAPALM and NAPALM_MAJOR >= 2) or HAS_NAPALM_BASE) and (is_proxy(opts) or is_minion(opts)): return virtualname else: return ( False, ( '"{vname}"" {filename} can...
def virtual(opts, virtualname, filename): ''' Returns the __virtual__. ''' if ((HAS_NAPALM and NAPALM_MAJOR >= 2) or HAS_NAPALM_BASE) and (is_proxy(opts) or is_minion(opts)): return virtualname else: return ( False, ( '"{vname}"" {filename} can...
[ "Returns", "the", "__virtual__", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/napalm.py#L94-L110
[ "def", "virtual", "(", "opts", ",", "virtualname", ",", "filename", ")", ":", "if", "(", "(", "HAS_NAPALM", "and", "NAPALM_MAJOR", ">=", "2", ")", "or", "HAS_NAPALM_BASE", ")", "and", "(", "is_proxy", "(", "opts", ")", "or", "is_minion", "(", "opts", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call
Calls arbitrary methods from the network driver instance. Please check the readthedocs_ page for the updated list of getters. .. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix method Specifies the name of the method to be called. *args ...
salt/utils/napalm.py
def call(napalm_device, method, *args, **kwargs): ''' Calls arbitrary methods from the network driver instance. Please check the readthedocs_ page for the updated list of getters. .. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix method Spec...
def call(napalm_device, method, *args, **kwargs): ''' Calls arbitrary methods from the network driver instance. Please check the readthedocs_ page for the updated list of getters. .. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix method Spec...
[ "Calls", "arbitrary", "methods", "from", "the", "network", "driver", "instance", ".", "Please", "check", "the", "readthedocs_", "page", "for", "the", "updated", "list", "of", "getters", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/napalm.py#L113-L258
[ "def", "call", "(", "napalm_device", ",", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "out", "=", "None", "opts", "=", "napalm_device", ".", "get", "(", "'__opts__'", ",", "{", "}", ")", "retry", "=", "kwa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_device_opts
Returns the options of the napalm device. :pram: opts :return: the network device opts
salt/utils/napalm.py
def get_device_opts(opts, salt_obj=None): ''' Returns the options of the napalm device. :pram: opts :return: the network device opts ''' network_device = {} # by default, look in the proxy config details device_dict = opts.get('proxy', {}) if is_proxy(opts) else opts.get('napalm', {}) ...
def get_device_opts(opts, salt_obj=None): ''' Returns the options of the napalm device. :pram: opts :return: the network device opts ''' network_device = {} # by default, look in the proxy config details device_dict = opts.get('proxy', {}) if is_proxy(opts) else opts.get('napalm', {}) ...
[ "Returns", "the", "options", "of", "the", "napalm", "device", ".", ":", "pram", ":", "opts", ":", "return", ":", "the", "network", "device", "opts" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/napalm.py#L261-L301
[ "def", "get_device_opts", "(", "opts", ",", "salt_obj", "=", "None", ")", ":", "network_device", "=", "{", "}", "# by default, look in the proxy config details", "device_dict", "=", "opts", ".", "get", "(", "'proxy'", ",", "{", "}", ")", "if", "is_proxy", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_device
Initialise the connection with the network device through NAPALM. :param: opts :return: the network device object
salt/utils/napalm.py
def get_device(opts, salt_obj=None): ''' Initialise the connection with the network device through NAPALM. :param: opts :return: the network device object ''' log.debug('Setting up NAPALM connection') network_device = get_device_opts(opts, salt_obj=salt_obj) provider_lib = napalm_base ...
def get_device(opts, salt_obj=None): ''' Initialise the connection with the network device through NAPALM. :param: opts :return: the network device object ''' log.debug('Setting up NAPALM connection') network_device = get_device_opts(opts, salt_obj=salt_obj) provider_lib = napalm_base ...
[ "Initialise", "the", "connection", "with", "the", "network", "device", "through", "NAPALM", ".", ":", "param", ":", "opts", ":", "return", ":", "the", "network", "device", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/napalm.py#L304-L355
[ "def", "get_device", "(", "opts", ",", "salt_obj", "=", "None", ")", ":", "log", ".", "debug", "(", "'Setting up NAPALM connection'", ")", "network_device", "=", "get_device_opts", "(", "opts", ",", "salt_obj", "=", "salt_obj", ")", "provider_lib", "=", "napal...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
proxy_napalm_wrap
This decorator is used to make the execution module functions available outside a proxy minion, or when running inside a proxy minion. If we are running in a proxy, retrieve the connection details from the __proxy__ injected variable. If we are not, then use the connection information from the opts. ...
salt/utils/napalm.py
def proxy_napalm_wrap(func): ''' This decorator is used to make the execution module functions available outside a proxy minion, or when running inside a proxy minion. If we are running in a proxy, retrieve the connection details from the __proxy__ injected variable. If we are not, then use the...
def proxy_napalm_wrap(func): ''' This decorator is used to make the execution module functions available outside a proxy minion, or when running inside a proxy minion. If we are running in a proxy, retrieve the connection details from the __proxy__ injected variable. If we are not, then use the...
[ "This", "decorator", "is", "used", "to", "make", "the", "execution", "module", "functions", "available", "outside", "a", "proxy", "minion", "or", "when", "running", "inside", "a", "proxy", "minion", ".", "If", "we", "are", "running", "in", "a", "proxy", "r...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/napalm.py#L358-L486
[ "def", "proxy_napalm_wrap", "(", "func", ")", ":", "@", "wraps", "(", "func", ")", "def", "func_wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "wrapped_global_namespace", "=", "func", ".", "__globals__", "# get __opts__ and __proxy__ from func_gl...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
loaded_ret
Return the final state output. ret The initial state output structure. loaded The loaded dictionary.
salt/utils/napalm.py
def loaded_ret(ret, loaded, test, debug, compliance_report=False, opts=None): ''' Return the final state output. ret The initial state output structure. loaded The loaded dictionary. ''' # Always get the comment changes = {} ret['comment'] = loaded['comment'] if 'diff...
def loaded_ret(ret, loaded, test, debug, compliance_report=False, opts=None): ''' Return the final state output. ret The initial state output structure. loaded The loaded dictionary. ''' # Always get the comment changes = {} ret['comment'] = loaded['comment'] if 'diff...
[ "Return", "the", "final", "state", "output", ".", "ret", "The", "initial", "state", "output", "structure", ".", "loaded", "The", "loaded", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/napalm.py#L502-L553
[ "def", "loaded_ret", "(", "ret", ",", "loaded", ",", "test", ",", "debug", ",", "compliance_report", "=", "False", ",", "opts", "=", "None", ")", ":", "# Always get the comment", "changes", "=", "{", "}", "ret", "[", "'comment'", "]", "=", "loaded", "[",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Api to listen for webhooks to send to the reactor. Implement the webhook behavior in an engine. :py:class:`rest_cherrypy Webhook docs <salt.netapi.rest_cherrypy.app.Webhook>` Unlike the rest_cherrypy Webhook, this is only an unauthenticated webhook endpoint. If an authenticated webhook endpoint is ne...
salt/engines/webhook.py
def start(address=None, port=5000, ssl_crt=None, ssl_key=None): ''' Api to listen for webhooks to send to the reactor. Implement the webhook behavior in an engine. :py:class:`rest_cherrypy Webhook docs <salt.netapi.rest_cherrypy.app.Webhook>` Unlike the rest_cherrypy Webhook, this is only an unaut...
def start(address=None, port=5000, ssl_crt=None, ssl_key=None): ''' Api to listen for webhooks to send to the reactor. Implement the webhook behavior in an engine. :py:class:`rest_cherrypy Webhook docs <salt.netapi.rest_cherrypy.app.Webhook>` Unlike the rest_cherrypy Webhook, this is only an unaut...
[ "Api", "to", "listen", "for", "webhooks", "to", "send", "to", "the", "reactor", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/webhook.py#L17-L88
[ "def", "start", "(", "address", "=", "None", ",", "port", "=", "5000", ",", "ssl_crt", "=", "None", ",", "ssl_key", "=", "None", ")", ":", "if", "__opts__", ".", "get", "(", "'__role'", ")", "==", "'master'", ":", "fire_master", "=", "salt", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
installed
Ensure Microsoft Updates are installed. Updates will be downloaded if needed. Args: name (str): The identifier of a single update to install. updates (list): A list of identifiers for updates to be installed. Overrides ``name``. Default is None. .. not...
salt/states/win_wua.py
def installed(name, updates=None): ''' Ensure Microsoft Updates are installed. Updates will be downloaded if needed. Args: name (str): The identifier of a single update to install. updates (list): A list of identifiers for updates to be installed. Overrides ...
def installed(name, updates=None): ''' Ensure Microsoft Updates are installed. Updates will be downloaded if needed. Args: name (str): The identifier of a single update to install. updates (list): A list of identifiers for updates to be installed. Overrides ...
[ "Ensure", "Microsoft", "Updates", "are", "installed", ".", "Updates", "will", "be", "downloaded", "if", "needed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_wua.py#L80-L211
[ "def", "installed", "(", "name", ",", "updates", "=", "None", ")", ":", "if", "isinstance", "(", "updates", ",", "six", ".", "string_types", ")", ":", "updates", "=", "[", "updates", "]", "if", "not", "updates", ":", "updates", "=", "name", "ret", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
removed
Ensure Microsoft Updates are uninstalled. Args: name (str): The identifier of a single update to uninstall. updates (list): A list of identifiers for updates to be removed. Overrides ``name``. Default is None. .. note:: Identifiers can be the GUID, the KB ...
salt/states/win_wua.py
def removed(name, updates=None): ''' Ensure Microsoft Updates are uninstalled. Args: name (str): The identifier of a single update to uninstall. updates (list): A list of identifiers for updates to be removed. Overrides ``name``. Default is None. ....
def removed(name, updates=None): ''' Ensure Microsoft Updates are uninstalled. Args: name (str): The identifier of a single update to uninstall. updates (list): A list of identifiers for updates to be removed. Overrides ``name``. Default is None. ....
[ "Ensure", "Microsoft", "Updates", "are", "uninstalled", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_wua.py#L214-L335
[ "def", "removed", "(", "name", ",", "updates", "=", "None", ")", ":", "if", "isinstance", "(", "updates", ",", "six", ".", "string_types", ")", ":", "updates", "=", "[", "updates", "]", "if", "not", "updates", ":", "updates", "=", "name", "ret", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
uptodate
Ensure Microsoft Updates that match the passed criteria are installed. Updates will be downloaded if needed. This state allows you to update a system without specifying a specific update to apply. All matching updates will be installed. Args: name (str): The name has no functional...
salt/states/win_wua.py
def uptodate(name, software=True, drivers=False, skip_hidden=False, skip_mandatory=False, skip_reboot=True, categories=None, severities=None,): ''' Ensure Microsoft Updates that match the passed criteria are installed. ...
def uptodate(name, software=True, drivers=False, skip_hidden=False, skip_mandatory=False, skip_reboot=True, categories=None, severities=None,): ''' Ensure Microsoft Updates that match the passed criteria are installed. ...
[ "Ensure", "Microsoft", "Updates", "that", "match", "the", "passed", "criteria", "are", "installed", ".", "Updates", "will", "be", "downloaded", "if", "needed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_wua.py#L338-L504
[ "def", "uptodate", "(", "name", ",", "software", "=", "True", ",", "drivers", "=", "False", ",", "skip_hidden", "=", "False", ",", "skip_mandatory", "=", "False", ",", "skip_reboot", "=", "True", ",", "categories", "=", "None", ",", "severities", "=", "N...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
MessageFormatter.format_graylog_v0
Graylog 'raw' format is essentially the raw record, minimally munged to provide the bare minimum that td-agent requires to accept and route the event. This is well suited to a config where the client td-agents log directly to Graylog.
salt/log/handlers/fluent_mod.py
def format_graylog_v0(self, record): ''' Graylog 'raw' format is essentially the raw record, minimally munged to provide the bare minimum that td-agent requires to accept and route the event. This is well suited to a config where the client td-agents log directly to Graylog. '''...
def format_graylog_v0(self, record): ''' Graylog 'raw' format is essentially the raw record, minimally munged to provide the bare minimum that td-agent requires to accept and route the event. This is well suited to a config where the client td-agents log directly to Graylog. '''...
[ "Graylog", "raw", "format", "is", "essentially", "the", "raw", "record", "minimally", "munged", "to", "provide", "the", "bare", "minimum", "that", "td", "-", "agent", "requires", "to", "accept", "and", "route", "the", "event", ".", "This", "is", "well", "s...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/handlers/fluent_mod.py#L218-L249
[ "def", "format_graylog_v0", "(", "self", ",", "record", ")", ":", "message_dict", "=", "{", "'message'", ":", "record", ".", "getMessage", "(", ")", ",", "'timestamp'", ":", "self", ".", "formatTime", "(", "record", ")", ",", "# Graylog uses syslog levels, not...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
MessageFormatter.format_logstash_v0
Messages are formatted in logstash's expected format.
salt/log/handlers/fluent_mod.py
def format_logstash_v0(self, record): ''' Messages are formatted in logstash's expected format. ''' host = salt.utils.network.get_fqhostname() message_dict = { '@timestamp': self.formatTime(record), '@fields': { 'levelname': record.levelnam...
def format_logstash_v0(self, record): ''' Messages are formatted in logstash's expected format. ''' host = salt.utils.network.get_fqhostname() message_dict = { '@timestamp': self.formatTime(record), '@fields': { 'levelname': record.levelnam...
[ "Messages", "are", "formatted", "in", "logstash", "s", "expected", "format", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/handlers/fluent_mod.py#L286-L339
[ "def", "format_logstash_v0", "(", "self", ",", "record", ")", ":", "host", "=", "salt", ".", "utils", ".", "network", ".", "get_fqhostname", "(", ")", "message_dict", "=", "{", "'@timestamp'", ":", "self", ".", "formatTime", "(", "record", ")", ",", "'@f...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
connected
List all connected minions on a salt-master
salt/wheel/minions.py
def connected(): ''' List all connected minions on a salt-master ''' opts = salt.config.master_config(__opts__['conf_file']) if opts.get('con_cache'): cache_cli = CacheCli(opts) minions = cache_cli.get_cached() else: minions = list(salt.utils.minions.CkMinions(opts).conn...
def connected(): ''' List all connected minions on a salt-master ''' opts = salt.config.master_config(__opts__['conf_file']) if opts.get('con_cache'): cache_cli = CacheCli(opts) minions = cache_cli.get_cached() else: minions = list(salt.utils.minions.CkMinions(opts).conn...
[ "List", "all", "connected", "minions", "on", "a", "salt", "-", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/minions.py#L15-L26
[ "def", "connected", "(", ")", ":", "opts", "=", "salt", ".", "config", ".", "master_config", "(", "__opts__", "[", "'conf_file'", "]", ")", "if", "opts", ".", "get", "(", "'con_cache'", ")", ":", "cache_cli", "=", "CacheCli", "(", "opts", ")", "minions...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_configured_provider
Return the first configured instance.
salt/cloud/clouds/digitalocean.py
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( opts=__opts__, provider=__active_provider_name__ or __virtualname__, aliases=__virtual_aliases__, required_keys=('personal_access_token',) )
def get_configured_provider(): ''' Return the first configured instance. ''' return config.is_provider_configured( opts=__opts__, provider=__active_provider_name__ or __virtualname__, aliases=__virtual_aliases__, required_keys=('personal_access_token',) )
[ "Return", "the", "first", "configured", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L81-L90
[ "def", "get_configured_provider", "(", ")", ":", "return", "config", ".", "is_provider_configured", "(", "opts", "=", "__opts__", ",", "provider", "=", "__active_provider_name__", "or", "__virtualname__", ",", "aliases", "=", "__virtual_aliases__", ",", "required_keys...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_locations
Return a dict of all available VM locations on the cloud provider with relevant data
salt/cloud/clouds/digitalocean.py
def avail_locations(call=None): ''' Return a dict of all available VM locations on the cloud provider with relevant data ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locat...
def avail_locations(call=None): ''' Return a dict of all available VM locations on the cloud provider with relevant data ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locat...
[ "Return", "a", "dict", "of", "all", "available", "VM", "locations", "on", "the", "cloud", "provider", "with", "relevant", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L103-L121
[ "def", "avail_locations", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_locations function must be called with '", "'-f or --function, or with the --list-locations option'", ")", "items", "=", "quer...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_images
Return a list of the images that are on the provider
salt/cloud/clouds/digitalocean.py
def avail_images(call=None): ''' Return a list of the images that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) fetch = True ...
def avail_images(call=None): ''' Return a list of the images that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) fetch = True ...
[ "Return", "a", "list", "of", "the", "images", "that", "are", "on", "the", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L124-L152
[ "def", "avail_images", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", "fetch", "=", "True", "pag...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_sizes
Return a list of the image sizes that are on the provider
salt/cloud/clouds/digitalocean.py
def avail_sizes(call=None): ''' Return a list of the image sizes that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the --list-sizes option' ) items = query(m...
def avail_sizes(call=None): ''' Return a list of the image sizes that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the --list-sizes option' ) items = query(m...
[ "Return", "a", "list", "of", "the", "image", "sizes", "that", "are", "on", "the", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L155-L172
[ "def", "avail_sizes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be called with '", "'-f or --function, or with the --list-sizes option'", ")", "items", "=", "query", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_full
Return a list of the VMs that are on the provider
salt/cloud/clouds/digitalocean.py
def list_nodes_full(call=None, for_output=True): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function must be called with -f or --function.' ) return _list_nodes(full=True, for_output=for_o...
def list_nodes_full(call=None, for_output=True): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function must be called with -f or --function.' ) return _list_nodes(full=True, for_output=for_o...
[ "Return", "a", "list", "of", "the", "VMs", "that", "are", "on", "the", "provider" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L186-L194
[ "def", "list_nodes_full", "(", "call", "=", "None", ",", "for_output", "=", "True", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_full function must be called with -f or --function.'", ")", "return", "_list_nodes", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_image
Return the image object to use
salt/cloud/clouds/digitalocean.py
def get_image(vm_): ''' Return the image object to use ''' images = avail_images() vm_image = config.get_cloud_config_value( 'image', vm_, __opts__, search_global=False ) if not isinstance(vm_image, six.string_types): vm_image = six.text_type(vm_image) for image in image...
def get_image(vm_): ''' Return the image object to use ''' images = avail_images() vm_image = config.get_cloud_config_value( 'image', vm_, __opts__, search_global=False ) if not isinstance(vm_image, six.string_types): vm_image = six.text_type(vm_image) for image in image...
[ "Return", "the", "image", "object", "to", "use" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L206-L226
[ "def", "get_image", "(", "vm_", ")", ":", "images", "=", "avail_images", "(", ")", "vm_image", "=", "config", ".", "get_cloud_config_value", "(", "'image'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", "False", ")", "if", "not", "isinstance", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_size
Return the VM's size. Used by create_node().
salt/cloud/clouds/digitalocean.py
def get_size(vm_): ''' Return the VM's size. Used by create_node(). ''' sizes = avail_sizes() vm_size = six.text_type(config.get_cloud_config_value( 'size', vm_, __opts__, search_global=False )) for size in sizes: if vm_size.lower() == sizes[size]['slug']: return ...
def get_size(vm_): ''' Return the VM's size. Used by create_node(). ''' sizes = avail_sizes() vm_size = six.text_type(config.get_cloud_config_value( 'size', vm_, __opts__, search_global=False )) for size in sizes: if vm_size.lower() == sizes[size]['slug']: return ...
[ "Return", "the", "VM", "s", "size", ".", "Used", "by", "create_node", "()", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L229-L242
[ "def", "get_size", "(", "vm_", ")", ":", "sizes", "=", "avail_sizes", "(", ")", "vm_size", "=", "six", ".", "text_type", "(", "config", ".", "get_cloud_config_value", "(", "'size'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", "False", ")", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_location
Return the VM's location
salt/cloud/clouds/digitalocean.py
def get_location(vm_): ''' Return the VM's location ''' locations = avail_locations() vm_location = six.text_type(config.get_cloud_config_value( 'location', vm_, __opts__, search_global=False )) for location in locations: if vm_location in (locations[location]['name'], ...
def get_location(vm_): ''' Return the VM's location ''' locations = avail_locations() vm_location = six.text_type(config.get_cloud_config_value( 'location', vm_, __opts__, search_global=False )) for location in locations: if vm_location in (locations[location]['name'], ...
[ "Return", "the", "VM", "s", "location" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L245-L262
[ "def", "get_location", "(", "vm_", ")", ":", "locations", "=", "avail_locations", "(", ")", "vm_location", "=", "six", ".", "text_type", "(", "config", ".", "get_cloud_config_value", "(", "'location'", ",", "vm_", ",", "__opts__", ",", "search_global", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single VM from a data dict
salt/cloud/clouds/digitalocean.py
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'dig...
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'dig...
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L273-L546
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'digit...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
query
Make a web call to DigitalOcean
salt/cloud/clouds/digitalocean.py
def query(method='droplets', droplet_id=None, command=None, args=None, http_method='get'): ''' Make a web call to DigitalOcean ''' base_path = six.text_type(config.get_cloud_config_value( 'api_root', get_configured_provider(), __opts__, search_global=False, defaul...
def query(method='droplets', droplet_id=None, command=None, args=None, http_method='get'): ''' Make a web call to DigitalOcean ''' base_path = six.text_type(config.get_cloud_config_value( 'api_root', get_configured_provider(), __opts__, search_global=False, defaul...
[ "Make", "a", "web", "call", "to", "DigitalOcean" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L549-L604
[ "def", "query", "(", "method", "=", "'droplets'", ",", "droplet_id", "=", "None", ",", "command", "=", "None", ",", "args", "=", "None", ",", "http_method", "=", "'get'", ")", ":", "base_path", "=", "six", ".", "text_type", "(", "config", ".", "get_clo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Show the details from DigitalOcean concerning a droplet
salt/cloud/clouds/digitalocean.py
def show_instance(name, call=None): ''' Show the details from DigitalOcean concerning a droplet ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) node = _get_node(name) __utils__['cloud.cache_node'](no...
def show_instance(name, call=None): ''' Show the details from DigitalOcean concerning a droplet ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) node = _get_node(name) __utils__['cloud.cache_node'](no...
[ "Show", "the", "details", "from", "DigitalOcean", "concerning", "a", "droplet" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L622-L632
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The show_instance action must be called with -a or --action.'", ")", "node", "=", "_get_node", "(", "name", ")", "_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_keypairs
Return a dict of all available VM locations on the cloud provider with relevant data
salt/cloud/clouds/digitalocean.py
def list_keypairs(call=None): ''' Return a dict of all available VM locations on the cloud provider with relevant data ''' if call != 'function': log.error( 'The list_keypairs function must be called with -f or --function.' ) return False fetch = True pag...
def list_keypairs(call=None): ''' Return a dict of all available VM locations on the cloud provider with relevant data ''' if call != 'function': log.error( 'The list_keypairs function must be called with -f or --function.' ) return False fetch = True pag...
[ "Return", "a", "dict", "of", "all", "available", "VM", "locations", "on", "the", "cloud", "provider", "with", "relevant", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L651-L691
[ "def", "list_keypairs", "(", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The list_keypairs function must be called with -f or --function.'", ")", "return", "False", "fetch", "=", "True", "page", "=", "1", "re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_keypair
Show the details of an SSH keypair
salt/cloud/clouds/digitalocean.py
def show_keypair(kwargs=None, call=None): ''' Show the details of an SSH keypair ''' if call != 'function': log.error( 'The show_keypair function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} if 'keyname' not in kwa...
def show_keypair(kwargs=None, call=None): ''' Show the details of an SSH keypair ''' if call != 'function': log.error( 'The show_keypair function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} if 'keyname' not in kwa...
[ "Show", "the", "details", "of", "an", "SSH", "keypair" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L694-L717
[ "def", "show_keypair", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The show_keypair function must be called with -f or --function.'", ")", "return", "False", "if", "not", "kwa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
import_keypair
Upload public key to cloud provider. Similar to EC2 import_keypair. .. versionadded:: 2016.11.0 kwargs file(mandatory): public key file-name keyname(mandatory): public key name in the provider
salt/cloud/clouds/digitalocean.py
def import_keypair(kwargs=None, call=None): ''' Upload public key to cloud provider. Similar to EC2 import_keypair. .. versionadded:: 2016.11.0 kwargs file(mandatory): public key file-name keyname(mandatory): public key name in the provider ''' with salt.utils.files.fopen(k...
def import_keypair(kwargs=None, call=None): ''' Upload public key to cloud provider. Similar to EC2 import_keypair. .. versionadded:: 2016.11.0 kwargs file(mandatory): public key file-name keyname(mandatory): public key name in the provider ''' with salt.utils.files.fopen(k...
[ "Upload", "public", "key", "to", "cloud", "provider", ".", "Similar", "to", "EC2", "import_keypair", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L720-L740
[ "def", "import_keypair", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "kwargs", "[", "'file'", "]", ",", "'r'", ")", "as", "public_key_filename", ":", "public_key_content",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_key
Upload a public key
salt/cloud/clouds/digitalocean.py
def create_key(kwargs=None, call=None): ''' Upload a public key ''' if call != 'function': log.error( 'The create_key function must be called with -f or --function.' ) return False try: result = query( method='account', command='ke...
def create_key(kwargs=None, call=None): ''' Upload a public key ''' if call != 'function': log.error( 'The create_key function must be called with -f or --function.' ) return False try: result = query( method='account', command='ke...
[ "Upload", "a", "public", "key" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L743-L765
[ "def", "create_key", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The create_key function must be called with -f or --function.'", ")", "return", "False", "try", ":", "result",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_keyid
Return the ID of the keyname
salt/cloud/clouds/digitalocean.py
def get_keyid(keyname): ''' Return the ID of the keyname ''' if not keyname: return None keypairs = list_keypairs(call='function') keyid = keypairs[keyname]['id'] if keyid: return keyid raise SaltCloudNotFound('The specified ssh key could not be found.')
def get_keyid(keyname): ''' Return the ID of the keyname ''' if not keyname: return None keypairs = list_keypairs(call='function') keyid = keypairs[keyname]['id'] if keyid: return keyid raise SaltCloudNotFound('The specified ssh key could not be found.')
[ "Return", "the", "ID", "of", "the", "keyname" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L791-L801
[ "def", "get_keyid", "(", "keyname", ")", ":", "if", "not", "keyname", ":", "return", "None", "keypairs", "=", "list_keypairs", "(", "call", "=", "'function'", ")", "keyid", "=", "keypairs", "[", "keyname", "]", "[", "'id'", "]", "if", "keyid", ":", "re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
Destroy a node. Will check termination protection and warn if enabled. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine
salt/cloud/clouds/digitalocean.py
def destroy(name, call=None): ''' Destroy a node. Will check termination protection and warn if enabled. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -...
def destroy(name, call=None): ''' Destroy a node. Will check termination protection and warn if enabled. CLI Example: .. code-block:: bash salt-cloud --destroy mymachine ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -...
[ "Destroy", "a", "node", ".", "Will", "check", "termination", "protection", "and", "warn", "if", "enabled", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L804-L871
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__", "[", "'cloud.fire_event'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
post_dns_record
Creates a DNS record for the given name if the domain is managed with DO.
salt/cloud/clouds/digitalocean.py
def post_dns_record(**kwargs): ''' Creates a DNS record for the given name if the domain is managed with DO. ''' if 'kwargs' in kwargs: # flatten kwargs if called via salt-cloud -f f_kwargs = kwargs['kwargs'] del kwargs['kwargs'] kwargs.update(f_kwargs) mandatory_kwargs = ('...
def post_dns_record(**kwargs): ''' Creates a DNS record for the given name if the domain is managed with DO. ''' if 'kwargs' in kwargs: # flatten kwargs if called via salt-cloud -f f_kwargs = kwargs['kwargs'] del kwargs['kwargs'] kwargs.update(f_kwargs) mandatory_kwargs = ('...
[ "Creates", "a", "DNS", "record", "for", "the", "given", "name", "if", "the", "domain", "is", "managed", "with", "DO", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L874-L902
[ "def", "post_dns_record", "(", "*", "*", "kwargs", ")", ":", "if", "'kwargs'", "in", "kwargs", ":", "# flatten kwargs if called via salt-cloud -f", "f_kwargs", "=", "kwargs", "[", "'kwargs'", "]", "del", "kwargs", "[", "'kwargs'", "]", "kwargs", ".", "update", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy_dns_records
Deletes DNS records for the given hostname if the domain is managed with DO.
salt/cloud/clouds/digitalocean.py
def destroy_dns_records(fqdn): ''' Deletes DNS records for the given hostname if the domain is managed with DO. ''' domain = '.'.join(fqdn.split('.')[-2:]) hostname = '.'.join(fqdn.split('.')[:-2]) # TODO: remove this when the todo on 754 is available try: response = query(method='do...
def destroy_dns_records(fqdn): ''' Deletes DNS records for the given hostname if the domain is managed with DO. ''' domain = '.'.join(fqdn.split('.')[-2:]) hostname = '.'.join(fqdn.split('.')[:-2]) # TODO: remove this when the todo on 754 is available try: response = query(method='do...
[ "Deletes", "DNS", "records", "for", "the", "given", "hostname", "if", "the", "domain", "is", "managed", "with", "DO", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L905-L936
[ "def", "destroy_dns_records", "(", "fqdn", ")", ":", "domain", "=", "'.'", ".", "join", "(", "fqdn", ".", "split", "(", "'.'", ")", "[", "-", "2", ":", "]", ")", "hostname", "=", "'.'", ".", "join", "(", "fqdn", ".", "split", "(", "'.'", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_pricing
Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-digitalocean-config profile=my-profile
salt/cloud/clouds/digitalocean.py
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-digitalocean-config profile=my-profile '...
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-digitalocean-config profile=my-profile '...
[ "Show", "pricing", "for", "a", "particular", "profile", ".", "This", "is", "only", "an", "estimate", "based", "on", "unofficial", "pricing", "sources", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L939-L975
[ "def", "show_pricing", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "profile", "=", "__opts__", "[", "'profiles'", "]", ".", "get", "(", "kwargs", "[", "'profile'", "]", ",", "{", "}", ")", "if", "not", "profile", ":", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_floating_ip
Show the details of a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f show_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt/cloud/clouds/digitalocean.py
def show_floating_ip(kwargs=None, call=None): ''' Show the details of a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f show_floating_ip my-digitalocean-config floating_ip='45.55.96.47' ''' if call != 'function': log.error( ...
def show_floating_ip(kwargs=None, call=None): ''' Show the details of a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f show_floating_ip my-digitalocean-config floating_ip='45.55.96.47' ''' if call != 'function': log.error( ...
[ "Show", "the", "details", "of", "a", "floating", "IP" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1018-L1048
[ "def", "show_floating_ip", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The show_floating_ip function must be called with -f or --function.'", ")", "return", "False", "if", "not"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_floating_ip
Create a new floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f create_floating_ip my-digitalocean-config region='NYC2' salt-cloud -f create_floating_ip my-digitalocean-config droplet_id='1234567'
salt/cloud/clouds/digitalocean.py
def create_floating_ip(kwargs=None, call=None): ''' Create a new floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f create_floating_ip my-digitalocean-config region='NYC2' salt-cloud -f create_floating_ip my-digitalocean-config droplet_id='12...
def create_floating_ip(kwargs=None, call=None): ''' Create a new floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f create_floating_ip my-digitalocean-config region='NYC2' salt-cloud -f create_floating_ip my-digitalocean-config droplet_id='12...
[ "Create", "a", "new", "floating", "IP" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1051-L1090
[ "def", "create_floating_ip", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The create_floating_ip function must be called with -f or --function.'", ")", "return", "False", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_floating_ip
Delete a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f delete_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt/cloud/clouds/digitalocean.py
def delete_floating_ip(kwargs=None, call=None): ''' Delete a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f delete_floating_ip my-digitalocean-config floating_ip='45.55.96.47' ''' if call != 'function': log.error( 'The ...
def delete_floating_ip(kwargs=None, call=None): ''' Delete a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f delete_floating_ip my-digitalocean-config floating_ip='45.55.96.47' ''' if call != 'function': log.error( 'The ...
[ "Delete", "a", "floating", "IP" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1093-L1125
[ "def", "delete_floating_ip", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The delete_floating_ip function must be called with -f or --function.'", ")", "return", "False", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unassign_floating_ip
Unassign a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f unassign_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt/cloud/clouds/digitalocean.py
def unassign_floating_ip(kwargs=None, call=None): ''' Unassign a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f unassign_floating_ip my-digitalocean-config floating_ip='45.55.96.47' ''' if call != 'function': log.error( ...
def unassign_floating_ip(kwargs=None, call=None): ''' Unassign a floating IP .. versionadded:: 2016.3.0 CLI Examples: .. code-block:: bash salt-cloud -f unassign_floating_ip my-digitalocean-config floating_ip='45.55.96.47' ''' if call != 'function': log.error( ...
[ "Unassign", "a", "floating", "IP" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1161-L1191
[ "def", "unassign_floating_ip", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The inassign_floating_ip function must be called with -f or --function.'", ")", "return", "False", "if",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_list_nodes
Helper function to format and parse node data.
salt/cloud/clouds/digitalocean.py
def _list_nodes(full=False, for_output=False): ''' Helper function to format and parse node data. ''' fetch = True page = 1 ret = {} while fetch: items = query(method='droplets', command='?page=' + six.text_type(page) + '&per_page=200') for node in item...
def _list_nodes(full=False, for_output=False): ''' Helper function to format and parse node data. ''' fetch = True page = 1 ret = {} while fetch: items = query(method='droplets', command='?page=' + six.text_type(page) + '&per_page=200') for node in item...
[ "Helper", "function", "to", "format", "and", "parse", "node", "data", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1194-L1228
[ "def", "_list_nodes", "(", "full", "=", "False", ",", "for_output", "=", "False", ")", ":", "fetch", "=", "True", "page", "=", "1", "ret", "=", "{", "}", "while", "fetch", ":", "items", "=", "query", "(", "method", "=", "'droplets'", ",", "command", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reboot
Reboot a droplet in DigitalOcean. .. versionadded:: 2015.8.8 name The name of the droplet to restart. CLI Example: .. code-block:: bash salt-cloud -a reboot droplet_name
salt/cloud/clouds/digitalocean.py
def reboot(name, call=None): ''' Reboot a droplet in DigitalOcean. .. versionadded:: 2015.8.8 name The name of the droplet to restart. CLI Example: .. code-block:: bash salt-cloud -a reboot droplet_name ''' if call != 'action': raise SaltCloudSystemExit( ...
def reboot(name, call=None): ''' Reboot a droplet in DigitalOcean. .. versionadded:: 2015.8.8 name The name of the droplet to restart. CLI Example: .. code-block:: bash salt-cloud -a reboot droplet_name ''' if call != 'action': raise SaltCloudSystemExit( ...
[ "Reboot", "a", "droplet", "in", "DigitalOcean", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1231-L1265
[ "def", "reboot", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The restart action must be called with -a or --action.'", ")", "data", "=", "show_instance", "(", "name", ",", "call", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_full_output
Helper function for _list_nodes to loop through all node information. Returns a dictionary containing the full information of a node.
salt/cloud/clouds/digitalocean.py
def _get_full_output(node, for_output=False): ''' Helper function for _list_nodes to loop through all node information. Returns a dictionary containing the full information of a node. ''' ret = {} for item in six.iterkeys(node): value = node[item] if value is not None and for_out...
def _get_full_output(node, for_output=False): ''' Helper function for _list_nodes to loop through all node information. Returns a dictionary containing the full information of a node. ''' ret = {} for item in six.iterkeys(node): value = node[item] if value is not None and for_out...
[ "Helper", "function", "for", "_list_nodes", "to", "loop", "through", "all", "node", "information", ".", "Returns", "a", "dictionary", "containing", "the", "full", "information", "of", "a", "node", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1342-L1353
[ "def", "_get_full_output", "(", "node", ",", "for_output", "=", "False", ")", ":", "ret", "=", "{", "}", "for", "item", "in", "six", ".", "iterkeys", "(", "node", ")", ":", "value", "=", "node", "[", "item", "]", "if", "value", "is", "not", "None",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_ips
Helper function for list_nodes. Returns public and private ip lists based on a given network dictionary.
salt/cloud/clouds/digitalocean.py
def _get_ips(networks): ''' Helper function for list_nodes. Returns public and private ip lists based on a given network dictionary. ''' v4s = networks.get('v4') v6s = networks.get('v6') public_ips = [] private_ips = [] if v4s: for item in v4s: ip_type = item.get...
def _get_ips(networks): ''' Helper function for list_nodes. Returns public and private ip lists based on a given network dictionary. ''' v4s = networks.get('v4') v6s = networks.get('v6') public_ips = [] private_ips = [] if v4s: for item in v4s: ip_type = item.get...
[ "Helper", "function", "for", "list_nodes", ".", "Returns", "public", "and", "private", "ip", "lists", "based", "on", "a", "given", "network", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/digitalocean.py#L1356-L1384
[ "def", "_get_ips", "(", "networks", ")", ":", "v4s", "=", "networks", ".", "get", "(", "'v4'", ")", "v6s", "=", "networks", ".", "get", "(", "'v6'", ")", "public_ips", "=", "[", "]", "private_ips", "=", "[", "]", "if", "v4s", ":", "for", "item", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cluster_create
Adds a cluster to the Postgres server. .. warning: Only works for debian family distros so far. CLI Example: .. code-block:: bash salt '*' postgres.cluster_create '9.3' salt '*' postgres.cluster_create '9.3' 'main' salt '*' postgres.cluster_create '9.3' locale='fr_FR' ...
salt/modules/deb_postgres.py
def cluster_create(version, name='main', port=None, locale=None, encoding=None, datadir=None, allow_group_access=None, data_checksums=None, wal_segsize=None): ''' ...
def cluster_create(version, name='main', port=None, locale=None, encoding=None, datadir=None, allow_group_access=None, data_checksums=None, wal_segsize=None): ''' ...
[ "Adds", "a", "cluster", "to", "the", "Postgres", "server", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/deb_postgres.py#L32-L85
[ "def", "cluster_create", "(", "version", ",", "name", "=", "'main'", ",", "port", "=", "None", ",", "locale", "=", "None", ",", "encoding", "=", "None", ",", "datadir", "=", "None", ",", "allow_group_access", "=", "None", ",", "data_checksums", "=", "Non...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cluster_list
Return a list of cluster of Postgres server (tuples of version and name). CLI Example: .. code-block:: bash salt '*' postgres.cluster_list salt '*' postgres.cluster_list verbose=True
salt/modules/deb_postgres.py
def cluster_list(verbose=False): ''' Return a list of cluster of Postgres server (tuples of version and name). CLI Example: .. code-block:: bash salt '*' postgres.cluster_list salt '*' postgres.cluster_list verbose=True ''' cmd = [salt.utils.path.which('pg_lsclusters'), '--no...
def cluster_list(verbose=False): ''' Return a list of cluster of Postgres server (tuples of version and name). CLI Example: .. code-block:: bash salt '*' postgres.cluster_list salt '*' postgres.cluster_list verbose=True ''' cmd = [salt.utils.path.which('pg_lsclusters'), '--no...
[ "Return", "a", "list", "of", "cluster", "of", "Postgres", "server", "(", "tuples", "of", "version", "and", "name", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/deb_postgres.py#L88-L107
[ "def", "cluster_list", "(", "verbose", "=", "False", ")", ":", "cmd", "=", "[", "salt", ".", "utils", ".", "path", ".", "which", "(", "'pg_lsclusters'", ")", ",", "'--no-header'", "]", "ret", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "' '", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cluster_remove
Remove a cluster on a Postgres server. By default it doesn't try to stop the cluster. CLI Example: .. code-block:: bash salt '*' postgres.cluster_remove '9.3' salt '*' postgres.cluster_remove '9.3' 'main' salt '*' postgres.cluster_remove '9.3' 'main' stop=True
salt/modules/deb_postgres.py
def cluster_remove(version, name='main', stop=False): ''' Remove a cluster on a Postgres server. By default it doesn't try to stop the cluster. CLI Example: .. code-block:: bash salt '*' postgres.cluster_remove '9.3' salt '*' postgres.cluster...
def cluster_remove(version, name='main', stop=False): ''' Remove a cluster on a Postgres server. By default it doesn't try to stop the cluster. CLI Example: .. code-block:: bash salt '*' postgres.cluster_remove '9.3' salt '*' postgres.cluster...
[ "Remove", "a", "cluster", "on", "a", "Postgres", "server", ".", "By", "default", "it", "doesn", "t", "try", "to", "stop", "the", "cluster", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/deb_postgres.py#L126-L156
[ "def", "cluster_remove", "(", "version", ",", "name", "=", "'main'", ",", "stop", "=", "False", ")", ":", "cmd", "=", "[", "salt", ".", "utils", ".", "path", ".", "which", "(", "'pg_dropcluster'", ")", "]", "if", "stop", ":", "cmd", "+=", "[", "'--...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_pg_lscluster
Helper function to parse the output of pg_lscluster
salt/modules/deb_postgres.py
def _parse_pg_lscluster(output): ''' Helper function to parse the output of pg_lscluster ''' cluster_dict = {} for line in output.splitlines(): version, name, port, status, user, datadir, log = ( line.split()) cluster_dict['{0}/{1}'.format(version, name)] = { ...
def _parse_pg_lscluster(output): ''' Helper function to parse the output of pg_lscluster ''' cluster_dict = {} for line in output.splitlines(): version, name, port, status, user, datadir, log = ( line.split()) cluster_dict['{0}/{1}'.format(version, name)] = { ...
[ "Helper", "function", "to", "parse", "the", "output", "of", "pg_lscluster" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/deb_postgres.py#L159-L173
[ "def", "_parse_pg_lscluster", "(", "output", ")", ":", "cluster_dict", "=", "{", "}", "for", "line", "in", "output", ".", "splitlines", "(", ")", ":", "version", ",", "name", ",", "port", ",", "status", ",", "user", ",", "datadir", ",", "log", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_find_credentials
Cycle through all the possible credentials and return the first one that works.
salt/grains/esxi.py
def _find_credentials(host): ''' Cycle through all the possible credentials and return the first one that works. ''' user_names = [__pillar__['proxy'].get('username', 'root')] passwords = __pillar__['proxy']['passwords'] for user in user_names: for password in passwords: ...
def _find_credentials(host): ''' Cycle through all the possible credentials and return the first one that works. ''' user_names = [__pillar__['proxy'].get('username', 'root')] passwords = __pillar__['proxy']['passwords'] for user in user_names: for password in passwords: ...
[ "Cycle", "through", "all", "the", "possible", "credentials", "and", "return", "the", "first", "one", "that", "works", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/esxi.py#L59-L80
[ "def", "_find_credentials", "(", "host", ")", ":", "user_names", "=", "[", "__pillar__", "[", "'proxy'", "]", ".", "get", "(", "'username'", ",", "'root'", ")", "]", "passwords", "=", "__pillar__", "[", "'proxy'", "]", "[", "'passwords'", "]", "for", "us...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_grains
Get the grains from the proxied device.
salt/grains/esxi.py
def _grains(): ''' Get the grains from the proxied device. ''' try: host = __pillar__['proxy']['host'] if host: username, password = _find_credentials(host) protocol = __pillar__['proxy'].get('protocol') port = __pillar__['proxy'].get('port') ...
def _grains(): ''' Get the grains from the proxied device. ''' try: host = __pillar__['proxy']['host'] if host: username, password = _find_credentials(host) protocol = __pillar__['proxy'].get('protocol') port = __pillar__['proxy'].get('port') ...
[ "Get", "the", "grains", "from", "the", "proxied", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/esxi.py#L83-L102
[ "def", "_grains", "(", ")", ":", "try", ":", "host", "=", "__pillar__", "[", "'proxy'", "]", "[", "'host'", "]", "if", "host", ":", "username", ",", "password", "=", "_find_credentials", "(", "host", ")", "protocol", "=", "__pillar__", "[", "'proxy'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Check etcd for all data
salt/pillar/etcd_pillar.py
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 conf): ''' Check etcd for all data ''' comps = conf.split() profile = None if comps[0]: profile = comps[0] client = salt.utils.etcd_util.get_conn(__opts__, profile) path = '/' if len(co...
def ext_pillar(minion_id, pillar, # pylint: disable=W0613 conf): ''' Check etcd for all data ''' comps = conf.split() profile = None if comps[0]: profile = comps[0] client = salt.utils.etcd_util.get_conn(__opts__, profile) path = '/' if len(co...
[ "Check", "etcd", "for", "all", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/etcd_pillar.py#L86-L114
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "conf", ")", ":", "comps", "=", "conf", ".", "split", "(", ")", "profile", "=", "None", "if", "comps", "[", "0", "]", ":", "profile", "=", "comps", "[", "0", "]", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rule_absent
Ensure iptable is not present. name The ip address or CIDR for the rule. method The type of rule. Either 'allow' or 'deny'. port Optional port to be open or closed for the iptables rule. proto The protocol. Either 'tcp', 'udp'. Only applicable if port...
salt/states/csf.py
def rule_absent(name, method, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='s', ttl=None, reload=False): ''' Ensure iptable is not present. name The ...
def rule_absent(name, method, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='s', ttl=None, reload=False): ''' Ensure iptable is not present. name The ...
[ "Ensure", "iptable", "is", "not", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L131-L217
[ "def", "rule_absent", "(", "name", ",", "method", ",", "port", "=", "None", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ",", "port_origin", "=", "'d'", ",", "ip_origin", "=", "'s'", ",", "ttl", "=", "None", ",", "reload", "=", "False",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ports_open
Ensure ports are open for a protocol, in a direction. e.g. - proto='tcp', direction='in' would set the values for TCP_IN in the csf.conf file. ports A list of ports that should be open. proto The protocol. May be one of 'tcp', 'udp', 'tcp6', or 'udp6'. direction Ch...
salt/states/csf.py
def ports_open(name, ports, proto='tcp', direction='in'): ''' Ensure ports are open for a protocol, in a direction. e.g. - proto='tcp', direction='in' would set the values for TCP_IN in the csf.conf file. ports A list of ports that should be open. proto The protocol. May be one...
def ports_open(name, ports, proto='tcp', direction='in'): ''' Ensure ports are open for a protocol, in a direction. e.g. - proto='tcp', direction='in' would set the values for TCP_IN in the csf.conf file. ports A list of ports that should be open. proto The protocol. May be one...
[ "Ensure", "ports", "are", "open", "for", "a", "protocol", "in", "a", "direction", ".", "e", ".", "g", ".", "-", "proto", "=", "tcp", "direction", "=", "in", "would", "set", "the", "values", "for", "TCP_IN", "in", "the", "csf", ".", "conf", "file", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L220-L258
[ "def", "ports_open", "(", "name", ",", "ports", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ")", ":", "ports", "=", "list", "(", "six", ".", "moves", ".", "map", "(", "six", ".", "text_type", ",", "ports", ")", ")", "diff", "=", "F...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
nics_skip
Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>`
salt/states/csf.py
def nics_skip(name, nics, ipv6): ''' Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>` ''' return nics_skipped(name, nics=nics, ipv6=ipv6)
def nics_skip(name, nics, ipv6): ''' Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>` ''' return nics_skipped(name, nics=nics, ipv6=ipv6)
[ "Alias", "for", ":", "mod", ":", "csf", ".", "nics_skipped", "<salt", ".", "states", ".", "csf", ".", "nics_skipped", ">" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L261-L265
[ "def", "nics_skip", "(", "name", ",", "nics", ",", "ipv6", ")", ":", "return", "nics_skipped", "(", "name", ",", "nics", "=", "nics", ",", "ipv6", "=", "ipv6", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
nics_skipped
name Meaningless arg, but required for state. nics A list of nics to skip. ipv6 Boolean. Set to true if you want to skip the ipv6 interface. Default false (ipv4).
salt/states/csf.py
def nics_skipped(name, nics, ipv6=False): ''' name Meaningless arg, but required for state. nics A list of nics to skip. ipv6 Boolean. Set to true if you want to skip the ipv6 interface. Default false (ipv4). ''' ret = {'name': ','.join(nics), 'change...
def nics_skipped(name, nics, ipv6=False): ''' name Meaningless arg, but required for state. nics A list of nics to skip. ipv6 Boolean. Set to true if you want to skip the ipv6 interface. Default false (ipv4). ''' ret = {'name': ','.join(nics), 'change...
[ "name", "Meaningless", "arg", "but", "required", "for", "state", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L268-L290
[ "def", "nics_skipped", "(", "name", ",", "nics", ",", "ipv6", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "','", ".", "join", "(", "nics", ")", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'NI...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
option_present
Ensure the state of a particular option/setting in csf. name The option name in csf.conf value The value it should be set to. reload Boolean. If set to true, csf will be reloaded after.
salt/states/csf.py
def option_present(name, value, reload=False): ''' Ensure the state of a particular option/setting in csf. name The option name in csf.conf value The value it should be set to. reload Boolean. If set to true, csf will be reloaded after. ''' ret = {'name': 'testing ...
def option_present(name, value, reload=False): ''' Ensure the state of a particular option/setting in csf. name The option name in csf.conf value The value it should be set to. reload Boolean. If set to true, csf will be reloaded after. ''' ret = {'name': 'testing ...
[ "Ensure", "the", "state", "of", "a", "particular", "option", "/", "setting", "in", "csf", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/csf.py#L350-L389
[ "def", "option_present", "(", "name", ",", "value", ",", "reload", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "'testing mode'", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Option already present.'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_stack_cfg
Allow top level cfg to be YAML
salt/pillar/stack.py
def _parse_stack_cfg(content): ''' Allow top level cfg to be YAML ''' try: obj = salt.utils.yaml.safe_load(content) if isinstance(obj, list): return obj except Exception as e: pass return content.splitlines()
def _parse_stack_cfg(content): ''' Allow top level cfg to be YAML ''' try: obj = salt.utils.yaml.safe_load(content) if isinstance(obj, list): return obj except Exception as e: pass return content.splitlines()
[ "Allow", "top", "level", "cfg", "to", "be", "YAML" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/stack.py#L529-L539
[ "def", "_parse_stack_cfg", "(", "content", ")", ":", "try", ":", "obj", "=", "salt", ".", "utils", ".", "yaml", ".", "safe_load", "(", "content", ")", "if", "isinstance", "(", "obj", ",", "list", ")", ":", "return", "obj", "except", "Exception", "as", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_clear_context
Remove the cached pip version
salt/modules/pip.py
def _clear_context(bin_env=None): ''' Remove the cached pip version ''' contextkey = 'pip.version' if bin_env is not None: contextkey = '{0}.{1}'.format(contextkey, bin_env) __context__.pop(contextkey, None)
def _clear_context(bin_env=None): ''' Remove the cached pip version ''' contextkey = 'pip.version' if bin_env is not None: contextkey = '{0}.{1}'.format(contextkey, bin_env) __context__.pop(contextkey, None)
[ "Remove", "the", "cached", "pip", "version" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L131-L138
[ "def", "_clear_context", "(", "bin_env", "=", "None", ")", ":", "contextkey", "=", "'pip.version'", "if", "bin_env", "is", "not", "None", ":", "contextkey", "=", "'{0}.{1}'", ".", "format", "(", "contextkey", ",", "bin_env", ")", "__context__", ".", "pop", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_pip_bin
Locate the pip binary, either from `bin_env` as a virtualenv, as the executable itself, or from searching conventional filesystem locations
salt/modules/pip.py
def _get_pip_bin(bin_env): ''' Locate the pip binary, either from `bin_env` as a virtualenv, as the executable itself, or from searching conventional filesystem locations ''' if not bin_env: logger.debug('pip: Using pip from currently-running Python') return [os.path.normpath(sys.exe...
def _get_pip_bin(bin_env): ''' Locate the pip binary, either from `bin_env` as a virtualenv, as the executable itself, or from searching conventional filesystem locations ''' if not bin_env: logger.debug('pip: Using pip from currently-running Python') return [os.path.normpath(sys.exe...
[ "Locate", "the", "pip", "binary", "either", "from", "bin_env", "as", "a", "virtualenv", "as", "the", "executable", "itself", "or", "from", "searching", "conventional", "filesystem", "locations" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L141-L193
[ "def", "_get_pip_bin", "(", "bin_env", ")", ":", "if", "not", "bin_env", ":", "logger", ".", "debug", "(", "'pip: Using pip from currently-running Python'", ")", "return", "[", "os", ".", "path", ".", "normpath", "(", "sys", ".", "executable", ")", ",", "'-m...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_cached_requirements
Get the location of a cached requirements file; caching if necessary.
salt/modules/pip.py
def _get_cached_requirements(requirements, saltenv): ''' Get the location of a cached requirements file; caching if necessary. ''' req_file, senv = salt.utils.url.parse(requirements) if senv: saltenv = senv if req_file not in __salt__['cp.list_master'](saltenv): # Requirements ...
def _get_cached_requirements(requirements, saltenv): ''' Get the location of a cached requirements file; caching if necessary. ''' req_file, senv = salt.utils.url.parse(requirements) if senv: saltenv = senv if req_file not in __salt__['cp.list_master'](saltenv): # Requirements ...
[ "Get", "the", "location", "of", "a", "cached", "requirements", "file", ";", "caching", "if", "necessary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L196-L224
[ "def", "_get_cached_requirements", "(", "requirements", ",", "saltenv", ")", ":", "req_file", ",", "senv", "=", "salt", ".", "utils", ".", "url", ".", "parse", "(", "requirements", ")", "if", "senv", ":", "saltenv", "=", "senv", "if", "req_file", "not", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_env_activate
Return the path to the activate binary
salt/modules/pip.py
def _get_env_activate(bin_env): ''' Return the path to the activate binary ''' if not bin_env: raise CommandNotFoundError('Could not find a `activate` binary') if os.path.isdir(bin_env): if salt.utils.platform.is_windows(): activate_bin = os.path.join(bin_env, 'Scripts',...
def _get_env_activate(bin_env): ''' Return the path to the activate binary ''' if not bin_env: raise CommandNotFoundError('Could not find a `activate` binary') if os.path.isdir(bin_env): if salt.utils.platform.is_windows(): activate_bin = os.path.join(bin_env, 'Scripts',...
[ "Return", "the", "path", "to", "the", "activate", "binary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L227-L241
[ "def", "_get_env_activate", "(", "bin_env", ")", ":", "if", "not", "bin_env", ":", "raise", "CommandNotFoundError", "(", "'Could not find a `activate` binary'", ")", "if", "os", ".", "path", ".", "isdir", "(", "bin_env", ")", ":", "if", "salt", ".", "utils", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_resolve_requirements_chain
Return an array of requirements file paths that can be used to complete the no_chown==False && user != None conundrum
salt/modules/pip.py
def _resolve_requirements_chain(requirements): ''' Return an array of requirements file paths that can be used to complete the no_chown==False && user != None conundrum ''' chain = [] if isinstance(requirements, six.string_types): requirements = [requirements] for req_file in requ...
def _resolve_requirements_chain(requirements): ''' Return an array of requirements file paths that can be used to complete the no_chown==False && user != None conundrum ''' chain = [] if isinstance(requirements, six.string_types): requirements = [requirements] for req_file in requ...
[ "Return", "an", "array", "of", "requirements", "file", "paths", "that", "can", "be", "used", "to", "complete", "the", "no_chown", "==", "False", "&&", "user", "!", "=", "None", "conundrum" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L259-L274
[ "def", "_resolve_requirements_chain", "(", "requirements", ")", ":", "chain", "=", "[", "]", "if", "isinstance", "(", "requirements", ",", "six", ".", "string_types", ")", ":", "requirements", "=", "[", "requirements", "]", "for", "req_file", "in", "requiremen...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_process_requirements
Process the requirements argument
salt/modules/pip.py
def _process_requirements(requirements, cmd, cwd, saltenv, user): ''' Process the requirements argument ''' cleanup_requirements = [] if requirements is not None: if isinstance(requirements, six.string_types): requirements = [r.strip() for r in requirements.split(',')] e...
def _process_requirements(requirements, cmd, cwd, saltenv, user): ''' Process the requirements argument ''' cleanup_requirements = [] if requirements is not None: if isinstance(requirements, six.string_types): requirements = [r.strip() for r in requirements.split(',')] e...
[ "Process", "the", "requirements", "argument" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L277-L383
[ "def", "_process_requirements", "(", "requirements", ",", "cmd", ",", "cwd", ",", "saltenv", ",", "user", ")", ":", "cleanup_requirements", "=", "[", "]", "if", "requirements", "is", "not", "None", ":", "if", "isinstance", "(", "requirements", ",", "six", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install packages with pip Install packages individually or from a pip requirements file. Install packages globally or to a virtualenv. pkgs Comma separated list of packages to install requirements Path to requirements bin_env Path to pip (or to a virtualenv). This can be ...
salt/modules/pip.py
def install(pkgs=None, # pylint: disable=R0912,R0913,R0914 requirements=None, bin_env=None, use_wheel=False, no_use_wheel=False, log=None, proxy=None, timeout=None, editable=None, find_links=None, in...
def install(pkgs=None, # pylint: disable=R0912,R0913,R0914 requirements=None, bin_env=None, use_wheel=False, no_use_wheel=False, log=None, proxy=None, timeout=None, editable=None, find_links=None, in...
[ "Install", "packages", "with", "pip" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L402-L961
[ "def", "install", "(", "pkgs", "=", "None", ",", "# pylint: disable=R0912,R0913,R0914", "requirements", "=", "None", ",", "bin_env", "=", "None", ",", "use_wheel", "=", "False", ",", "no_use_wheel", "=", "False", ",", "log", "=", "None", ",", "proxy", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
uninstall
Uninstall packages individually or from a pip requirements file pkgs comma separated list of packages to install requirements Path to requirements file bin_env Path to pip (or to a virtualenv). This can be used to specify the path to the pip to use when more than one Pytho...
salt/modules/pip.py
def uninstall(pkgs=None, requirements=None, bin_env=None, log=None, proxy=None, timeout=None, user=None, cwd=None, saltenv='base', use_vt=False): ''' Uninstall packages individually or f...
def uninstall(pkgs=None, requirements=None, bin_env=None, log=None, proxy=None, timeout=None, user=None, cwd=None, saltenv='base', use_vt=False): ''' Uninstall packages individually or f...
[ "Uninstall", "packages", "individually", "or", "from", "a", "pip", "requirements", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L964-L1086
[ "def", "uninstall", "(", "pkgs", "=", "None", ",", "requirements", "=", "None", ",", "bin_env", "=", "None", ",", "log", "=", "None", ",", "proxy", "=", "None", ",", "timeout", "=", "None", ",", "user", "=", "None", ",", "cwd", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
freeze
Return a list of installed packages either globally or in the specified virtualenv bin_env Path to pip (or to a virtualenv). This can be used to specify the path to the pip to use when more than one Python release is installed (e.g. ``/usr/bin/pip-2.7`` or ``/usr/bin/pip-2.6``. If a dir...
salt/modules/pip.py
def freeze(bin_env=None, user=None, cwd=None, use_vt=False, env_vars=None, **kwargs): ''' Return a list of installed packages either globally or in the specified virtualenv bin_env Path to pip (or to a virtualenv). This can be used to speci...
def freeze(bin_env=None, user=None, cwd=None, use_vt=False, env_vars=None, **kwargs): ''' Return a list of installed packages either globally or in the specified virtualenv bin_env Path to pip (or to a virtualenv). This can be used to speci...
[ "Return", "a", "list", "of", "installed", "packages", "either", "globally", "or", "in", "the", "specified", "virtualenv" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1089-L1149
[ "def", "freeze", "(", "bin_env", "=", "None", ",", "user", "=", "None", ",", "cwd", "=", "None", ",", "use_vt", "=", "False", ",", "env_vars", "=", "None", ",", "*", "*", "kwargs", ")", ":", "cmd", "=", "_get_pip_bin", "(", "bin_env", ")", "cmd", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_
Filter list of installed apps from ``freeze`` and check to see if ``prefix`` exists in the list of packages installed. .. note:: If the version of pip available is older than 8.0.3, the packages ``wheel``, ``setuptools``, and ``distribute`` will not be reported by this function even if...
salt/modules/pip.py
def list_(prefix=None, bin_env=None, user=None, cwd=None, env_vars=None, **kwargs): ''' Filter list of installed apps from ``freeze`` and check to see if ``prefix`` exists in the list of packages installed. .. note:: If the version of pip avail...
def list_(prefix=None, bin_env=None, user=None, cwd=None, env_vars=None, **kwargs): ''' Filter list of installed apps from ``freeze`` and check to see if ``prefix`` exists in the list of packages installed. .. note:: If the version of pip avail...
[ "Filter", "list", "of", "installed", "apps", "from", "freeze", "and", "check", "to", "see", "if", "prefix", "exists", "in", "the", "list", "of", "packages", "installed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1152-L1220
[ "def", "list_", "(", "prefix", "=", "None", ",", "bin_env", "=", "None", ",", "user", "=", "None", ",", "cwd", "=", "None", ",", "env_vars", "=", "None", ",", "*", "*", "kwargs", ")", ":", "packages", "=", "{", "}", "if", "prefix", "is", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
.. versionadded:: 0.17.0 Returns the version of pip. Use ``bin_env`` to specify the path to a virtualenv and get the version of pip in that virtualenv. If unable to detect the pip version, returns ``None``. CLI Example: .. code-block:: bash salt '*' pip.version
salt/modules/pip.py
def version(bin_env=None): ''' .. versionadded:: 0.17.0 Returns the version of pip. Use ``bin_env`` to specify the path to a virtualenv and get the version of pip in that virtualenv. If unable to detect the pip version, returns ``None``. CLI Example: .. code-block:: bash salt '*...
def version(bin_env=None): ''' .. versionadded:: 0.17.0 Returns the version of pip. Use ``bin_env`` to specify the path to a virtualenv and get the version of pip in that virtualenv. If unable to detect the pip version, returns ``None``. CLI Example: .. code-block:: bash salt '*...
[ "..", "versionadded", "::", "0", ".", "17", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1223-L1258
[ "def", "version", "(", "bin_env", "=", "None", ")", ":", "contextkey", "=", "'pip.version'", "if", "bin_env", "is", "not", "None", ":", "contextkey", "=", "'{0}.{1}'", ".", "format", "(", "contextkey", ",", "bin_env", ")", "if", "contextkey", "in", "__cont...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_upgrades
Check whether or not an upgrade is available for all packages CLI Example: .. code-block:: bash salt '*' pip.list_upgrades
salt/modules/pip.py
def list_upgrades(bin_env=None, user=None, cwd=None): ''' Check whether or not an upgrade is available for all packages CLI Example: .. code-block:: bash salt '*' pip.list_upgrades ''' cmd = _get_pip_bin(bin_env) cmd.extend(['list', '--outdated'...
def list_upgrades(bin_env=None, user=None, cwd=None): ''' Check whether or not an upgrade is available for all packages CLI Example: .. code-block:: bash salt '*' pip.list_upgrades ''' cmd = _get_pip_bin(bin_env) cmd.extend(['list', '--outdated'...
[ "Check", "whether", "or", "not", "an", "upgrade", "is", "available", "for", "all", "packages" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1261-L1336
[ "def", "list_upgrades", "(", "bin_env", "=", "None", ",", "user", "=", "None", ",", "cwd", "=", "None", ")", ":", "cmd", "=", "_get_pip_bin", "(", "bin_env", ")", "cmd", ".", "extend", "(", "[", "'list'", ",", "'--outdated'", "]", ")", "pip_version", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
is_installed
.. versionadded:: 2018.3.0 Filter list of installed apps from ``freeze`` and return True or False if ``pkgname`` exists in the list of packages installed. .. note:: If the version of pip available is older than 8.0.3, the packages wheel, setuptools, and distribute will not be reported by ...
salt/modules/pip.py
def is_installed(pkgname=None, bin_env=None, user=None, cwd=None): ''' .. versionadded:: 2018.3.0 Filter list of installed apps from ``freeze`` and return True or False if ``pkgname`` exists in the list of packages installed. .. note:: If...
def is_installed(pkgname=None, bin_env=None, user=None, cwd=None): ''' .. versionadded:: 2018.3.0 Filter list of installed apps from ``freeze`` and return True or False if ``pkgname`` exists in the list of packages installed. .. note:: If...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pip.py#L1339-L1387
[ "def", "is_installed", "(", "pkgname", "=", "None", ",", "bin_env", "=", "None", ",", "user", "=", "None", ",", "cwd", "=", "None", ")", ":", "for", "line", "in", "freeze", "(", "bin_env", "=", "bin_env", ",", "user", "=", "user", ",", "cwd", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46