id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
37,300
saltstack/salt
salt/modules/inspectlib/collector.py
is_alive
def is_alive(pidfile): ''' Check if PID is still alive. ''' try: with salt.utils.files.fopen(pidfile) as fp_: os.kill(int(fp_.read().strip()), 0) return True except Exception as ex: if os.access(pidfile, os.W_OK) and os.path.isfile(pidfile): os.unlink(...
python
def is_alive(pidfile): ''' Check if PID is still alive. ''' try: with salt.utils.files.fopen(pidfile) as fp_: os.kill(int(fp_.read().strip()), 0) return True except Exception as ex: if os.access(pidfile, os.W_OK) and os.path.isfile(pidfile): os.unlink(...
[ "def", "is_alive", "(", "pidfile", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "pidfile", ")", "as", "fp_", ":", "os", ".", "kill", "(", "int", "(", "fp_", ".", "read", "(", ")", ".", "strip", "(", ")", ...
Check if PID is still alive.
[ "Check", "if", "PID", "is", "still", "alive", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L475-L486
37,301
saltstack/salt
salt/modules/inspectlib/collector.py
main
def main(dbfile, pidfile, mode): ''' Main analyzer routine. ''' Inspector(dbfile, pidfile).reuse_snapshot().snapshot(mode)
python
def main(dbfile, pidfile, mode): ''' Main analyzer routine. ''' Inspector(dbfile, pidfile).reuse_snapshot().snapshot(mode)
[ "def", "main", "(", "dbfile", ",", "pidfile", ",", "mode", ")", ":", "Inspector", "(", "dbfile", ",", "pidfile", ")", ".", "reuse_snapshot", "(", ")", ".", "snapshot", "(", "mode", ")" ]
Main analyzer routine.
[ "Main", "analyzer", "routine", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L489-L493
37,302
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._syscall
def _syscall(self, command, input=None, env=None, *params): ''' Call an external system command. ''' return Popen([command] + list(params), stdout=PIPE, stdin=PIPE, stderr=STDOUT, env=env or os.environ).communicate(input=input)
python
def _syscall(self, command, input=None, env=None, *params): ''' Call an external system command. ''' return Popen([command] + list(params), stdout=PIPE, stdin=PIPE, stderr=STDOUT, env=env or os.environ).communicate(input=input)
[ "def", "_syscall", "(", "self", ",", "command", ",", "input", "=", "None", ",", "env", "=", "None", ",", "*", "params", ")", ":", "return", "Popen", "(", "[", "command", "]", "+", "list", "(", "params", ")", ",", "stdout", "=", "PIPE", ",", "stdi...
Call an external system command.
[ "Call", "an", "external", "system", "command", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L77-L82
37,303
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._get_cfg_pkgs
def _get_cfg_pkgs(self): ''' Package scanner switcher between the platforms. :return: ''' if self.grains_core.os_data().get('os_family') == 'Debian': return self.__get_cfg_pkgs_dpkg() elif self.grains_core.os_data().get('os_family') in ['Suse', 'redhat']: ...
python
def _get_cfg_pkgs(self): ''' Package scanner switcher between the platforms. :return: ''' if self.grains_core.os_data().get('os_family') == 'Debian': return self.__get_cfg_pkgs_dpkg() elif self.grains_core.os_data().get('os_family') in ['Suse', 'redhat']: ...
[ "def", "_get_cfg_pkgs", "(", "self", ")", ":", "if", "self", ".", "grains_core", ".", "os_data", "(", ")", ".", "get", "(", "'os_family'", ")", "==", "'Debian'", ":", "return", "self", ".", "__get_cfg_pkgs_dpkg", "(", ")", "elif", "self", ".", "grains_co...
Package scanner switcher between the platforms. :return:
[ "Package", "scanner", "switcher", "between", "the", "platforms", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L84-L95
37,304
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector.__get_cfg_pkgs_rpm
def __get_cfg_pkgs_rpm(self): ''' Get packages with configuration files on RPM systems. ''' out, err = self._syscall('rpm', None, None, '-qa', '--configfiles', '--queryformat', '%{name}-%{version}-%{release}\\n') data = dict() pkg_name = N...
python
def __get_cfg_pkgs_rpm(self): ''' Get packages with configuration files on RPM systems. ''' out, err = self._syscall('rpm', None, None, '-qa', '--configfiles', '--queryformat', '%{name}-%{version}-%{release}\\n') data = dict() pkg_name = N...
[ "def", "__get_cfg_pkgs_rpm", "(", "self", ")", ":", "out", ",", "err", "=", "self", ".", "_syscall", "(", "'rpm'", ",", "None", ",", "None", ",", "'-qa'", ",", "'--configfiles'", ",", "'--queryformat'", ",", "'%{name}-%{version}-%{release}\\\\n'", ")", "data",...
Get packages with configuration files on RPM systems.
[ "Get", "packages", "with", "configuration", "files", "on", "RPM", "systems", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L126-L152
37,305
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._get_changed_cfg_pkgs
def _get_changed_cfg_pkgs(self, data): ''' Filter out unchanged packages on the Debian or RPM systems. :param data: Structure {package-name -> [ file .. file1 ]} :return: Same structure as data, except only files that were changed. ''' f_data = dict() for pkg_nam...
python
def _get_changed_cfg_pkgs(self, data): ''' Filter out unchanged packages on the Debian or RPM systems. :param data: Structure {package-name -> [ file .. file1 ]} :return: Same structure as data, except only files that were changed. ''' f_data = dict() for pkg_nam...
[ "def", "_get_changed_cfg_pkgs", "(", "self", ",", "data", ")", ":", "f_data", "=", "dict", "(", ")", "for", "pkg_name", ",", "pkg_files", "in", "data", ".", "items", "(", ")", ":", "cfgs", "=", "list", "(", ")", "cfg_data", "=", "list", "(", ")", "...
Filter out unchanged packages on the Debian or RPM systems. :param data: Structure {package-name -> [ file .. file1 ]} :return: Same structure as data, except only files that were changed.
[ "Filter", "out", "unchanged", "packages", "on", "the", "Debian", "or", "RPM", "systems", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L154-L182
37,306
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._get_managed_files
def _get_managed_files(self): ''' Build a in-memory data of all managed files. ''' if self.grains_core.os_data().get('os_family') == 'Debian': return self.__get_managed_files_dpkg() elif self.grains_core.os_data().get('os_family') in ['Suse', 'redhat']: re...
python
def _get_managed_files(self): ''' Build a in-memory data of all managed files. ''' if self.grains_core.os_data().get('os_family') == 'Debian': return self.__get_managed_files_dpkg() elif self.grains_core.os_data().get('os_family') in ['Suse', 'redhat']: re...
[ "def", "_get_managed_files", "(", "self", ")", ":", "if", "self", ".", "grains_core", ".", "os_data", "(", ")", ".", "get", "(", "'os_family'", ")", "==", "'Debian'", ":", "return", "self", ".", "__get_managed_files_dpkg", "(", ")", "elif", "self", ".", ...
Build a in-memory data of all managed files.
[ "Build", "a", "in", "-", "memory", "data", "of", "all", "managed", "files", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L239-L248
37,307
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector.__get_managed_files_dpkg
def __get_managed_files_dpkg(self): ''' Get a list of all system files, belonging to the Debian package manager. ''' dirs = set() links = set() files = set() for pkg_name in salt.utils.stringutils.to_str(self._syscall("dpkg-query", None, None, ...
python
def __get_managed_files_dpkg(self): ''' Get a list of all system files, belonging to the Debian package manager. ''' dirs = set() links = set() files = set() for pkg_name in salt.utils.stringutils.to_str(self._syscall("dpkg-query", None, None, ...
[ "def", "__get_managed_files_dpkg", "(", "self", ")", ":", "dirs", "=", "set", "(", ")", "links", "=", "set", "(", ")", "files", "=", "set", "(", ")", "for", "pkg_name", "in", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "self", ".", ...
Get a list of all system files, belonging to the Debian package manager.
[ "Get", "a", "list", "of", "all", "system", "files", "belonging", "to", "the", "Debian", "package", "manager", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L250-L274
37,308
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector.__get_managed_files_rpm
def __get_managed_files_rpm(self): ''' Get a list of all system files, belonging to the RedHat package manager. ''' dirs = set() links = set() files = set() for line in salt.utils.stringutils.to_str(self._syscall("rpm", None, None, '-qlav')[0]).split(os.linesep):...
python
def __get_managed_files_rpm(self): ''' Get a list of all system files, belonging to the RedHat package manager. ''' dirs = set() links = set() files = set() for line in salt.utils.stringutils.to_str(self._syscall("rpm", None, None, '-qlav')[0]).split(os.linesep):...
[ "def", "__get_managed_files_rpm", "(", "self", ")", ":", "dirs", "=", "set", "(", ")", "links", "=", "set", "(", ")", "files", "=", "set", "(", ")", "for", "line", "in", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "self", ".", "_s...
Get a list of all system files, belonging to the RedHat package manager.
[ "Get", "a", "list", "of", "all", "system", "files", "belonging", "to", "the", "RedHat", "package", "manager", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L276-L296
37,309
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._get_all_files
def _get_all_files(self, path, *exclude): ''' Walk implementation. Version in python 2.x and 3.x works differently. ''' files = list() dirs = list() links = list() if os.access(path, os.R_OK): for obj in os.listdir(path): obj = os.path...
python
def _get_all_files(self, path, *exclude): ''' Walk implementation. Version in python 2.x and 3.x works differently. ''' files = list() dirs = list() links = list() if os.access(path, os.R_OK): for obj in os.listdir(path): obj = os.path...
[ "def", "_get_all_files", "(", "self", ",", "path", ",", "*", "exclude", ")", ":", "files", "=", "list", "(", ")", "dirs", "=", "list", "(", ")", "links", "=", "list", "(", ")", "if", "os", ".", "access", "(", "path", ",", "os", ".", "R_OK", ")"...
Walk implementation. Version in python 2.x and 3.x works differently.
[ "Walk", "implementation", ".", "Version", "in", "python", "2", ".", "x", "and", "3", ".", "x", "works", "differently", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L298-L327
37,310
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._get_unmanaged_files
def _get_unmanaged_files(self, managed, system_all): ''' Get the intersection between all files and managed files. ''' m_files, m_dirs, m_links = managed s_files, s_dirs, s_links = system_all return (sorted(list(set(s_files).difference(m_files))), sorted(...
python
def _get_unmanaged_files(self, managed, system_all): ''' Get the intersection between all files and managed files. ''' m_files, m_dirs, m_links = managed s_files, s_dirs, s_links = system_all return (sorted(list(set(s_files).difference(m_files))), sorted(...
[ "def", "_get_unmanaged_files", "(", "self", ",", "managed", ",", "system_all", ")", ":", "m_files", ",", "m_dirs", ",", "m_links", "=", "managed", "s_files", ",", "s_dirs", ",", "s_links", "=", "system_all", "return", "(", "sorted", "(", "list", "(", "set"...
Get the intersection between all files and managed files.
[ "Get", "the", "intersection", "between", "all", "files", "and", "managed", "files", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L329-L338
37,311
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._scan_payload
def _scan_payload(self): ''' Scan the system. ''' # Get ignored points allowed = list() for allowed_dir in self.db.get(AllowedDir): if os.path.exists(allowed_dir.path): allowed.append(allowed_dir.path) ignored = list() if not a...
python
def _scan_payload(self): ''' Scan the system. ''' # Get ignored points allowed = list() for allowed_dir in self.db.get(AllowedDir): if os.path.exists(allowed_dir.path): allowed.append(allowed_dir.path) ignored = list() if not a...
[ "def", "_scan_payload", "(", "self", ")", ":", "# Get ignored points", "allowed", "=", "list", "(", ")", "for", "allowed_dir", "in", "self", ".", "db", ".", "get", "(", "AllowedDir", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "allowed_dir", ...
Scan the system.
[ "Scan", "the", "system", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L340-L369
37,312
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._prepare_full_scan
def _prepare_full_scan(self, **kwargs): ''' Prepare full system scan by setting up the database etc. ''' self.db.open(new=True) # Add ignored filesystems ignored_fs = set() ignored_fs |= set(self.IGNORE_PATHS) mounts = salt.utils.fsutils._get_mounts() ...
python
def _prepare_full_scan(self, **kwargs): ''' Prepare full system scan by setting up the database etc. ''' self.db.open(new=True) # Add ignored filesystems ignored_fs = set() ignored_fs |= set(self.IGNORE_PATHS) mounts = salt.utils.fsutils._get_mounts() ...
[ "def", "_prepare_full_scan", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "db", ".", "open", "(", "new", "=", "True", ")", "# Add ignored filesystems", "ignored_fs", "=", "set", "(", ")", "ignored_fs", "|=", "set", "(", "self", ".", "IG...
Prepare full system scan by setting up the database etc.
[ "Prepare", "full", "system", "scan", "by", "setting", "up", "the", "database", "etc", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L371-L412
37,313
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector._init_env
def _init_env(self): ''' Initialize some Salt environment. ''' from salt.config import minion_config from salt.grains import core as g_core g_core.__opts__ = minion_config(self.DEFAULT_MINION_CONFIG_PATH) self.grains_core = g_core
python
def _init_env(self): ''' Initialize some Salt environment. ''' from salt.config import minion_config from salt.grains import core as g_core g_core.__opts__ = minion_config(self.DEFAULT_MINION_CONFIG_PATH) self.grains_core = g_core
[ "def", "_init_env", "(", "self", ")", ":", "from", "salt", ".", "config", "import", "minion_config", "from", "salt", ".", "grains", "import", "core", "as", "g_core", "g_core", ".", "__opts__", "=", "minion_config", "(", "self", ".", "DEFAULT_MINION_CONFIG_PATH...
Initialize some Salt environment.
[ "Initialize", "some", "Salt", "environment", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L414-L421
37,314
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector.export
def export(self, description, local=False, path='/tmp', format='qcow2'): ''' Export description for Kiwi. :param local: :param path: :return: ''' kiwiproc.__salt__ = __salt__ return kiwiproc.KiwiExporter(grains=__grains__, ...
python
def export(self, description, local=False, path='/tmp', format='qcow2'): ''' Export description for Kiwi. :param local: :param path: :return: ''' kiwiproc.__salt__ = __salt__ return kiwiproc.KiwiExporter(grains=__grains__, ...
[ "def", "export", "(", "self", ",", "description", ",", "local", "=", "False", ",", "path", "=", "'/tmp'", ",", "format", "=", "'qcow2'", ")", ":", "kiwiproc", ".", "__salt__", "=", "__salt__", "return", "kiwiproc", ".", "KiwiExporter", "(", "grains", "="...
Export description for Kiwi. :param local: :param path: :return:
[ "Export", "description", "for", "Kiwi", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L447-L457
37,315
saltstack/salt
salt/modules/inspectlib/collector.py
Inspector.build
def build(self, format='qcow2', path='/tmp'): ''' Build an image using Kiwi. :param format: :param path: :return: ''' if kiwi is None: msg = 'Unable to build the image due to the missing dependencies: Kiwi module is not available.' log.err...
python
def build(self, format='qcow2', path='/tmp'): ''' Build an image using Kiwi. :param format: :param path: :return: ''' if kiwi is None: msg = 'Unable to build the image due to the missing dependencies: Kiwi module is not available.' log.err...
[ "def", "build", "(", "self", ",", "format", "=", "'qcow2'", ",", "path", "=", "'/tmp'", ")", ":", "if", "kiwi", "is", "None", ":", "msg", "=", "'Unable to build the image due to the missing dependencies: Kiwi module is not available.'", "log", ".", "error", "(", "...
Build an image using Kiwi. :param format: :param path: :return:
[ "Build", "an", "image", "using", "Kiwi", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/collector.py#L459-L472
37,316
saltstack/salt
salt/states/boto_iot.py
thing_type_present
def thing_type_present(name, thingTypeName, thingTypeDescription, searchableAttributesList, region=None, key=None, keyid=None, profile=None): ''' Ensure thing type exists. .. versionadded:: 2016.11.0 name The name of the state definition thingTypeName Name of the thing typ...
python
def thing_type_present(name, thingTypeName, thingTypeDescription, searchableAttributesList, region=None, key=None, keyid=None, profile=None): ''' Ensure thing type exists. .. versionadded:: 2016.11.0 name The name of the state definition thingTypeName Name of the thing typ...
[ "def", "thing_type_present", "(", "name", ",", "thingTypeName", ",", "thingTypeDescription", ",", "searchableAttributesList", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", ...
Ensure thing type exists. .. versionadded:: 2016.11.0 name The name of the state definition thingTypeName Name of the thing type thingTypeDescription Description of the thing type searchableAttributesList List of string attributes that are searchable for ...
[ "Ensure", "thing", "type", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_iot.py#L97-L178
37,317
saltstack/salt
salt/states/boto_iot.py
thing_type_absent
def thing_type_absent(name, thingTypeName, region=None, key=None, keyid=None, profile=None): ''' Ensure thing type with passed properties is absent. .. versionadded:: 2016.11.0 name The name of the state definition. thingTypeName Name of the thing type. regi...
python
def thing_type_absent(name, thingTypeName, region=None, key=None, keyid=None, profile=None): ''' Ensure thing type with passed properties is absent. .. versionadded:: 2016.11.0 name The name of the state definition. thingTypeName Name of the thing type. regi...
[ "def", "thing_type_absent", "(", "name", ",", "thingTypeName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "thingTypeName", ",", "'result'", ":",...
Ensure thing type with passed properties is absent. .. versionadded:: 2016.11.0 name The name of the state definition. thingTypeName Name of the thing type. region Region to connect to. key Secret key to be used. keyid Access key to be used. pro...
[ "Ensure", "thing", "type", "with", "passed", "properties", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_iot.py#L181-L296
37,318
saltstack/salt
salt/states/boto_iot.py
policy_attached
def policy_attached(name, policyName, principal, region=None, key=None, keyid=None, profile=None): ''' Ensure policy is attached to the given principal. name The name of the state definition policyName Name of the policy. principal The principal which can be a ...
python
def policy_attached(name, policyName, principal, region=None, key=None, keyid=None, profile=None): ''' Ensure policy is attached to the given principal. name The name of the state definition policyName Name of the policy. principal The principal which can be a ...
[ "def", "policy_attached", "(", "name", ",", "policyName", ",", "principal", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "policyName", ",", "'re...
Ensure policy is attached to the given principal. name The name of the state definition policyName Name of the policy. principal The principal which can be a certificate ARN or a Cognito ID. region Region to connect to. key Secret key to be used. key...
[ "Ensure", "policy", "is", "attached", "to", "the", "given", "principal", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_iot.py#L490-L557
37,319
saltstack/salt
salt/states/boto_iot.py
topic_rule_absent
def topic_rule_absent(name, ruleName, region=None, key=None, keyid=None, profile=None): ''' Ensure topic rule with passed properties is absent. name The name of the state definition. ruleName Name of the policy. region Region to connect to. key ...
python
def topic_rule_absent(name, ruleName, region=None, key=None, keyid=None, profile=None): ''' Ensure topic rule with passed properties is absent. name The name of the state definition. ruleName Name of the policy. region Region to connect to. key ...
[ "def", "topic_rule_absent", "(", "name", ",", "ruleName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "ruleName", ",", "'result'", ":", "True",...
Ensure topic rule with passed properties is absent. name The name of the state definition. ruleName Name of the policy. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and k...
[ "Ensure", "topic", "rule", "with", "passed", "properties", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_iot.py#L749-L805
37,320
saltstack/salt
salt/modules/useradd.py
_quote_username
def _quote_username(name): ''' Usernames can only contain ascii chars, so make sure we return a str type ''' if not isinstance(name, six.string_types): return str(name) # future lint: disable=blacklisted-function else: return salt.utils.stringutils.to_str(name)
python
def _quote_username(name): ''' Usernames can only contain ascii chars, so make sure we return a str type ''' if not isinstance(name, six.string_types): return str(name) # future lint: disable=blacklisted-function else: return salt.utils.stringutils.to_str(name)
[ "def", "_quote_username", "(", "name", ")", ":", "if", "not", "isinstance", "(", "name", ",", "six", ".", "string_types", ")", ":", "return", "str", "(", "name", ")", "# future lint: disable=blacklisted-function", "else", ":", "return", "salt", ".", "utils", ...
Usernames can only contain ascii chars, so make sure we return a str type
[ "Usernames", "can", "only", "contain", "ascii", "chars", "so", "make", "sure", "we", "return", "a", "str", "type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/useradd.py#L50-L57
37,321
saltstack/salt
salt/modules/useradd.py
chgroups
def chgroups(name, groups, append=False, root=None): ''' Change the groups to which this user belongs name User to modify groups Groups to set for the user append : False If ``True``, append the specified group(s). Otherwise, this function will replace the user's g...
python
def chgroups(name, groups, append=False, root=None): ''' Change the groups to which this user belongs name User to modify groups Groups to set for the user append : False If ``True``, append the specified group(s). Otherwise, this function will replace the user's g...
[ "def", "chgroups", "(", "name", ",", "groups", ",", "append", "=", "False", ",", "root", "=", "None", ")", ":", "if", "isinstance", "(", "groups", ",", "six", ".", "string_types", ")", ":", "groups", "=", "groups", ".", "split", "(", "','", ")", "u...
Change the groups to which this user belongs name User to modify groups Groups to set for the user append : False If ``True``, append the specified group(s). Otherwise, this function will replace the user's groups with the specified group(s). root Directory to...
[ "Change", "the", "groups", "to", "which", "this", "user", "belongs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/useradd.py#L523-L583
37,322
saltstack/salt
salt/modules/useradd.py
list_users
def list_users(root=None): ''' Return a list of all users root Directory to chroot into CLI Example: .. code-block:: bash salt '*' user.list_users ''' if root is not None and __grains__['kernel'] != 'AIX': getpwall = functools.partial(_getpwall, root=root) els...
python
def list_users(root=None): ''' Return a list of all users root Directory to chroot into CLI Example: .. code-block:: bash salt '*' user.list_users ''' if root is not None and __grains__['kernel'] != 'AIX': getpwall = functools.partial(_getpwall, root=root) els...
[ "def", "list_users", "(", "root", "=", "None", ")", ":", "if", "root", "is", "not", "None", "and", "__grains__", "[", "'kernel'", "]", "!=", "'AIX'", ":", "getpwall", "=", "functools", ".", "partial", "(", "_getpwall", ",", "root", "=", "root", ")", ...
Return a list of all users root Directory to chroot into CLI Example: .. code-block:: bash salt '*' user.list_users
[ "Return", "a", "list", "of", "all", "users" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/useradd.py#L852-L870
37,323
saltstack/salt
salt/modules/useradd.py
add_subgids
def add_subgids(name, first=100000, last=110000): ''' Add a range of subordinate gids to the user name User to modify first Begin of the range last End of the range CLI Examples: .. code-block:: bash salt '*' user.add_subgids foo salt '*' user.ad...
python
def add_subgids(name, first=100000, last=110000): ''' Add a range of subordinate gids to the user name User to modify first Begin of the range last End of the range CLI Examples: .. code-block:: bash salt '*' user.add_subgids foo salt '*' user.ad...
[ "def", "add_subgids", "(", "name", ",", "first", "=", "100000", ",", "last", "=", "110000", ")", ":", "if", "__grains__", "[", "'kernel'", "]", "!=", "'Linux'", ":", "log", ".", "warning", "(", "\"'subgids' are only supported on GNU/Linux hosts.\"", ")", "retu...
Add a range of subordinate gids to the user name User to modify first Begin of the range last End of the range CLI Examples: .. code-block:: bash salt '*' user.add_subgids foo salt '*' user.add_subgids foo first=105000 salt '*' user.add_subgids f...
[ "Add", "a", "range", "of", "subordinate", "gids", "to", "the", "user" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/useradd.py#L984-L1008
37,324
saltstack/salt
salt/states/win_dism.py
capability_installed
def capability_installed(name, source=None, limit_access=False, image=None, restart=False): ''' Install a DISM capability Args: name (str): The capability to install source (str): The optiona...
python
def capability_installed(name, source=None, limit_access=False, image=None, restart=False): ''' Install a DISM capability Args: name (str): The capability to install source (str): The optiona...
[ "def", "capability_installed", "(", "name", ",", "source", "=", "None", ",", "limit_access", "=", "False", ",", "image", "=", "None", ",", "restart", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "...
Install a DISM capability Args: name (str): The capability to install source (str): The optional source of the capability limit_access (bool): Prevent DISM from contacting Windows Update for online images image (Optional[str]): The path to the root directory of an offlin...
[ "Install", "a", "DISM", "capability" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_dism.py#L40-L101
37,325
saltstack/salt
salt/modules/network.py
ping
def ping(host, timeout=False, return_boolean=False): ''' Performs an ICMP ping to a host .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.ping archlinux.org .. versionadded:: 2015.5.0 Return a True or False instead ...
python
def ping(host, timeout=False, return_boolean=False): ''' Performs an ICMP ping to a host .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.ping archlinux.org .. versionadded:: 2015.5.0 Return a True or False instead ...
[ "def", "ping", "(", "host", ",", "timeout", "=", "False", ",", "return_boolean", "=", "False", ")", ":", "if", "timeout", ":", "if", "__grains__", "[", "'kernel'", "]", "==", "'SunOS'", ":", "cmd", "=", "'ping -c 4 {1} {0}'", ".", "format", "(", "timeout...
Performs an ICMP ping to a host .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.ping archlinux.org .. versionadded:: 2015.5.0 Return a True or False instead of ping output. .. code-block:: bash salt '*' netwo...
[ "Performs", "an", "ICMP", "ping", "to", "a", "host" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L63-L104
37,326
saltstack/salt
salt/modules/network.py
_netstat_linux
def _netstat_linux(): ''' Return netstat information for Linux distros ''' ret = [] cmd = 'netstat -tulpnea' out = __salt__['cmd.run'](cmd) for line in out.splitlines(): comps = line.split() if line.startswith('tcp'): ret.append({ 'proto': comps[0]...
python
def _netstat_linux(): ''' Return netstat information for Linux distros ''' ret = [] cmd = 'netstat -tulpnea' out = __salt__['cmd.run'](cmd) for line in out.splitlines(): comps = line.split() if line.startswith('tcp'): ret.append({ 'proto': comps[0]...
[ "def", "_netstat_linux", "(", ")", ":", "ret", "=", "[", "]", "cmd", "=", "'netstat -tulpnea'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "for", "line", "in", "out", ".", "splitlines", "(", ")", ":", "comps", "=", "line", ".", ...
Return netstat information for Linux distros
[ "Return", "netstat", "information", "for", "Linux", "distros" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L109-L139
37,327
saltstack/salt
salt/modules/network.py
_netinfo_openbsd
def _netinfo_openbsd(): ''' Get process information for network connections using fstat ''' ret = {} _fstat_re = re.compile( r'internet(6)? (?:stream tcp 0x\S+ (\S+)|dgram udp (\S+))' r'(?: [<>=-]+ (\S+))?$' ) out = __salt__['cmd.run']('fstat') for line in out.splitlines(...
python
def _netinfo_openbsd(): ''' Get process information for network connections using fstat ''' ret = {} _fstat_re = re.compile( r'internet(6)? (?:stream tcp 0x\S+ (\S+)|dgram udp (\S+))' r'(?: [<>=-]+ (\S+))?$' ) out = __salt__['cmd.run']('fstat') for line in out.splitlines(...
[ "def", "_netinfo_openbsd", "(", ")", ":", "ret", "=", "{", "}", "_fstat_re", "=", "re", ".", "compile", "(", "r'internet(6)? (?:stream tcp 0x\\S+ (\\S+)|dgram udp (\\S+))'", "r'(?: [<>=-]+ (\\S+))?$'", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'fstat...
Get process information for network connections using fstat
[ "Get", "process", "information", "for", "network", "connections", "using", "fstat" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L199-L243
37,328
saltstack/salt
salt/modules/network.py
_netinfo_freebsd_netbsd
def _netinfo_freebsd_netbsd(): ''' Get process information for network connections using sockstat ''' ret = {} # NetBSD requires '-n' to disable port-to-service resolution out = __salt__['cmd.run']( 'sockstat -46 {0} | tail -n+2'.format( '-n' if __grains__['kernel'] == 'NetBS...
python
def _netinfo_freebsd_netbsd(): ''' Get process information for network connections using sockstat ''' ret = {} # NetBSD requires '-n' to disable port-to-service resolution out = __salt__['cmd.run']( 'sockstat -46 {0} | tail -n+2'.format( '-n' if __grains__['kernel'] == 'NetBS...
[ "def", "_netinfo_freebsd_netbsd", "(", ")", ":", "ret", "=", "{", "}", "# NetBSD requires '-n' to disable port-to-service resolution", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'sockstat -46 {0} | tail -n+2'", ".", "format", "(", "'-n'", "if", "__grains__", ...
Get process information for network connections using sockstat
[ "Get", "process", "information", "for", "network", "connections", "using", "sockstat" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L246-L267
37,329
saltstack/salt
salt/modules/network.py
_ppid
def _ppid(): ''' Return a dict of pid to ppid mappings ''' ret = {} if __grains__['kernel'] == 'SunOS': cmd = 'ps -a -o pid,ppid | tail +2' else: cmd = 'ps -ax -o pid,ppid | tail -n+2' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): ...
python
def _ppid(): ''' Return a dict of pid to ppid mappings ''' ret = {} if __grains__['kernel'] == 'SunOS': cmd = 'ps -a -o pid,ppid | tail +2' else: cmd = 'ps -ax -o pid,ppid | tail -n+2' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): ...
[ "def", "_ppid", "(", ")", ":", "ret", "=", "{", "}", "if", "__grains__", "[", "'kernel'", "]", "==", "'SunOS'", ":", "cmd", "=", "'ps -a -o pid,ppid | tail +2'", "else", ":", "cmd", "=", "'ps -ax -o pid,ppid | tail -n+2'", "out", "=", "__salt__", "[", "'cmd....
Return a dict of pid to ppid mappings
[ "Return", "a", "dict", "of", "pid", "to", "ppid", "mappings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L270-L283
37,330
saltstack/salt
salt/modules/network.py
_netstat_bsd
def _netstat_bsd(): ''' Return netstat information for BSD flavors ''' ret = [] if __grains__['kernel'] == 'NetBSD': for addr_family in ('inet', 'inet6'): cmd = 'netstat -f {0} -an | tail -n+3'.format(addr_family) out = __salt__['cmd.run'](cmd, python_shell=True) ...
python
def _netstat_bsd(): ''' Return netstat information for BSD flavors ''' ret = [] if __grains__['kernel'] == 'NetBSD': for addr_family in ('inet', 'inet6'): cmd = 'netstat -f {0} -an | tail -n+3'.format(addr_family) out = __salt__['cmd.run'](cmd, python_shell=True) ...
[ "def", "_netstat_bsd", "(", ")", ":", "ret", "=", "[", "]", "if", "__grains__", "[", "'kernel'", "]", "==", "'NetBSD'", ":", "for", "addr_family", "in", "(", "'inet'", ",", "'inet6'", ")", ":", "cmd", "=", "'netstat -f {0} -an | tail -n+3'", ".", "format",...
Return netstat information for BSD flavors
[ "Return", "netstat", "information", "for", "BSD", "flavors" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L286-L360
37,331
saltstack/salt
salt/modules/network.py
_netstat_route_freebsd
def _netstat_route_freebsd(): ''' Return netstat routing information for FreeBSD and macOS ''' ret = [] cmd = 'netstat -f inet -rn | tail -n+5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() if __grains__['os'] == 'FreeBSD...
python
def _netstat_route_freebsd(): ''' Return netstat routing information for FreeBSD and macOS ''' ret = [] cmd = 'netstat -f inet -rn | tail -n+5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() if __grains__['os'] == 'FreeBSD...
[ "def", "_netstat_route_freebsd", "(", ")", ":", "ret", "=", "[", "]", "cmd", "=", "'netstat -f inet -rn | tail -n+5'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "True", ")", "for", "line", "in", "out", ".", "split...
Return netstat routing information for FreeBSD and macOS
[ "Return", "netstat", "routing", "information", "for", "FreeBSD", "and", "macOS" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L580-L616
37,332
saltstack/salt
salt/modules/network.py
_netstat_route_netbsd
def _netstat_route_netbsd(): ''' Return netstat routing information for NetBSD ''' ret = [] cmd = 'netstat -f inet -rn | tail -n+5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() ret.append({ 'addr_family': 'in...
python
def _netstat_route_netbsd(): ''' Return netstat routing information for NetBSD ''' ret = [] cmd = 'netstat -f inet -rn | tail -n+5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() ret.append({ 'addr_family': 'in...
[ "def", "_netstat_route_netbsd", "(", ")", ":", "ret", "=", "[", "]", "cmd", "=", "'netstat -f inet -rn | tail -n+5'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "True", ")", "for", "line", "in", "out", ".", "splitl...
Return netstat routing information for NetBSD
[ "Return", "netstat", "routing", "information", "for", "NetBSD" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L619-L646
37,333
saltstack/salt
salt/modules/network.py
_netstat_route_sunos
def _netstat_route_sunos(): ''' Return netstat routing information for SunOS ''' ret = [] cmd = 'netstat -f inet -rn | tail +5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() ret.append({ 'addr_family': 'inet',...
python
def _netstat_route_sunos(): ''' Return netstat routing information for SunOS ''' ret = [] cmd = 'netstat -f inet -rn | tail +5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() ret.append({ 'addr_family': 'inet',...
[ "def", "_netstat_route_sunos", "(", ")", ":", "ret", "=", "[", "]", "cmd", "=", "'netstat -f inet -rn | tail +5'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "True", ")", "for", "line", "in", "out", ".", "splitline...
Return netstat routing information for SunOS
[ "Return", "netstat", "routing", "information", "for", "SunOS" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L679-L706
37,334
saltstack/salt
salt/modules/network.py
arp
def arp(): ''' Return the arp table from the minion .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.arp ''' ret = {} out = __salt__['cmd.run']('arp -an') for line in out.splitlines(): comps = line.spl...
python
def arp(): ''' Return the arp table from the minion .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.arp ''' ret = {} out = __salt__['cmd.run']('arp -an') for line in out.splitlines(): comps = line.spl...
[ "def", "arp", "(", ")", ":", "ret", "=", "{", "}", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'arp -an'", ")", "for", "line", "in", "out", ".", "splitlines", "(", ")", ":", "comps", "=", "line", ".", "split", "(", ")", "if", "len", "(...
Return the arp table from the minion .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.arp
[ "Return", "the", "arp", "table", "from", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L975-L1009
37,335
saltstack/salt
salt/modules/network.py
convert_cidr
def convert_cidr(cidr): ''' returns the network address, subnet mask and broadcast address of a cidr address .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' network.convert_cidr 172.31.0.0/16 ''' ret = {'network': None, 'netmask': None, ...
python
def convert_cidr(cidr): ''' returns the network address, subnet mask and broadcast address of a cidr address .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' network.convert_cidr 172.31.0.0/16 ''' ret = {'network': None, 'netmask': None, ...
[ "def", "convert_cidr", "(", "cidr", ")", ":", "ret", "=", "{", "'network'", ":", "None", ",", "'netmask'", ":", "None", ",", "'broadcast'", ":", "None", "}", "cidr", "=", "calc_net", "(", "cidr", ")", "network_info", "=", "ipaddress", ".", "ip_network", ...
returns the network address, subnet mask and broadcast address of a cidr address .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' network.convert_cidr 172.31.0.0/16
[ "returns", "the", "network", "address", "subnet", "mask", "and", "broadcast", "address", "of", "a", "cidr", "address" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1125-L1145
37,336
saltstack/salt
salt/modules/network.py
_get_bufsize_linux
def _get_bufsize_linux(iface): ''' Return network interface buffer information using ethtool ''' ret = {'result': False} cmd = '/sbin/ethtool -g {0}'.format(iface) out = __salt__['cmd.run'](cmd) pat = re.compile(r'^(.+):\s+(\d+)$') suffix = 'max-' for line in out.splitlines(): ...
python
def _get_bufsize_linux(iface): ''' Return network interface buffer information using ethtool ''' ret = {'result': False} cmd = '/sbin/ethtool -g {0}'.format(iface) out = __salt__['cmd.run'](cmd) pat = re.compile(r'^(.+):\s+(\d+)$') suffix = 'max-' for line in out.splitlines(): ...
[ "def", "_get_bufsize_linux", "(", "iface", ")", ":", "ret", "=", "{", "'result'", ":", "False", "}", "cmd", "=", "'/sbin/ethtool -g {0}'", ".", "format", "(", "iface", ")", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "pat", "=", "re...
Return network interface buffer information using ethtool
[ "Return", "network", "interface", "buffer", "information", "using", "ethtool" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1524-L1549
37,337
saltstack/salt
salt/modules/network.py
_mod_bufsize_linux
def _mod_bufsize_linux(iface, *args, **kwargs): ''' Modify network interface buffer sizes using ethtool ''' ret = {'result': False, 'comment': 'Requires rx=<val> tx==<val> rx-mini=<val> and/or rx-jumbo=<val>'} cmd = '/sbin/ethtool -G ' + iface if not kwargs: return ret if ...
python
def _mod_bufsize_linux(iface, *args, **kwargs): ''' Modify network interface buffer sizes using ethtool ''' ret = {'result': False, 'comment': 'Requires rx=<val> tx==<val> rx-mini=<val> and/or rx-jumbo=<val>'} cmd = '/sbin/ethtool -G ' + iface if not kwargs: return ret if ...
[ "def", "_mod_bufsize_linux", "(", "iface", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'result'", ":", "False", ",", "'comment'", ":", "'Requires rx=<val> tx==<val> rx-mini=<val> and/or rx-jumbo=<val>'", "}", "cmd", "=", "'/sbin/ethtool ...
Modify network interface buffer sizes using ethtool
[ "Modify", "network", "interface", "buffer", "sizes", "using", "ethtool" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1569-L1596
37,338
saltstack/salt
salt/modules/network.py
routes
def routes(family=None): ''' Return currently configured routes from routing table .. versionchanged:: 2015.8.0 Added support for SunOS (Solaris 10, Illumos, SmartOS) .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' netwo...
python
def routes(family=None): ''' Return currently configured routes from routing table .. versionchanged:: 2015.8.0 Added support for SunOS (Solaris 10, Illumos, SmartOS) .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' netwo...
[ "def", "routes", "(", "family", "=", "None", ")", ":", "if", "family", "!=", "'inet'", "and", "family", "!=", "'inet6'", "and", "family", "is", "not", "None", ":", "raise", "CommandExecutionError", "(", "'Invalid address family {0}'", ".", "format", "(", "fa...
Return currently configured routes from routing table .. versionchanged:: 2015.8.0 Added support for SunOS (Solaris 10, Illumos, SmartOS) .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' network.routes
[ "Return", "currently", "configured", "routes", "from", "routing", "table" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1616-L1657
37,339
saltstack/salt
salt/modules/network.py
ifacestartswith
def ifacestartswith(cidr): ''' Retrieve the interface name from a specific CIDR .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.ifacestartswith 10.0 ''' net_list = interfaces() intfnames = [] pattern = six.text_type(cidr) size = len(patt...
python
def ifacestartswith(cidr): ''' Retrieve the interface name from a specific CIDR .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.ifacestartswith 10.0 ''' net_list = interfaces() intfnames = [] pattern = six.text_type(cidr) size = len(patt...
[ "def", "ifacestartswith", "(", "cidr", ")", ":", "net_list", "=", "interfaces", "(", ")", "intfnames", "=", "[", "]", "pattern", "=", "six", ".", "text_type", "(", "cidr", ")", "size", "=", "len", "(", "pattern", ")", "for", "ifname", ",", "ifval", "...
Retrieve the interface name from a specific CIDR .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.ifacestartswith 10.0
[ "Retrieve", "the", "interface", "name", "from", "a", "specific", "CIDR" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1842-L1866
37,340
saltstack/salt
salt/modules/network.py
iphexval
def iphexval(ip): ''' Retrieve the hexadecimal representation of an IP address .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.iphexval 10.0.0.1 ''' a = ip.split('.') hexval = ['%02X' % int(x) for x in a] # pylint: disable=E1321 return ''.j...
python
def iphexval(ip): ''' Retrieve the hexadecimal representation of an IP address .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.iphexval 10.0.0.1 ''' a = ip.split('.') hexval = ['%02X' % int(x) for x in a] # pylint: disable=E1321 return ''.j...
[ "def", "iphexval", "(", "ip", ")", ":", "a", "=", "ip", ".", "split", "(", "'.'", ")", "hexval", "=", "[", "'%02X'", "%", "int", "(", "x", ")", "for", "x", "in", "a", "]", "# pylint: disable=E1321", "return", "''", ".", "join", "(", "hexval", ")"...
Retrieve the hexadecimal representation of an IP address .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.iphexval 10.0.0.1
[ "Retrieve", "the", "hexadecimal", "representation", "of", "an", "IP", "address" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1869-L1883
37,341
saltstack/salt
salt/states/boto_cloudwatch_event.py
absent
def absent(name, Name=None, region=None, key=None, keyid=None, profile=None): ''' Ensure CloudWatch event rule with passed properties is absent. name The name of the state definition. Name Name of the event rule. Defaults to the value of the 'name' param if not provided. ...
python
def absent(name, Name=None, region=None, key=None, keyid=None, profile=None): ''' Ensure CloudWatch event rule with passed properties is absent. name The name of the state definition. Name Name of the event rule. Defaults to the value of the 'name' param if not provided. ...
[ "def", "absent", "(", "name", ",", "Name", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "Name", ",", "'result'", ":", "True", ...
Ensure CloudWatch event rule with passed properties is absent. name The name of the state definition. Name Name of the event rule. Defaults to the value of the 'name' param if not provided. region Region to connect to. key Secret key to be used. keyid ...
[ "Ensure", "CloudWatch", "event", "rule", "with", "passed", "properties", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudwatch_event.py#L271-L352
37,342
saltstack/salt
salt/modules/libcloud_compute.py
list_nodes
def list_nodes(profile, **libcloud_kwargs): ''' Return a list of nodes :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_nodes method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt m...
python
def list_nodes(profile, **libcloud_kwargs): ''' Return a list of nodes :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_nodes method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt m...
[ "def", "list_nodes", "(", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "libcloud_kwarg...
Return a list of nodes :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_nodes method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list_nodes profile1
[ "Return", "a", "list", "of", "nodes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L93-L115
37,343
saltstack/salt
salt/modules/libcloud_compute.py
list_sizes
def list_sizes(profile, location_id=None, **libcloud_kwargs): ''' Return a list of node sizes :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments for the drive...
python
def list_sizes(profile, location_id=None, **libcloud_kwargs): ''' Return a list of node sizes :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments for the drive...
[ "def", "list_sizes", "(", "profile", ",", "location_id", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs...
Return a list of node sizes :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_sizes method :type libcloud_kwargs: ``dict`` CLI Exampl...
[ "Return", "a", "list", "of", "node", "sizes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L118-L152
37,344
saltstack/salt
salt/modules/libcloud_compute.py
list_locations
def list_locations(profile, **libcloud_kwargs): ''' Return a list of locations for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_locations method :type libcloud_kwargs: ``dict`` CLI Example: .. code-b...
python
def list_locations(profile, **libcloud_kwargs): ''' Return a list of locations for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_locations method :type libcloud_kwargs: ``dict`` CLI Example: .. code-b...
[ "def", "list_locations", "(", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "libcloud_k...
Return a list of locations for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_locations method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list_loc...
[ "Return", "a", "list", "of", "locations", "for", "this", "cloud" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L155-L178
37,345
saltstack/salt
salt/modules/libcloud_compute.py
reboot_node
def reboot_node(node_id, profile, **libcloud_kwargs): ''' Reboot a node in the cloud :param node_id: Unique ID of the node to reboot :type node_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's reboot_node method ...
python
def reboot_node(node_id, profile, **libcloud_kwargs): ''' Reboot a node in the cloud :param node_id: Unique ID of the node to reboot :type node_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's reboot_node method ...
[ "def", "reboot_node", "(", "node_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "node", "=", "_get_by_id", "(", "conn", ".", "list_nodes", "(", "*", "*", "libcloud_kwargs", ...
Reboot a node in the cloud :param node_id: Unique ID of the node to reboot :type node_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's reboot_node method :type libcloud_kwargs: ``dict`` CLI Example: .. cod...
[ "Reboot", "a", "node", "in", "the", "cloud" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L181-L202
37,346
saltstack/salt
salt/modules/libcloud_compute.py
list_volumes
def list_volumes(profile, **libcloud_kwargs): ''' Return a list of storage volumes for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_volumes method :type libcloud_kwargs: ``dict`` CLI Example: .. code...
python
def list_volumes(profile, **libcloud_kwargs): ''' Return a list of storage volumes for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_volumes method :type libcloud_kwargs: ``dict`` CLI Example: .. code...
[ "def", "list_volumes", "(", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "libcloud_kwa...
Return a list of storage volumes for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_volumes method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list...
[ "Return", "a", "list", "of", "storage", "volumes", "for", "this", "cloud" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L229-L252
37,347
saltstack/salt
salt/modules/libcloud_compute.py
list_volume_snapshots
def list_volume_snapshots(volume_id, profile, **libcloud_kwargs): ''' Return a list of storage volumes snapshots for this cloud :param volume_id: The volume identifier :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments...
python
def list_volume_snapshots(volume_id, profile, **libcloud_kwargs): ''' Return a list of storage volumes snapshots for this cloud :param volume_id: The volume identifier :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments...
[ "def", "list_volume_snapshots", "(", "volume_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "("...
Return a list of storage volumes snapshots for this cloud :param volume_id: The volume identifier :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_volume_snapshots method :type libcloud_kwargs: ``d...
[ "Return", "a", "list", "of", "storage", "volumes", "snapshots", "for", "this", "cloud" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L255-L282
37,348
saltstack/salt
salt/modules/libcloud_compute.py
create_volume
def create_volume(size, name, profile, location_id=None, **libcloud_kwargs): ''' Create a storage volume :param size: Size of volume in gigabytes (required) :type size: ``int`` :param name: Name of the volume to be created :type name: ``str`` :param location_id: Which data center to creat...
python
def create_volume(size, name, profile, location_id=None, **libcloud_kwargs): ''' Create a storage volume :param size: Size of volume in gigabytes (required) :type size: ``int`` :param name: Name of the volume to be created :type name: ``str`` :param location_id: Which data center to creat...
[ "def", "create_volume", "(", "size", ",", "name", ",", "profile", ",", "location_id", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ...
Create a storage volume :param size: Size of volume in gigabytes (required) :type size: ``int`` :param name: Name of the volume to be created :type name: ``str`` :param location_id: Which data center to create a volume in. If empty, undefined behavior will be selected....
[ "Create", "a", "storage", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L285-L321
37,349
saltstack/salt
salt/modules/libcloud_compute.py
create_volume_snapshot
def create_volume_snapshot(volume_id, profile, name=None, **libcloud_kwargs): ''' Create a storage volume snapshot :param volume_id: Volume ID from which to create the new snapshot. :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` ...
python
def create_volume_snapshot(volume_id, profile, name=None, **libcloud_kwargs): ''' Create a storage volume snapshot :param volume_id: Volume ID from which to create the new snapshot. :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` ...
[ "def", "create_volume_snapshot", "(", "volume_id", ",", "profile", ",", "name", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "ar...
Create a storage volume snapshot :param volume_id: Volume ID from which to create the new snapshot. :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param name: Name of the snapshot to be created (optional) :type name: ``str`` :p...
[ "Create", "a", "storage", "volume", "snapshot" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L324-L352
37,350
saltstack/salt
salt/modules/libcloud_compute.py
attach_volume
def attach_volume(node_id, volume_id, profile, device=None, **libcloud_kwargs): ''' Attaches volume to node. :param node_id: Node ID to target :type node_id: ``str`` :param volume_id: Volume ID from which to attach :type volume_id: ``str`` :param profile: The profile key :type pr...
python
def attach_volume(node_id, volume_id, profile, device=None, **libcloud_kwargs): ''' Attaches volume to node. :param node_id: Node ID to target :type node_id: ``str`` :param volume_id: Volume ID from which to attach :type volume_id: ``str`` :param profile: The profile key :type pr...
[ "def", "attach_volume", "(", "node_id", ",", "volume_id", ",", "profile", ",", "device", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils",...
Attaches volume to node. :param node_id: Node ID to target :type node_id: ``str`` :param volume_id: Volume ID from which to attach :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param device: Where the device is exposed, e.g. '/dev/sdb' :type de...
[ "Attaches", "volume", "to", "node", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L355-L384
37,351
saltstack/salt
salt/modules/libcloud_compute.py
detach_volume
def detach_volume(volume_id, profile, **libcloud_kwargs): ''' Detaches a volume from a node. :param volume_id: Volume ID from which to detach :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's detach_...
python
def detach_volume(volume_id, profile, **libcloud_kwargs): ''' Detaches a volume from a node. :param volume_id: Volume ID from which to detach :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's detach_...
[ "def", "detach_volume", "(", "volume_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*",...
Detaches a volume from a node. :param volume_id: Volume ID from which to detach :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's detach_volume method :type libcloud_kwargs: ``dict`` CLI Example: ...
[ "Detaches", "a", "volume", "from", "a", "node", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L387-L409
37,352
saltstack/salt
salt/modules/libcloud_compute.py
destroy_volume_snapshot
def destroy_volume_snapshot(volume_id, snapshot_id, profile, **libcloud_kwargs): ''' Destroy a volume snapshot. :param volume_id: Volume ID from which the snapshot belongs :type volume_id: ``str`` :param snapshot_id: Volume Snapshot ID from which to destroy :type snapshot_id: ``str`` ...
python
def destroy_volume_snapshot(volume_id, snapshot_id, profile, **libcloud_kwargs): ''' Destroy a volume snapshot. :param volume_id: Volume ID from which the snapshot belongs :type volume_id: ``str`` :param snapshot_id: Volume Snapshot ID from which to destroy :type snapshot_id: ``str`` ...
[ "def", "destroy_volume_snapshot", "(", "volume_id", ",", "snapshot_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", "....
Destroy a volume snapshot. :param volume_id: Volume ID from which the snapshot belongs :type volume_id: ``str`` :param snapshot_id: Volume Snapshot ID from which to destroy :type snapshot_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extr...
[ "Destroy", "a", "volume", "snapshot", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L437-L463
37,353
saltstack/salt
salt/modules/libcloud_compute.py
list_images
def list_images(profile, location_id=None, **libcloud_kwargs): ''' Return a list of images for this cloud :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments f...
python
def list_images(profile, location_id=None, **libcloud_kwargs): ''' Return a list of images for this cloud :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments f...
[ "def", "list_images", "(", "profile", ",", "location_id", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwarg...
Return a list of images for this cloud :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_images method :type libcloud_kwargs: ``dict`` ...
[ "Return", "a", "list", "of", "images", "for", "this", "cloud" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L466-L496
37,354
saltstack/salt
salt/modules/libcloud_compute.py
create_image
def create_image(node_id, name, profile, description=None, **libcloud_kwargs): ''' Create an image from a node :param node_id: Node to run the task on. :type node_id: ``str`` :param name: name for new image. :type name: ``str`` :param profile: The profile key :type profile: ``str`` ...
python
def create_image(node_id, name, profile, description=None, **libcloud_kwargs): ''' Create an image from a node :param node_id: Node to run the task on. :type node_id: ``str`` :param name: name for new image. :type name: ``str`` :param profile: The profile key :type profile: ``str`` ...
[ "def", "create_image", "(", "node_id", ",", "name", ",", "profile", ",", "description", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ...
Create an image from a node :param node_id: Node to run the task on. :type node_id: ``str`` :param name: name for new image. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param description: description for new image. :type description: ``description`` ...
[ "Create", "an", "image", "from", "a", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L499-L528
37,355
saltstack/salt
salt/modules/libcloud_compute.py
delete_image
def delete_image(image_id, profile, **libcloud_kwargs): ''' Delete an image of a node :param image_id: Image to delete :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type li...
python
def delete_image(image_id, profile, **libcloud_kwargs): ''' Delete an image of a node :param image_id: Image to delete :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type li...
[ "def", "delete_image", "(", "image_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", ...
Delete an image of a node :param image_id: Image to delete :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash ...
[ "Delete", "an", "image", "of", "a", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L531-L553
37,356
saltstack/salt
salt/modules/libcloud_compute.py
get_image
def get_image(image_id, profile, **libcloud_kwargs): ''' Get an image of a node :param image_id: Image to fetch :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type libcloud_...
python
def get_image(image_id, profile, **libcloud_kwargs): ''' Get an image of a node :param image_id: Image to fetch :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type libcloud_...
[ "def", "get_image", "(", "image_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*...
Get an image of a node :param image_id: Image to fetch :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash ...
[ "Get", "an", "image", "of", "a", "node" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L556-L578
37,357
saltstack/salt
salt/modules/libcloud_compute.py
copy_image
def copy_image(source_region, image_id, name, profile, description=None, **libcloud_kwargs): ''' Copies an image from a source region to the current region. :param source_region: Region to copy the node from. :type source_region: ``str`` :param image_id: Image to copy. :type image_id: ``str`` ...
python
def copy_image(source_region, image_id, name, profile, description=None, **libcloud_kwargs): ''' Copies an image from a source region to the current region. :param source_region: Region to copy the node from. :type source_region: ``str`` :param image_id: Image to copy. :type image_id: ``str`` ...
[ "def", "copy_image", "(", "source_region", ",", "image_id", ",", "name", ",", "profile", ",", "description", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "...
Copies an image from a source region to the current region. :param source_region: Region to copy the node from. :type source_region: ``str`` :param image_id: Image to copy. :type image_id: ``str`` :param name: name for new image. :type name: ``str`` :param profile: The profile key :t...
[ "Copies", "an", "image", "from", "a", "source", "region", "to", "the", "current", "region", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L581-L614
37,358
saltstack/salt
salt/modules/libcloud_compute.py
list_key_pairs
def list_key_pairs(profile, **libcloud_kwargs): ''' List all the available key pair objects. :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_key_pairs method :type libcloud_kwargs: ``dict`` CLI Example: .. code-bl...
python
def list_key_pairs(profile, **libcloud_kwargs): ''' List all the available key pair objects. :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_key_pairs method :type libcloud_kwargs: ``dict`` CLI Example: .. code-bl...
[ "def", "list_key_pairs", "(", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "libcloud_k...
List all the available key pair objects. :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_key_pairs method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list_key_...
[ "List", "all", "the", "available", "key", "pair", "objects", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L617-L640
37,359
saltstack/salt
salt/modules/libcloud_compute.py
get_key_pair
def get_key_pair(name, profile, **libcloud_kwargs): ''' Get a single key pair by name :param name: Name of the key pair to retrieve. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's get_key_pair method ...
python
def get_key_pair(name, profile, **libcloud_kwargs): ''' Get a single key pair by name :param name: Name of the key pair to retrieve. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's get_key_pair method ...
[ "def", "get_key_pair", "(", "name", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*"...
Get a single key pair by name :param name: Name of the key pair to retrieve. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's get_key_pair method :type libcloud_kwargs: ``dict`` CLI Example: .. code...
[ "Get", "a", "single", "key", "pair", "by", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L643-L664
37,360
saltstack/salt
salt/modules/libcloud_compute.py
import_key_pair
def import_key_pair(name, key, profile, key_type=None, **libcloud_kwargs): ''' Import a new public key from string or a file path :param name: Key pair name. :type name: ``str`` :param key: Public key material, the string or a path to a file :type key: ``str`` or path ``str`` :param prof...
python
def import_key_pair(name, key, profile, key_type=None, **libcloud_kwargs): ''' Import a new public key from string or a file path :param name: Key pair name. :type name: ``str`` :param key: Public key material, the string or a path to a file :type key: ``str`` or path ``str`` :param prof...
[ "def", "import_key_pair", "(", "name", ",", "key", ",", "profile", ",", "key_type", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", "....
Import a new public key from string or a file path :param name: Key pair name. :type name: ``str`` :param key: Public key material, the string or a path to a file :type key: ``str`` or path ``str`` :param profile: The profile key :type profile: ``str`` :param key_type: The key pair typ...
[ "Import", "a", "new", "public", "key", "from", "string", "or", "a", "file", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L691-L727
37,361
saltstack/salt
salt/modules/libcloud_compute.py
delete_key_pair
def delete_key_pair(name, profile, **libcloud_kwargs): ''' Delete a key pair :param name: Key pair name. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's import_key_pair_from_xxx method :type libclou...
python
def delete_key_pair(name, profile, **libcloud_kwargs): ''' Delete a key pair :param name: Key pair name. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's import_key_pair_from_xxx method :type libclou...
[ "def", "delete_key_pair", "(", "name", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "libcloud_kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", ...
Delete a key pair :param name: Key pair name. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's import_key_pair_from_xxx method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash ...
[ "Delete", "a", "key", "pair" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L730-L752
37,362
saltstack/salt
salt/modules/libcloud_compute.py
_get_by_id
def _get_by_id(collection, id): ''' Get item from a list by the id field ''' matches = [item for item in collection if item.id == id] if not matches: raise ValueError('Could not find a matching item') elif len(matches) > 1: raise ValueError('The id matched {0} items, not 1'.forma...
python
def _get_by_id(collection, id): ''' Get item from a list by the id field ''' matches = [item for item in collection if item.id == id] if not matches: raise ValueError('Could not find a matching item') elif len(matches) > 1: raise ValueError('The id matched {0} items, not 1'.forma...
[ "def", "_get_by_id", "(", "collection", ",", "id", ")", ":", "matches", "=", "[", "item", "for", "item", "in", "collection", "if", "item", ".", "id", "==", "id", "]", "if", "not", "matches", ":", "raise", "ValueError", "(", "'Could not find a matching item...
Get item from a list by the id field
[ "Get", "item", "from", "a", "list", "by", "the", "id", "field" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L780-L789
37,363
saltstack/salt
salt/states/monit.py
monitor
def monitor(name): ''' Get the summary from module monit and try to see if service is being monitored. If not then monitor the service. ''' ret = {'result': None, 'name': name, 'comment': '', 'changes': {} } result = __salt__['monit.summary'](name) ...
python
def monitor(name): ''' Get the summary from module monit and try to see if service is being monitored. If not then monitor the service. ''' ret = {'result': None, 'name': name, 'comment': '', 'changes': {} } result = __salt__['monit.summary'](name) ...
[ "def", "monitor", "(", "name", ")", ":", "ret", "=", "{", "'result'", ":", "None", ",", "'name'", ":", "name", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "result", "=", "__salt__", "[", "'monit.summary'", "]", "(", "name", "...
Get the summary from module monit and try to see if service is being monitored. If not then monitor the service.
[ "Get", "the", "summary", "from", "module", "monit", "and", "try", "to", "see", "if", "service", "is", "being", "monitored", ".", "If", "not", "then", "monitor", "the", "service", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/monit.py#L34-L65
37,364
saltstack/salt
salt/modules/jboss7.py
status
def status(jboss_config, host=None, server_config=None): ''' Get status of running jboss instance. jboss_config Configuration dictionary with properties specified above. host The name of the host. JBoss domain mode only - and required if running in domain mode. The host name is ...
python
def status(jboss_config, host=None, server_config=None): ''' Get status of running jboss instance. jboss_config Configuration dictionary with properties specified above. host The name of the host. JBoss domain mode only - and required if running in domain mode. The host name is ...
[ "def", "status", "(", "jboss_config", ",", "host", "=", "None", ",", "server_config", "=", "None", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.status\"", ")", "if", "host", "is", "None", "and", "server_config", "is", "...
Get status of running jboss instance. jboss_config Configuration dictionary with properties specified above. host The name of the host. JBoss domain mode only - and required if running in domain mode. The host name is the "name" attribute of the "host" element in host.xml server_con...
[ "Get", "status", "of", "running", "jboss", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L44-L73
37,365
saltstack/salt
salt/modules/jboss7.py
create_datasource
def create_datasource(jboss_config, name, datasource_properties, profile=None): ''' Create datasource in running jboss instance jboss_config Configuration dictionary with properties specified above. name Datasource name datasource_properties A dictionary of datasource proper...
python
def create_datasource(jboss_config, name, datasource_properties, profile=None): ''' Create datasource in running jboss instance jboss_config Configuration dictionary with properties specified above. name Datasource name datasource_properties A dictionary of datasource proper...
[ "def", "create_datasource", "(", "jboss_config", ",", "name", ",", "datasource_properties", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.create_datasource, name=%s, profile=%s\"", ",", "name", ",", "p...
Create datasource in running jboss instance jboss_config Configuration dictionary with properties specified above. name Datasource name datasource_properties A dictionary of datasource properties to be created: - driver-name: mysql - connection-url: 'jdbc:mysql:/...
[ "Create", "datasource", "in", "running", "jboss", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L138-L174
37,366
saltstack/salt
salt/modules/jboss7.py
update_datasource
def update_datasource(jboss_config, name, new_properties, profile=None): ''' Update an existing datasource in running jboss instance. If the property doesn't exist if will be created, if it does, it will be updated with the new value jboss_config Configuration dictionary with properties specifi...
python
def update_datasource(jboss_config, name, new_properties, profile=None): ''' Update an existing datasource in running jboss instance. If the property doesn't exist if will be created, if it does, it will be updated with the new value jboss_config Configuration dictionary with properties specifi...
[ "def", "update_datasource", "(", "jboss_config", ",", "name", ",", "new_properties", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.update_datasource, name=%s, profile=%s\"", ",", "name", ",", "profile"...
Update an existing datasource in running jboss instance. If the property doesn't exist if will be created, if it does, it will be updated with the new value jboss_config Configuration dictionary with properties specified above. name Datasource name new_properties A dictionary of...
[ "Update", "an", "existing", "datasource", "in", "running", "jboss", "instance", ".", "If", "the", "property", "doesn", "t", "exist", "if", "will", "be", "created", "if", "it", "does", "it", "will", "be", "updated", "with", "the", "new", "value" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L211-L258
37,367
saltstack/salt
salt/modules/jboss7.py
read_datasource
def read_datasource(jboss_config, name, profile=None): ''' Read datasource properties in the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile Profile name (JBoss domain mode only) CLI Example: ...
python
def read_datasource(jboss_config, name, profile=None): ''' Read datasource properties in the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile Profile name (JBoss domain mode only) CLI Example: ...
[ "def", "read_datasource", "(", "jboss_config", ",", "name", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.read_datasource, name=%s\"", ",", "name", ")", "return", "__read_datasource", "(", "jboss_con...
Read datasource properties in the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile Profile name (JBoss domain mode only) CLI Example: .. code-block:: bash salt '*' jboss7.read_datasource '{...
[ "Read", "datasource", "properties", "in", "the", "running", "jboss", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L272-L290
37,368
saltstack/salt
salt/modules/jboss7.py
create_simple_binding
def create_simple_binding(jboss_config, binding_name, value, profile=None): ''' Create a simple jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created value Binding value p...
python
def create_simple_binding(jboss_config, binding_name, value, profile=None): ''' Create a simple jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created value Binding value p...
[ "def", "create_simple_binding", "(", "jboss_config", ",", "binding_name", ",", "value", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.create_simple_binding, binding_name=%s, value=%s, profile=%s\"", ",", "...
Create a simple jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created value Binding value profile The profile name (JBoss domain mode only) CLI Example: .. code-...
[ "Create", "a", "simple", "jndi", "binding", "in", "the", "running", "jboss", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L293-L322
37,369
saltstack/salt
salt/modules/jboss7.py
read_simple_binding
def read_simple_binding(jboss_config, binding_name, profile=None): ''' Read jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created profile The profile name (JBoss domain mode o...
python
def read_simple_binding(jboss_config, binding_name, profile=None): ''' Read jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created profile The profile name (JBoss domain mode o...
[ "def", "read_simple_binding", "(", "jboss_config", ",", "binding_name", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.read_simple_binding, %s\"", ",", "binding_name", ")", "return", "__read_simple_bindin...
Read jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created profile The profile name (JBoss domain mode only) CLI Example: .. code-block:: bash salt '*' jboss7.r...
[ "Read", "jndi", "binding", "in", "the", "running", "jboss", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L354-L372
37,370
saltstack/salt
salt/modules/jboss7.py
remove_datasource
def remove_datasource(jboss_config, name, profile=None): ''' Remove an existing datasource from the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile The profile (JBoss domain mode only) CLI Examp...
python
def remove_datasource(jboss_config, name, profile=None): ''' Remove an existing datasource from the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile The profile (JBoss domain mode only) CLI Examp...
[ "def", "remove_datasource", "(", "jboss_config", ",", "name", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.remove_datasource, name=%s, profile=%s\"", ",", "name", ",", "profile", ")", "operation", "...
Remove an existing datasource from the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile The profile (JBoss domain mode only) CLI Example: .. code-block:: bash salt '*' jboss7.remove_datasou...
[ "Remove", "an", "existing", "datasource", "from", "the", "running", "jboss", "instance", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L414-L437
37,371
saltstack/salt
salt/modules/jboss7.py
deploy
def deploy(jboss_config, source_file): ''' Deploy the application on the jboss instance from the local file system where minion is running. jboss_config Configuration dictionary with properties specified above. source_file Source file to deploy from CLI Example: .. code-block:...
python
def deploy(jboss_config, source_file): ''' Deploy the application on the jboss instance from the local file system where minion is running. jboss_config Configuration dictionary with properties specified above. source_file Source file to deploy from CLI Example: .. code-block:...
[ "def", "deploy", "(", "jboss_config", ",", "source_file", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.deploy, source_file=%s\"", ",", "source_file", ")", "command", "=", "'deploy {source_file} --force '", ".", "format", "(", "so...
Deploy the application on the jboss instance from the local file system where minion is running. jboss_config Configuration dictionary with properties specified above. source_file Source file to deploy from CLI Example: .. code-block:: bash salt '*' jboss7.deploy '{"cli_path"...
[ "Deploy", "the", "application", "on", "the", "jboss", "instance", "from", "the", "local", "file", "system", "where", "minion", "is", "running", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L440-L457
37,372
saltstack/salt
salt/modules/jboss7.py
list_deployments
def list_deployments(jboss_config): ''' List all deployments on the jboss instance jboss_config Configuration dictionary with properties specified above. CLI Example: .. code-block:: bash salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest....
python
def list_deployments(jboss_config): ''' List all deployments on the jboss instance jboss_config Configuration dictionary with properties specified above. CLI Example: .. code-block:: bash salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest....
[ "def", "list_deployments", "(", "jboss_config", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.list_deployments\"", ")", "command_result", "=", "__salt__", "[", "'jboss7_cli.run_command'", "]", "(", "jboss_config", ",", "'deploy'", ...
List all deployments on the jboss instance jboss_config Configuration dictionary with properties specified above. CLI Example: .. code-block:: bash salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:999...
[ "List", "all", "deployments", "on", "the", "jboss", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L460-L480
37,373
saltstack/salt
salt/modules/jboss7.py
undeploy
def undeploy(jboss_config, deployment): ''' Undeploy the application from jboss instance jboss_config Configuration dictionary with properties specified above. deployment Deployment name to undeploy CLI Example: .. code-block:: bash salt '*' jboss7.undeploy '{"cli_pat...
python
def undeploy(jboss_config, deployment): ''' Undeploy the application from jboss instance jboss_config Configuration dictionary with properties specified above. deployment Deployment name to undeploy CLI Example: .. code-block:: bash salt '*' jboss7.undeploy '{"cli_pat...
[ "def", "undeploy", "(", "jboss_config", ",", "deployment", ")", ":", "log", ".", "debug", "(", "\"======================== MODULE FUNCTION: jboss7.undeploy, deployment=%s\"", ",", "deployment", ")", "command", "=", "'undeploy {deployment} '", ".", "format", "(", "deployme...
Undeploy the application from jboss instance jboss_config Configuration dictionary with properties specified above. deployment Deployment name to undeploy CLI Example: .. code-block:: bash salt '*' jboss7.undeploy '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_v...
[ "Undeploy", "the", "application", "from", "jboss", "instance" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L483-L500
37,374
saltstack/salt
salt/utils/timeutil.py
get_timestamp_at
def get_timestamp_at(time_in=None, time_at=None): ''' Computes the timestamp for a future event that may occur in ``time_in`` time or at ``time_at``. ''' if time_in: if isinstance(time_in, int): hours = 0 minutes = time_in else: time_in = time_in.r...
python
def get_timestamp_at(time_in=None, time_at=None): ''' Computes the timestamp for a future event that may occur in ``time_in`` time or at ``time_at``. ''' if time_in: if isinstance(time_in, int): hours = 0 minutes = time_in else: time_in = time_in.r...
[ "def", "get_timestamp_at", "(", "time_in", "=", "None", ",", "time_at", "=", "None", ")", ":", "if", "time_in", ":", "if", "isinstance", "(", "time_in", ",", "int", ")", ":", "hours", "=", "0", "minutes", "=", "time_in", "else", ":", "time_in", "=", ...
Computes the timestamp for a future event that may occur in ``time_in`` time or at ``time_at``.
[ "Computes", "the", "timestamp", "for", "a", "future", "event", "that", "may", "occur", "in", "time_in", "time", "or", "at", "time_at", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/timeutil.py#L18-L66
37,375
saltstack/salt
salt/utils/timeutil.py
get_time_at
def get_time_at(time_in=None, time_at=None, out_fmt='%Y-%m-%dT%H:%M:%S'): ''' Return the time in human readable format for a future event that may occur in ``time_in`` time, or at ``time_at``. ''' dt = get_timestamp_at(time_in=time_in, time_at=time_at) return time.strftime(out_fmt, time.localtim...
python
def get_time_at(time_in=None, time_at=None, out_fmt='%Y-%m-%dT%H:%M:%S'): ''' Return the time in human readable format for a future event that may occur in ``time_in`` time, or at ``time_at``. ''' dt = get_timestamp_at(time_in=time_in, time_at=time_at) return time.strftime(out_fmt, time.localtim...
[ "def", "get_time_at", "(", "time_in", "=", "None", ",", "time_at", "=", "None", ",", "out_fmt", "=", "'%Y-%m-%dT%H:%M:%S'", ")", ":", "dt", "=", "get_timestamp_at", "(", "time_in", "=", "time_in", ",", "time_at", "=", "time_at", ")", "return", "time", ".",...
Return the time in human readable format for a future event that may occur in ``time_in`` time, or at ``time_at``.
[ "Return", "the", "time", "in", "human", "readable", "format", "for", "a", "future", "event", "that", "may", "occur", "in", "time_in", "time", "or", "at", "time_at", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/timeutil.py#L69-L75
37,376
saltstack/salt
salt/states/archive.py
_path_is_abs
def _path_is_abs(path): ''' Return a bool telling whether or ``path`` is absolute. If ``path`` is None, return ``True``. This function is designed to validate variables which optionally contain a file path. ''' if path is None: return True try: return os.path.isabs(path) ...
python
def _path_is_abs(path): ''' Return a bool telling whether or ``path`` is absolute. If ``path`` is None, return ``True``. This function is designed to validate variables which optionally contain a file path. ''' if path is None: return True try: return os.path.isabs(path) ...
[ "def", "_path_is_abs", "(", "path", ")", ":", "if", "path", "is", "None", ":", "return", "True", "try", ":", "return", "os", ".", "path", ".", "isabs", "(", "path", ")", "except", "AttributeError", ":", "# Non-string data passed", "return", "False" ]
Return a bool telling whether or ``path`` is absolute. If ``path`` is None, return ``True``. This function is designed to validate variables which optionally contain a file path.
[ "Return", "a", "bool", "telling", "whether", "or", "path", "is", "absolute", ".", "If", "path", "is", "None", "return", "True", ".", "This", "function", "is", "designed", "to", "validate", "variables", "which", "optionally", "contain", "a", "file", "path", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/archive.py#L37-L49
37,377
saltstack/salt
salt/modules/win_firewall.py
get_config
def get_config(): ''' Get the status of all the firewall profiles Returns: dict: A dictionary of all profiles on the system Raises: CommandExecutionError: If the command fails CLI Example: .. code-block:: bash salt '*' firewall.get_config ''' profiles = {} ...
python
def get_config(): ''' Get the status of all the firewall profiles Returns: dict: A dictionary of all profiles on the system Raises: CommandExecutionError: If the command fails CLI Example: .. code-block:: bash salt '*' firewall.get_config ''' profiles = {} ...
[ "def", "get_config", "(", ")", ":", "profiles", "=", "{", "}", "curr", "=", "None", "cmd", "=", "[", "'netsh'", ",", "'advfirewall'", ",", "'show'", ",", "'allprofiles'", "]", "ret", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_...
Get the status of all the firewall profiles Returns: dict: A dictionary of all profiles on the system Raises: CommandExecutionError: If the command fails CLI Example: .. code-block:: bash salt '*' firewall.get_config
[ "Get", "the", "status", "of", "all", "the", "firewall", "profiles" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L29-L65
37,378
saltstack/salt
salt/modules/win_firewall.py
set_logging_settings
def set_logging_settings(profile, setting, value, store='local'): r''' Configure logging settings for the Windows firewall. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to configure. Valid options are: - domain ...
python
def set_logging_settings(profile, setting, value, store='local'): r''' Configure logging settings for the Windows firewall. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to configure. Valid options are: - domain ...
[ "def", "set_logging_settings", "(", "profile", ",", "setting", ",", "value", ",", "store", "=", "'local'", ")", ":", "return", "salt", ".", "utils", ".", "win_lgpo_netsh", ".", "set_logging_settings", "(", "profile", "=", "profile", ",", "setting", "=", "set...
r''' Configure logging settings for the Windows firewall. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to configure. Valid options are: - domain - public - private setting (str): ...
[ "r", "Configure", "logging", "settings", "for", "the", "Windows", "firewall", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L562-L653
37,379
saltstack/salt
salt/utils/templates.py
_get_jinja_error
def _get_jinja_error(trace, context=None): ''' Return the error line and error message output from a stacktrace. If we are in a macro, also output inside the message the exact location of the error in the macro ''' if not context: context = {} out = '' error = _get_jinja_erro...
python
def _get_jinja_error(trace, context=None): ''' Return the error line and error message output from a stacktrace. If we are in a macro, also output inside the message the exact location of the error in the macro ''' if not context: context = {} out = '' error = _get_jinja_erro...
[ "def", "_get_jinja_error", "(", "trace", ",", "context", "=", "None", ")", ":", "if", "not", "context", ":", "context", "=", "{", "}", "out", "=", "''", "error", "=", "_get_jinja_error_slug", "(", "trace", ")", "line", "=", "_get_jinja_error_line", "(", ...
Return the error line and error message output from a stacktrace. If we are in a macro, also output inside the message the exact location of the error in the macro
[ "Return", "the", "error", "line", "and", "error", "message", "output", "from", "a", "stacktrace", ".", "If", "we", "are", "in", "a", "macro", "also", "output", "inside", "the", "message", "the", "exact", "location", "of", "the", "error", "in", "the", "ma...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/templates.py#L237-L287
37,380
saltstack/salt
salt/utils/templates.py
py
def py(sfn, string=False, **kwargs): # pylint: disable=C0103 ''' Render a template from a python source file Returns:: {'result': bool, 'data': <Error data or rendered file path>} ''' if not os.path.isfile(sfn): return {} base_fname = os.path.basename(sfn) name =...
python
def py(sfn, string=False, **kwargs): # pylint: disable=C0103 ''' Render a template from a python source file Returns:: {'result': bool, 'data': <Error data or rendered file path>} ''' if not os.path.isfile(sfn): return {} base_fname = os.path.basename(sfn) name =...
[ "def", "py", "(", "sfn", ",", "string", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=C0103", "if", "not", "os", ".", "path", ".", "isfile", "(", "sfn", ")", ":", "return", "{", "}", "base_fname", "=", "os", ".", "path", ".", ...
Render a template from a python source file Returns:: {'result': bool, 'data': <Error data or rendered file path>}
[ "Render", "a", "template", "from", "a", "python", "source", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/templates.py#L525-L577
37,381
saltstack/salt
salt/modules/namecheap_users.py
check_balances
def check_balances(minimum=100): ''' Checks if the provided minimum value is present in the user's account. Returns a boolean. Returns ``False`` if the user's account balance is less than the provided minimum or ``True`` if greater than the minimum. minimum : 100 The value to check CL...
python
def check_balances(minimum=100): ''' Checks if the provided minimum value is present in the user's account. Returns a boolean. Returns ``False`` if the user's account balance is less than the provided minimum or ``True`` if greater than the minimum. minimum : 100 The value to check CL...
[ "def", "check_balances", "(", "minimum", "=", "100", ")", ":", "min_float", "=", "float", "(", "minimum", ")", "result", "=", "get_balances", "(", ")", "if", "result", "[", "'accountbalance'", "]", "<=", "min_float", ":", "return", "False", "return", "True...
Checks if the provided minimum value is present in the user's account. Returns a boolean. Returns ``False`` if the user's account balance is less than the provided minimum or ``True`` if greater than the minimum. minimum : 100 The value to check CLI Example: .. code-block:: bash ...
[ "Checks", "if", "the", "provided", "minimum", "value", "is", "present", "in", "the", "user", "s", "account", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_users.py#L77-L99
37,382
saltstack/salt
salt/transport/zeromq.py
_set_tcp_keepalive
def _set_tcp_keepalive(zmq_socket, opts): ''' Ensure that TCP keepalives are set as specified in "opts". Warning: Failure to set TCP keepalives on the salt-master can result in not detecting the loss of a minion when the connection is lost or when it's host has been terminated without first closing...
python
def _set_tcp_keepalive(zmq_socket, opts): ''' Ensure that TCP keepalives are set as specified in "opts". Warning: Failure to set TCP keepalives on the salt-master can result in not detecting the loss of a minion when the connection is lost or when it's host has been terminated without first closing...
[ "def", "_set_tcp_keepalive", "(", "zmq_socket", ",", "opts", ")", ":", "if", "hasattr", "(", "zmq", ",", "'TCP_KEEPALIVE'", ")", "and", "opts", ":", "if", "'tcp_keepalive'", "in", "opts", ":", "zmq_socket", ".", "setsockopt", "(", "zmq", ".", "TCP_KEEPALIVE"...
Ensure that TCP keepalives are set as specified in "opts". Warning: Failure to set TCP keepalives on the salt-master can result in not detecting the loss of a minion when the connection is lost or when it's host has been terminated without first closing the socket. Salt's Presence System depends on thi...
[ "Ensure", "that", "TCP", "keepalives", "are", "set", "as", "specified", "in", "opts", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L800-L829
37,383
saltstack/salt
salt/transport/zeromq.py
AsyncZeroMQReqChannel._uncrypted_transfer
def _uncrypted_transfer(self, load, tries=3, timeout=60): ''' Send a load across the wire in cleartext :param dict load: A load to send across the wire :param int tries: The number of times to make before failure :param int timeout: The number of seconds on a response before fai...
python
def _uncrypted_transfer(self, load, tries=3, timeout=60): ''' Send a load across the wire in cleartext :param dict load: A load to send across the wire :param int tries: The number of times to make before failure :param int timeout: The number of seconds on a response before fai...
[ "def", "_uncrypted_transfer", "(", "self", ",", "load", ",", "tries", "=", "3", ",", "timeout", "=", "60", ")", ":", "ret", "=", "yield", "self", ".", "message_client", ".", "send", "(", "self", ".", "_package_load", "(", "load", ")", ",", "timeout", ...
Send a load across the wire in cleartext :param dict load: A load to send across the wire :param int tries: The number of times to make before failure :param int timeout: The number of seconds on a response before failing
[ "Send", "a", "load", "across", "the", "wire", "in", "cleartext" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L353-L367
37,384
saltstack/salt
salt/transport/zeromq.py
AsyncZeroMQReqChannel.send
def send(self, load, tries=3, timeout=60, raw=False): ''' Send a request, return a future which will complete when we send the message ''' if self.crypt == 'clear': ret = yield self._uncrypted_transfer(load, tries=tries, timeout=timeout) else: ret = yield ...
python
def send(self, load, tries=3, timeout=60, raw=False): ''' Send a request, return a future which will complete when we send the message ''' if self.crypt == 'clear': ret = yield self._uncrypted_transfer(load, tries=tries, timeout=timeout) else: ret = yield ...
[ "def", "send", "(", "self", ",", "load", ",", "tries", "=", "3", ",", "timeout", "=", "60", ",", "raw", "=", "False", ")", ":", "if", "self", ".", "crypt", "==", "'clear'", ":", "ret", "=", "yield", "self", ".", "_uncrypted_transfer", "(", "load", ...
Send a request, return a future which will complete when we send the message
[ "Send", "a", "request", "return", "a", "future", "which", "will", "complete", "when", "we", "send", "the", "message" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L370-L378
37,385
saltstack/salt
salt/transport/zeromq.py
AsyncZeroMQPubChannel.master_pub
def master_pub(self): ''' Return the master publish port ''' return _get_master_uri(self.opts['master_ip'], self.publish_port, source_ip=self.opts.get('source_ip'), source_port=self.opts.get('sou...
python
def master_pub(self): ''' Return the master publish port ''' return _get_master_uri(self.opts['master_ip'], self.publish_port, source_ip=self.opts.get('source_ip'), source_port=self.opts.get('sou...
[ "def", "master_pub", "(", "self", ")", ":", "return", "_get_master_uri", "(", "self", ".", "opts", "[", "'master_ip'", "]", ",", "self", ".", "publish_port", ",", "source_ip", "=", "self", ".", "opts", ".", "get", "(", "'source_ip'", ")", ",", "source_po...
Return the master publish port
[ "Return", "the", "master", "publish", "port" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L514-L521
37,386
saltstack/salt
salt/transport/zeromq.py
AsyncZeroMQPubChannel.stream
def stream(self): ''' Return the current zmqstream, creating one if necessary ''' if not hasattr(self, '_stream'): self._stream = zmq.eventloop.zmqstream.ZMQStream(self._socket, io_loop=self.io_loop) return self._stream
python
def stream(self): ''' Return the current zmqstream, creating one if necessary ''' if not hasattr(self, '_stream'): self._stream = zmq.eventloop.zmqstream.ZMQStream(self._socket, io_loop=self.io_loop) return self._stream
[ "def", "stream", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_stream'", ")", ":", "self", ".", "_stream", "=", "zmq", ".", "eventloop", ".", "zmqstream", ".", "ZMQStream", "(", "self", ".", "_socket", ",", "io_loop", "=", "self...
Return the current zmqstream, creating one if necessary
[ "Return", "the", "current", "zmqstream", "creating", "one", "if", "necessary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L550-L556
37,387
ArabellaTech/django-basic-cms
basic_cms/templatetags/pages_tags.py
show_slug_with_level
def show_slug_with_level(context, page, lang=None, fallback=True): """Display slug with level by language.""" if not lang: lang = context.get('lang', pages_settings.PAGE_DEFAULT_LANGUAGE) page = get_page_from_string_or_id(page, lang) if not page: return '' return {'content': page.s...
python
def show_slug_with_level(context, page, lang=None, fallback=True): """Display slug with level by language.""" if not lang: lang = context.get('lang', pages_settings.PAGE_DEFAULT_LANGUAGE) page = get_page_from_string_or_id(page, lang) if not page: return '' return {'content': page.s...
[ "def", "show_slug_with_level", "(", "context", ",", "page", ",", "lang", "=", "None", ",", "fallback", "=", "True", ")", ":", "if", "not", "lang", ":", "lang", "=", "context", ".", "get", "(", "'lang'", ",", "pages_settings", ".", "PAGE_DEFAULT_LANGUAGE", ...
Display slug with level by language.
[ "Display", "slug", "with", "level", "by", "language", "." ]
863f3c6098606f663994930cd8e7723ad0c07caf
https://github.com/ArabellaTech/django-basic-cms/blob/863f3c6098606f663994930cd8e7723ad0c07caf/basic_cms/templatetags/pages_tags.py#L174-L183
37,388
ArabellaTech/django-basic-cms
basic_cms/templatetags/pages_tags.py
do_get_pages_with_tag
def do_get_pages_with_tag(parser, token): """ Return Pages with given tag Syntax:: {% get_pages_with_tag <tag name> as <varname> %} Example use: {% get_pages_with_tag "footer" as pages %} """ bits = token.split_contents() if 4 != len(bits): raise TemplateSyntaxErro...
python
def do_get_pages_with_tag(parser, token): """ Return Pages with given tag Syntax:: {% get_pages_with_tag <tag name> as <varname> %} Example use: {% get_pages_with_tag "footer" as pages %} """ bits = token.split_contents() if 4 != len(bits): raise TemplateSyntaxErro...
[ "def", "do_get_pages_with_tag", "(", "parser", ",", "token", ")", ":", "bits", "=", "token", ".", "split_contents", "(", ")", "if", "4", "!=", "len", "(", "bits", ")", ":", "raise", "TemplateSyntaxError", "(", "'%r expects 2 arguments'", "%", "bits", "[", ...
Return Pages with given tag Syntax:: {% get_pages_with_tag <tag name> as <varname> %} Example use: {% get_pages_with_tag "footer" as pages %}
[ "Return", "Pages", "with", "given", "tag" ]
863f3c6098606f663994930cd8e7723ad0c07caf
https://github.com/ArabellaTech/django-basic-cms/blob/863f3c6098606f663994930cd8e7723ad0c07caf/basic_cms/templatetags/pages_tags.py#L503-L523
37,389
sirfoga/pyhal
hal/files/models/system.py
remove_year
def remove_year(name): """Removes year from input :param name: path to edit :return: inputs with no years """ for i in range(len( name) - 3): # last index is length - 3 - 1 = length - 4 if name[i: i + 4].isdigit(): name = name[:i] + name[i + 4:] return r...
python
def remove_year(name): """Removes year from input :param name: path to edit :return: inputs with no years """ for i in range(len( name) - 3): # last index is length - 3 - 1 = length - 4 if name[i: i + 4].isdigit(): name = name[:i] + name[i + 4:] return r...
[ "def", "remove_year", "(", "name", ")", ":", "for", "i", "in", "range", "(", "len", "(", "name", ")", "-", "3", ")", ":", "# last index is length - 3 - 1 = length - 4", "if", "name", "[", "i", ":", "i", "+", "4", "]", ".", "isdigit", "(", ")", ":", ...
Removes year from input :param name: path to edit :return: inputs with no years
[ "Removes", "year", "from", "input" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L85-L97
37,390
sirfoga/pyhal
hal/files/models/system.py
remove_brackets
def remove_brackets(name): """Removes brackets form input :param name: path to fix :return: inputs with no brackets """ name = re.sub( r"([(\[]).*?([)\]])", r"\g<1>\g<2>", name ) # remove anything in between brackets brackets = "()[]{}" # list of brackets for b...
python
def remove_brackets(name): """Removes brackets form input :param name: path to fix :return: inputs with no brackets """ name = re.sub( r"([(\[]).*?([)\]])", r"\g<1>\g<2>", name ) # remove anything in between brackets brackets = "()[]{}" # list of brackets for b...
[ "def", "remove_brackets", "(", "name", ")", ":", "name", "=", "re", ".", "sub", "(", "r\"([(\\[]).*?([)\\]])\"", ",", "r\"\\g<1>\\g<2>\"", ",", "name", ")", "# remove anything in between brackets", "brackets", "=", "\"()[]{}\"", "# list of brackets", "for", "bracket",...
Removes brackets form input :param name: path to fix :return: inputs with no brackets
[ "Removes", "brackets", "form", "input" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L100-L114
37,391
sirfoga/pyhal
hal/files/models/system.py
extract_name_max_chars
def extract_name_max_chars(name, max_chars=64, blank=" "): """Extracts max chars in name truncated to nearest word :param name: path to edit :param max_chars: max chars of new name :param blank: char that represents the blank between words :return: Name edited to contain at most max_chars """ ...
python
def extract_name_max_chars(name, max_chars=64, blank=" "): """Extracts max chars in name truncated to nearest word :param name: path to edit :param max_chars: max chars of new name :param blank: char that represents the blank between words :return: Name edited to contain at most max_chars """ ...
[ "def", "extract_name_max_chars", "(", "name", ",", "max_chars", "=", "64", ",", "blank", "=", "\" \"", ")", ":", "new_name", "=", "name", ".", "strip", "(", ")", "if", "len", "(", "new_name", ")", ">", "max_chars", ":", "new_name", "=", "new_name", "["...
Extracts max chars in name truncated to nearest word :param name: path to edit :param max_chars: max chars of new name :param blank: char that represents the blank between words :return: Name edited to contain at most max_chars
[ "Extracts", "max", "chars", "in", "name", "truncated", "to", "nearest", "word" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L117-L130
37,392
sirfoga/pyhal
hal/files/models/system.py
get_parent_folder_name
def get_parent_folder_name(file_path): """Finds parent folder of file :param file_path: path :return: Name of folder container """ return os.path.split(os.path.split(os.path.abspath(file_path))[0])[-1]
python
def get_parent_folder_name(file_path): """Finds parent folder of file :param file_path: path :return: Name of folder container """ return os.path.split(os.path.split(os.path.abspath(file_path))[0])[-1]
[ "def", "get_parent_folder_name", "(", "file_path", ")", ":", "return", "os", ".", "path", ".", "split", "(", "os", ".", "path", ".", "split", "(", "os", ".", "path", ".", "abspath", "(", "file_path", ")", ")", "[", "0", "]", ")", "[", "-", "1", "...
Finds parent folder of file :param file_path: path :return: Name of folder container
[ "Finds", "parent", "folder", "of", "file" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L183-L189
37,393
sirfoga/pyhal
hal/files/models/system.py
ls_dir
def ls_dir(path, include_hidden=False): """Finds content of folder :param path: directory to get list of files and folders :param include_hidden: True iff include hidden files in list :return: List of paths in given directory """ lst = [] for file in os.listdir(path): hidden_file = ...
python
def ls_dir(path, include_hidden=False): """Finds content of folder :param path: directory to get list of files and folders :param include_hidden: True iff include hidden files in list :return: List of paths in given directory """ lst = [] for file in os.listdir(path): hidden_file = ...
[ "def", "ls_dir", "(", "path", ",", "include_hidden", "=", "False", ")", ":", "lst", "=", "[", "]", "for", "file", "in", "os", ".", "listdir", "(", "path", ")", ":", "hidden_file", "=", "FileSystem", "(", "file", ")", ".", "is_hidden", "(", ")", "if...
Finds content of folder :param path: directory to get list of files and folders :param include_hidden: True iff include hidden files in list :return: List of paths in given directory
[ "Finds", "content", "of", "folder" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L201-L213
37,394
sirfoga/pyhal
hal/files/models/system.py
ls_recurse
def ls_recurse(path, include_hidden=False): """Finds content of folder recursively :param path: directory to get list of files and folders :param include_hidden: True iff include hidden files in list :return: List of paths in given directory recursively """ lst = [] for file in os.listdir(p...
python
def ls_recurse(path, include_hidden=False): """Finds content of folder recursively :param path: directory to get list of files and folders :param include_hidden: True iff include hidden files in list :return: List of paths in given directory recursively """ lst = [] for file in os.listdir(p...
[ "def", "ls_recurse", "(", "path", ",", "include_hidden", "=", "False", ")", ":", "lst", "=", "[", "]", "for", "file", "in", "os", ".", "listdir", "(", "path", ")", ":", "hidden_file", "=", "FileSystem", "(", "file", ")", ".", "is_hidden", "(", ")", ...
Finds content of folder recursively :param path: directory to get list of files and folders :param include_hidden: True iff include hidden files in list :return: List of paths in given directory recursively
[ "Finds", "content", "of", "folder", "recursively" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L216-L233
37,395
sirfoga/pyhal
hal/files/models/system.py
FileSystem.is_russian
def is_russian(self): """Checks if file path is russian :return: True iff document has a russian name """ russian_chars = 0 for char in RUSSIAN_CHARS: if char in self.name: russian_chars += 1 # found a russian char return russian_chars > len...
python
def is_russian(self): """Checks if file path is russian :return: True iff document has a russian name """ russian_chars = 0 for char in RUSSIAN_CHARS: if char in self.name: russian_chars += 1 # found a russian char return russian_chars > len...
[ "def", "is_russian", "(", "self", ")", ":", "russian_chars", "=", "0", "for", "char", "in", "RUSSIAN_CHARS", ":", "if", "char", "in", "self", ".", "name", ":", "russian_chars", "+=", "1", "# found a russian char", "return", "russian_chars", ">", "len", "(", ...
Checks if file path is russian :return: True iff document has a russian name
[ "Checks", "if", "file", "path", "is", "russian" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L275-L285
37,396
sirfoga/pyhal
hal/files/models/system.py
FileSystem.rename
def rename(self, new_path): """Renames to new path :param new_path: new path to use """ rename_path = fix_raw_path(new_path) if is_folder(self.path): os.rename(self.path, rename_path) else: os.renames(self.path, rename_path)
python
def rename(self, new_path): """Renames to new path :param new_path: new path to use """ rename_path = fix_raw_path(new_path) if is_folder(self.path): os.rename(self.path, rename_path) else: os.renames(self.path, rename_path)
[ "def", "rename", "(", "self", ",", "new_path", ")", ":", "rename_path", "=", "fix_raw_path", "(", "new_path", ")", "if", "is_folder", "(", "self", ".", "path", ")", ":", "os", ".", "rename", "(", "self", ".", "path", ",", "rename_path", ")", "else", ...
Renames to new path :param new_path: new path to use
[ "Renames", "to", "new", "path" ]
4394d8a1f7e45bea28a255ec390f4962ee64d33a
https://github.com/sirfoga/pyhal/blob/4394d8a1f7e45bea28a255ec390f4962ee64d33a/hal/files/models/system.py#L291-L300
37,397
portfors-lab/sparkle
sparkle/gui/drag_label.py
DragLabel.setClass
def setClass(self, factoryclass): """Sets the constructor for the component type this label is to represent :param factoryclass: a class that, when called, results in an instance of the desired class :type factoryclass: callable """ self.factoryclass = factoryclass ...
python
def setClass(self, factoryclass): """Sets the constructor for the component type this label is to represent :param factoryclass: a class that, when called, results in an instance of the desired class :type factoryclass: callable """ self.factoryclass = factoryclass ...
[ "def", "setClass", "(", "self", ",", "factoryclass", ")", ":", "self", ".", "factoryclass", "=", "factoryclass", "self", ".", "setText", "(", "str", "(", "factoryclass", ".", "name", ")", ")" ]
Sets the constructor for the component type this label is to represent :param factoryclass: a class that, when called, results in an instance of the desired class :type factoryclass: callable
[ "Sets", "the", "constructor", "for", "the", "component", "type", "this", "label", "is", "to", "represent" ]
5fad1cf2bec58ec6b15d91da20f6236a74826110
https://github.com/portfors-lab/sparkle/blob/5fad1cf2bec58ec6b15d91da20f6236a74826110/sparkle/gui/drag_label.py#L19-L27
37,398
portfors-lab/sparkle
sparkle/gui/plotting/pyqtgraph_widgets.py
BasePlot.getLabel
def getLabel(self, key): """Gets the label assigned to an axes :param key:??? :type key: str """ axisItem = self.getPlotItem().axes[key]['item'] return axisItem.label.toPlainText()
python
def getLabel(self, key): """Gets the label assigned to an axes :param key:??? :type key: str """ axisItem = self.getPlotItem().axes[key]['item'] return axisItem.label.toPlainText()
[ "def", "getLabel", "(", "self", ",", "key", ")", ":", "axisItem", "=", "self", ".", "getPlotItem", "(", ")", ".", "axes", "[", "key", "]", "[", "'item'", "]", "return", "axisItem", ".", "label", ".", "toPlainText", "(", ")" ]
Gets the label assigned to an axes :param key:??? :type key: str
[ "Gets", "the", "label", "assigned", "to", "an", "axes" ]
5fad1cf2bec58ec6b15d91da20f6236a74826110
https://github.com/portfors-lab/sparkle/blob/5fad1cf2bec58ec6b15d91da20f6236a74826110/sparkle/gui/plotting/pyqtgraph_widgets.py#L78-L85
37,399
portfors-lab/sparkle
sparkle/gui/plotting/pyqtgraph_widgets.py
TraceWidget.updateData
def updateData(self, axeskey, x, y): """Replaces the currently displayed data :param axeskey: name of data plot to update. Valid options are 'stim' or 'response' :type axeskey: str :param x: index values associated with y to plot :type x: numpy.ndarray :param y: values t...
python
def updateData(self, axeskey, x, y): """Replaces the currently displayed data :param axeskey: name of data plot to update. Valid options are 'stim' or 'response' :type axeskey: str :param x: index values associated with y to plot :type x: numpy.ndarray :param y: values t...
[ "def", "updateData", "(", "self", ",", "axeskey", ",", "x", ",", "y", ")", ":", "if", "axeskey", "==", "'stim'", ":", "self", ".", "stimPlot", ".", "setData", "(", "x", ",", "y", ")", "# call manually to ajust placement of signal", "ranges", "=", "self", ...
Replaces the currently displayed data :param axeskey: name of data plot to update. Valid options are 'stim' or 'response' :type axeskey: str :param x: index values associated with y to plot :type x: numpy.ndarray :param y: values to plot at x :type y: numpy.ndarray
[ "Replaces", "the", "currently", "displayed", "data" ]
5fad1cf2bec58ec6b15d91da20f6236a74826110
https://github.com/portfors-lab/sparkle/blob/5fad1cf2bec58ec6b15d91da20f6236a74826110/sparkle/gui/plotting/pyqtgraph_widgets.py#L177-L199