partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
source_add
Add a new source source : string source url to add source_trype : string (imgapi) source type, either imgapi or docker .. versionadded:: 2019.2.0 CLI Example: .. code-block:: bash salt '*' imgadm.source_add https://updates.joyent.com salt '*' imgadm.source_add ht...
salt/modules/smartos_imgadm.py
def source_add(source, source_type='imgapi'): ''' Add a new source source : string source url to add source_trype : string (imgapi) source type, either imgapi or docker .. versionadded:: 2019.2.0 CLI Example: .. code-block:: bash salt '*' imgadm.source_add https:...
def source_add(source, source_type='imgapi'): ''' Add a new source source : string source url to add source_trype : string (imgapi) source type, either imgapi or docker .. versionadded:: 2019.2.0 CLI Example: .. code-block:: bash salt '*' imgadm.source_add https:...
[ "Add", "a", "new", "source" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_imgadm.py#L478-L510
[ "def", "source_add", "(", "source", ",", "source_type", "=", "'imgapi'", ")", ":", "ret", "=", "{", "}", "# NOTE: there are some undocumented deprecated source types", "# so we just warn instead of error on those", "if", "source_type", "not", "in", "[", "'imgapi'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
flags
Helper function for instantiating a Flags object Args: instantiated (bool): True to return an instantiated object, False to return the object definition. Use False if inherited by another class. Default is True. Returns: object: An instance of the Flags obj...
salt/utils/win_dacl.py
def flags(instantiated=True): ''' Helper function for instantiating a Flags object Args: instantiated (bool): True to return an instantiated object, False to return the object definition. Use False if inherited by another class. Default is True. Returns: ...
def flags(instantiated=True): ''' Helper function for instantiating a Flags object Args: instantiated (bool): True to return an instantiated object, False to return the object definition. Use False if inherited by another class. Default is True. Returns: ...
[ "Helper", "function", "for", "instantiating", "a", "Flags", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L170-L435
[ "def", "flags", "(", "instantiated", "=", "True", ")", ":", "if", "not", "HAS_WIN32", ":", "return", "class", "Flags", "(", "object", ")", ":", "'''\n Object containing all the flags for dealing with Windows permissions\n '''", "# Flag Dicts", "ace_perms", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dacl
Helper function for instantiating a Dacl class. Args: obj_name (str): The full path to the object. If None, a blank DACL will be created. Default is None. obj_type (str): The type of object. Default is 'File' Returns: object: An instantiated Dacl o...
salt/utils/win_dacl.py
def dacl(obj_name=None, obj_type='file'): ''' Helper function for instantiating a Dacl class. Args: obj_name (str): The full path to the object. If None, a blank DACL will be created. Default is None. obj_type (str): The type of object. Default is 'File...
def dacl(obj_name=None, obj_type='file'): ''' Helper function for instantiating a Dacl class. Args: obj_name (str): The full path to the object. If None, a blank DACL will be created. Default is None. obj_type (str): The type of object. Default is 'File...
[ "Helper", "function", "for", "instantiating", "a", "Dacl", "class", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L438-L1044
[ "def", "dacl", "(", "obj_name", "=", "None", ",", "obj_type", "=", "'file'", ")", ":", "if", "not", "HAS_WIN32", ":", "return", "class", "Dacl", "(", "flags", "(", "False", ")", ")", ":", "'''\n DACL Object\n '''", "def", "__init__", "(", "se...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_sid
Converts a username to a sid, or verifies a sid. Required for working with the DACL. Args: principal(str): The principal to lookup the sid. Can be a sid or a username. Returns: PySID Object: A sid Usage: .. code-block:: python # Get a user's sid salt...
salt/utils/win_dacl.py
def get_sid(principal): ''' Converts a username to a sid, or verifies a sid. Required for working with the DACL. Args: principal(str): The principal to lookup the sid. Can be a sid or a username. Returns: PySID Object: A sid Usage: .. code-block:: python ...
def get_sid(principal): ''' Converts a username to a sid, or verifies a sid. Required for working with the DACL. Args: principal(str): The principal to lookup the sid. Can be a sid or a username. Returns: PySID Object: A sid Usage: .. code-block:: python ...
[ "Converts", "a", "username", "to", "a", "sid", "or", "verifies", "a", "sid", ".", "Required", "for", "working", "with", "the", "DACL", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1047-L1090
[ "def", "get_sid", "(", "principal", ")", ":", "# If None is passed, use the Universal Well-known SID \"Null SID\"", "if", "principal", "is", "None", ":", "principal", "=", "'NULL SID'", "# Test if the user passed a sid or a name", "try", ":", "sid", "=", "salt", ".", "uti...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_sid_string
Converts a PySID object to a string SID. Args: principal(str): The principal to lookup the sid. Must be a PySID object. Returns: str: A string sid Usage: .. code-block:: python # Get a PySID object py_sid = salt.utils.win_dacl.get_sid('jsnuffy') ...
salt/utils/win_dacl.py
def get_sid_string(principal): ''' Converts a PySID object to a string SID. Args: principal(str): The principal to lookup the sid. Must be a PySID object. Returns: str: A string sid Usage: .. code-block:: python # Get a PySID object py_sid = salt...
def get_sid_string(principal): ''' Converts a PySID object to a string SID. Args: principal(str): The principal to lookup the sid. Must be a PySID object. Returns: str: A string sid Usage: .. code-block:: python # Get a PySID object py_sid = salt...
[ "Converts", "a", "PySID", "object", "to", "a", "string", "SID", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1093-L1129
[ "def", "get_sid_string", "(", "principal", ")", ":", "# If None is passed, use the Universal Well-known SID \"Null SID\"", "if", "principal", "is", "None", ":", "principal", "=", "'NULL SID'", "try", ":", "return", "win32security", ".", "ConvertSidToStringSid", "(", "prin...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_name
Gets the name from the specified principal. Args: principal (str): Find the Normalized name based on this. Can be a PySID object, a SID string, or a user name in any capitalization. .. note:: Searching based on the user name can be slow on hosts connect...
salt/utils/win_dacl.py
def get_name(principal): ''' Gets the name from the specified principal. Args: principal (str): Find the Normalized name based on this. Can be a PySID object, a SID string, or a user name in any capitalization. .. note:: Searching based on the u...
def get_name(principal): ''' Gets the name from the specified principal. Args: principal (str): Find the Normalized name based on this. Can be a PySID object, a SID string, or a user name in any capitalization. .. note:: Searching based on the u...
[ "Gets", "the", "name", "from", "the", "specified", "principal", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1132-L1186
[ "def", "get_name", "(", "principal", ")", ":", "# If this is a PySID object, use it", "if", "isinstance", "(", "principal", ",", "pywintypes", ".", "SIDType", ")", ":", "sid_obj", "=", "principal", "else", ":", "# If None is passed, use the Universal Well-known SID for \"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_owner
r''' Gets the owner of the passed object Args: obj_name (str): The path for which to obtain owner information. The format of this parameter is different depending on the ``obj_type`` obj_type (str): The type of object to query. This value changes the format...
salt/utils/win_dacl.py
def get_owner(obj_name, obj_type='file'): r''' Gets the owner of the passed object Args: obj_name (str): The path for which to obtain owner information. The format of this parameter is different depending on the ``obj_type`` obj_type (str): The type of ...
def get_owner(obj_name, obj_type='file'): r''' Gets the owner of the passed object Args: obj_name (str): The path for which to obtain owner information. The format of this parameter is different depending on the ``obj_type`` obj_type (str): The type of ...
[ "r", "Gets", "the", "owner", "of", "the", "passed", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1189-L1270
[ "def", "get_owner", "(", "obj_name", ",", "obj_type", "=", "'file'", ")", ":", "# Not all filesystems mountable within windows have SecurityDescriptors.", "# For instance, some mounted SAMBA shares, or VirtualBox shared folders. If", "# we can't load a file descriptor for the file, we defaul...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_primary_group
r''' Gets the primary group of the passed object Args: obj_name (str): The path for which to obtain primary group information obj_type (str): The type of object to query. This value changes the format of the ``obj_name`` parameter as follows: -...
salt/utils/win_dacl.py
def get_primary_group(obj_name, obj_type='file'): r''' Gets the primary group of the passed object Args: obj_name (str): The path for which to obtain primary group information obj_type (str): The type of object to query. This value changes the format of the ...
def get_primary_group(obj_name, obj_type='file'): r''' Gets the primary group of the passed object Args: obj_name (str): The path for which to obtain primary group information obj_type (str): The type of object to query. This value changes the format of the ...
[ "r", "Gets", "the", "primary", "group", "of", "the", "passed", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1273-L1356
[ "def", "get_primary_group", "(", "obj_name", ",", "obj_type", "=", "'file'", ")", ":", "# Not all filesystems mountable within windows have SecurityDescriptors.", "# For instance, some mounted SAMBA shares, or VirtualBox shared folders. If", "# we can't load a file descriptor for the file, w...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_owner
Set the owner of an object. This can be a file, folder, registry key, printer, service, etc... Args: obj_name (str): The object for which to set owner. This can be the path to a file or folder, a registry key, printer, etc. For more information about how to format t...
salt/utils/win_dacl.py
def set_owner(obj_name, principal, obj_type='file'): ''' Set the owner of an object. This can be a file, folder, registry key, printer, service, etc... Args: obj_name (str): The object for which to set owner. This can be the path to a file or folder, a registry key, pri...
def set_owner(obj_name, principal, obj_type='file'): ''' Set the owner of an object. This can be a file, folder, registry key, printer, service, etc... Args: obj_name (str): The object for which to set owner. This can be the path to a file or folder, a registry key, pri...
[ "Set", "the", "owner", "of", "an", "object", ".", "This", "can", "be", "a", "file", "folder", "registry", "key", "printer", "service", "etc", "..." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1359-L1433
[ "def", "set_owner", "(", "obj_name", ",", "principal", ",", "obj_type", "=", "'file'", ")", ":", "sid", "=", "get_sid", "(", "principal", ")", "obj_flags", "=", "flags", "(", ")", "# Validate obj_type", "if", "obj_type", ".", "lower", "(", ")", "not", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_permissions
Set the permissions of an object. This can be a file, folder, registry key, printer, service, etc... Args: obj_name (str): The object for which to set permissions. This can be the path to a file or folder, a registry key, printer, etc. For more information about how...
salt/utils/win_dacl.py
def set_permissions(obj_name, principal, permissions, access_mode='grant', applies_to=None, obj_type='file', reset_perms=False, protected=None): ''' Set the permissions of ...
def set_permissions(obj_name, principal, permissions, access_mode='grant', applies_to=None, obj_type='file', reset_perms=False, protected=None): ''' Set the permissions of ...
[ "Set", "the", "permissions", "of", "an", "object", ".", "This", "can", "be", "a", "file", "folder", "registry", "key", "printer", "service", "etc", "..." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1517-L1599
[ "def", "set_permissions", "(", "obj_name", ",", "principal", ",", "permissions", ",", "access_mode", "=", "'grant'", ",", "applies_to", "=", "None", ",", "obj_type", "=", "'file'", ",", "reset_perms", "=", "False", ",", "protected", "=", "None", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rm_permissions
r''' Remove a user's ACE from an object. This can be a file, folder, registry key, printer, service, etc... Args: obj_name (str): The object from which to remove the ace. This can be the path to a file or folder, a registry key, printer, etc. For more informatio...
salt/utils/win_dacl.py
def rm_permissions(obj_name, principal, ace_type='all', obj_type='file'): r''' Remove a user's ACE from an object. This can be a file, folder, registry key, printer, service, etc... Args: obj_name (str): The object from which...
def rm_permissions(obj_name, principal, ace_type='all', obj_type='file'): r''' Remove a user's ACE from an object. This can be a file, folder, registry key, printer, service, etc... Args: obj_name (str): The object from which...
[ "r", "Remove", "a", "user", "s", "ACE", "from", "an", "object", ".", "This", "can", "be", "a", "file", "folder", "registry", "key", "printer", "service", "etc", "..." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1602-L1648
[ "def", "rm_permissions", "(", "obj_name", ",", "principal", ",", "ace_type", "=", "'all'", ",", "obj_type", "=", "'file'", ")", ":", "obj_dacl", "=", "dacl", "(", "obj_name", ",", "obj_type", ")", "obj_dacl", ".", "rm_ace", "(", "principal", ",", "ace_type...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_permissions
Get the permissions for the passed object Args: obj_name (str): The name of or path to the object. principal (Optional[str]): The name of the user or group for which to get permissions. Can also pass a SID. If None, all ACEs defined on the object will be ...
salt/utils/win_dacl.py
def get_permissions(obj_name, principal=None, obj_type='file'): ''' Get the permissions for the passed object Args: obj_name (str): The name of or path to the object. principal (Optional[str]): The name of the user or group for which to get permissions. Can also ...
def get_permissions(obj_name, principal=None, obj_type='file'): ''' Get the permissions for the passed object Args: obj_name (str): The name of or path to the object. principal (Optional[str]): The name of the user or group for which to get permissions. Can also ...
[ "Get", "the", "permissions", "for", "the", "passed", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1651-L1682
[ "def", "get_permissions", "(", "obj_name", ",", "principal", "=", "None", ",", "obj_type", "=", "'file'", ")", ":", "obj_dacl", "=", "dacl", "(", "obj_name", ",", "obj_type", ")", "if", "principal", "is", "None", ":", "return", "obj_dacl", ".", "list_aces"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
has_permission
r''' Check if the object has a permission Args: obj_name (str): The name of or path to the object. principal (str): The name of the user or group for which to get permissions. Can also pass a SID. permission (str): The permission to ver...
salt/utils/win_dacl.py
def has_permission(obj_name, principal, permission, access_mode='grant', obj_type='file', exact=True): r''' Check if the object has a permission Args: obj_name (str): The name of or path to t...
def has_permission(obj_name, principal, permission, access_mode='grant', obj_type='file', exact=True): r''' Check if the object has a permission Args: obj_name (str): The name of or path to t...
[ "r", "Check", "if", "the", "object", "has", "a", "permission" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1685-L1773
[ "def", "has_permission", "(", "obj_name", ",", "principal", ",", "permission", ",", "access_mode", "=", "'grant'", ",", "obj_type", "=", "'file'", ",", "exact", "=", "True", ")", ":", "# Validate access_mode", "if", "access_mode", ".", "lower", "(", ")", "no...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_inheritance
Enable or disable an objects inheritance. Args: obj_name (str): The name of the object enabled (bool): True to enable inheritance, False to disable obj_type (Optional[str]): The type of object. Only three objects allow inheritance. Valid ob...
salt/utils/win_dacl.py
def set_inheritance(obj_name, enabled, obj_type='file', clear=False): ''' Enable or disable an objects inheritance. Args: obj_name (str): The name of the object enabled (bool): True to enable inheritance, False to disable obj_type (Optional[str]): ...
def set_inheritance(obj_name, enabled, obj_type='file', clear=False): ''' Enable or disable an objects inheritance. Args: obj_name (str): The name of the object enabled (bool): True to enable inheritance, False to disable obj_type (Optional[str]): ...
[ "Enable", "or", "disable", "an", "objects", "inheritance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1776-L1818
[ "def", "set_inheritance", "(", "obj_name", ",", "enabled", ",", "obj_type", "=", "'file'", ",", "clear", "=", "False", ")", ":", "if", "obj_type", "not", "in", "[", "'file'", ",", "'registry'", ",", "'registry32'", "]", ":", "raise", "SaltInvocationError", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_inheritance
Get an object's inheritance. Args: obj_name (str): The name of the object obj_type (Optional[str]): The type of object. Only three object types allow inheritance. Valid objects are: - file (default): This is a file or directory - regist...
salt/utils/win_dacl.py
def get_inheritance(obj_name, obj_type='file'): ''' Get an object's inheritance. Args: obj_name (str): The name of the object obj_type (Optional[str]): The type of object. Only three object types allow inheritance. Valid objects are: - file...
def get_inheritance(obj_name, obj_type='file'): ''' Get an object's inheritance. Args: obj_name (str): The name of the object obj_type (Optional[str]): The type of object. Only three object types allow inheritance. Valid objects are: - file...
[ "Get", "an", "object", "s", "inheritance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1821-L1861
[ "def", "get_inheritance", "(", "obj_name", ",", "obj_type", "=", "'file'", ")", ":", "obj_dacl", "=", "dacl", "(", "obj_name", "=", "obj_name", ",", "obj_type", "=", "obj_type", ")", "inherited", "=", "win32security", ".", "INHERITED_ACE", "for", "i", "in", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
copy_security
r''' Copy the security descriptor of the Source to the Target. You can specify a specific portion of the security descriptor to copy using one of the `copy_*` parameters. .. note:: At least one `copy_*` parameter must be ``True`` .. note:: The user account running this command must...
salt/utils/win_dacl.py
def copy_security(source, target, obj_type='file', copy_owner=True, copy_group=True, copy_dacl=True, copy_sacl=True): r''' Copy the security descriptor of the Source to the Target. You can specify a s...
def copy_security(source, target, obj_type='file', copy_owner=True, copy_group=True, copy_dacl=True, copy_sacl=True): r''' Copy the security descriptor of the Source to the Target. You can specify a s...
[ "r", "Copy", "the", "security", "descriptor", "of", "the", "Source", "to", "the", "Target", ".", "You", "can", "specify", "a", "specific", "portion", "of", "the", "security", "descriptor", "to", "copy", "using", "one", "of", "the", "copy_", "*", "parameter...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L1864-L2029
[ "def", "copy_security", "(", "source", ",", "target", ",", "obj_type", "=", "'file'", ",", "copy_owner", "=", "True", ",", "copy_group", "=", "True", ",", "copy_dacl", "=", "True", ",", "copy_sacl", "=", "True", ")", ":", "obj_dacl", "=", "dacl", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_perms
Helper function used by ``check_perms`` for checking and setting Grant and Deny permissions. Args: obj_name (str): The name or full path to the object obj_type (Optional[str]): The type of object for which to check permissions. Default is 'file' new_perms (dic...
salt/utils/win_dacl.py
def _check_perms(obj_name, obj_type, new_perms, cur_perms, access_mode, ret): ''' Helper function used by ``check_perms`` for checking and setting Grant and Deny permissions. Args: obj_name (str): The name or full path to the object obj_type (Optional[str]): Th...
def _check_perms(obj_name, obj_type, new_perms, cur_perms, access_mode, ret): ''' Helper function used by ``check_perms`` for checking and setting Grant and Deny permissions. Args: obj_name (str): The name or full path to the object obj_type (Optional[str]): Th...
[ "Helper", "function", "used", "by", "check_perms", "for", "checking", "and", "setting", "Grant", "and", "Deny", "permissions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L2032-L2198
[ "def", "_check_perms", "(", "obj_name", ",", "obj_type", ",", "new_perms", ",", "cur_perms", ",", "access_mode", ",", "ret", ")", ":", "access_mode", "=", "access_mode", ".", "lower", "(", ")", "changes", "=", "{", "}", "for", "user", "in", "new_perms", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_perms
Check owner and permissions for the passed directory. This function checks the permissions and sets them, returning the changes made. .. versionadded:: 2019.2.0 Args: obj_name (str): The name or full path to the object obj_type (Optional[str]): The type of object ...
salt/utils/win_dacl.py
def check_perms(obj_name, obj_type='file', ret=None, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Check owner and permissions for the passed directory. This funct...
def check_perms(obj_name, obj_type='file', ret=None, owner=None, grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Check owner and permissions for the passed directory. This funct...
[ "Check", "owner", "and", "permissions", "for", "the", "passed", "directory", ".", "This", "function", "checks", "the", "permissions", "and", "sets", "them", "returning", "the", "changes", "made", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L2201-L2419
[ "def", "check_perms", "(", "obj_name", ",", "obj_type", "=", "'file'", ",", "ret", "=", "None", ",", "owner", "=", "None", ",", "grant_perms", "=", "None", ",", "deny_perms", "=", "None", ",", "inheritance", "=", "True", ",", "reset", "=", "False", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_perms
Set permissions for the given path .. versionadded:: 2019.2.0 Args: obj_name (str): The name or full path to the object obj_type (Optional[str]): The type of object for which to check permissions. Default is 'file' grant_perms (dict): A dictionary...
salt/utils/win_dacl.py
def set_perms(obj_name, obj_type='file', grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Set permissions for the given path .. versionadded:: 2019.2.0 Args: obj_name (str): The name or ful...
def set_perms(obj_name, obj_type='file', grant_perms=None, deny_perms=None, inheritance=True, reset=False): ''' Set permissions for the given path .. versionadded:: 2019.2.0 Args: obj_name (str): The name or ful...
[ "Set", "permissions", "for", "the", "given", "path" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_dacl.py#L2467-L2606
[ "def", "set_perms", "(", "obj_name", ",", "obj_type", "=", "'file'", ",", "grant_perms", "=", "None", ",", "deny_perms", "=", "None", ",", "inheritance", "=", "True", ",", "reset", "=", "False", ")", ":", "ret", "=", "{", "}", "if", "reset", ":", "# ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_user_pubkeys
Retrieve a set of public keys from GitHub for the specified list of users. Expects input in list format. Optionally, a value in the list may be a dict whose value is a list of key IDs to be returned. If this is not done, then all keys will be returned. Some example data structures that coupld be passed...
salt/utils/github.py
def get_user_pubkeys(users): ''' Retrieve a set of public keys from GitHub for the specified list of users. Expects input in list format. Optionally, a value in the list may be a dict whose value is a list of key IDs to be returned. If this is not done, then all keys will be returned. Some exam...
def get_user_pubkeys(users): ''' Retrieve a set of public keys from GitHub for the specified list of users. Expects input in list format. Optionally, a value in the list may be a dict whose value is a list of key IDs to be returned. If this is not done, then all keys will be returned. Some exam...
[ "Retrieve", "a", "set", "of", "public", "keys", "from", "GitHub", "for", "the", "specified", "list", "of", "users", ".", "Expects", "input", "in", "list", "format", ".", "Optionally", "a", "value", "in", "the", "list", "may", "be", "a", "dict", "whose", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/github.py#L20-L71
[ "def", "get_user_pubkeys", "(", "users", ")", ":", "if", "not", "isinstance", "(", "users", ",", "list", ")", ":", "return", "{", "'Error'", ":", "'A list of users is expected'", "}", "ret", "=", "{", "}", "for", "user", "in", "users", ":", "key_ids", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_hosts
Retrieves DNS host record settings for the requested domain. returns a dictionary of information about the requested domain sld SLD of the domain name tld TLD of the domain name CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains_dns.get_hosts sld tld
salt/modules/namecheap_domains_dns.py
def get_hosts(sld, tld): ''' Retrieves DNS host record settings for the requested domain. returns a dictionary of information about the requested domain sld SLD of the domain name tld TLD of the domain name CLI Example: .. code-block:: bash salt 'my-minion' name...
def get_hosts(sld, tld): ''' Retrieves DNS host record settings for the requested domain. returns a dictionary of information about the requested domain sld SLD of the domain name tld TLD of the domain name CLI Example: .. code-block:: bash salt 'my-minion' name...
[ "Retrieves", "DNS", "host", "record", "settings", "for", "the", "requested", "domain", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_dns.py#L56-L84
[ "def", "get_hosts", "(", "sld", ",", "tld", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.dns.gethosts'", ")", "opts", "[", "'TLD'", "]", "=", "tld", "opts", "[", "'SLD'", "]", "=", "sld", "res...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_list
Gets a list of DNS servers associated with the requested domain. returns a dictionary of information about requested domain sld SLD of the domain name tld TLD of the domain name CLI Example: .. code-block:: bash salt 'my-minion' namecheap_domains_dns.get_list sld tld
salt/modules/namecheap_domains_dns.py
def get_list(sld, tld): ''' Gets a list of DNS servers associated with the requested domain. returns a dictionary of information about requested domain sld SLD of the domain name tld TLD of the domain name CLI Example: .. code-block:: bash salt 'my-minion' namec...
def get_list(sld, tld): ''' Gets a list of DNS servers associated with the requested domain. returns a dictionary of information about requested domain sld SLD of the domain name tld TLD of the domain name CLI Example: .. code-block:: bash salt 'my-minion' namec...
[ "Gets", "a", "list", "of", "DNS", "servers", "associated", "with", "the", "requested", "domain", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_dns.py#L87-L115
[ "def", "get_list", "(", "sld", ",", "tld", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.dns.getlist'", ")", "opts", "[", "'TLD'", "]", "=", "tld", "opts", "[", "'SLD'", "]", "=", "sld", "respo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_hosts
Sets DNS host records settings for the requested domain. returns True if the host records were set successfully sld SLD of the domain name tld TLD of the domain name hosts Must be passed as a list of Python dictionaries, with each dictionary containing the following k...
salt/modules/namecheap_domains_dns.py
def set_hosts(sld, tld, hosts): ''' Sets DNS host records settings for the requested domain. returns True if the host records were set successfully sld SLD of the domain name tld TLD of the domain name hosts Must be passed as a list of Python dictionaries, with each d...
def set_hosts(sld, tld, hosts): ''' Sets DNS host records settings for the requested domain. returns True if the host records were set successfully sld SLD of the domain name tld TLD of the domain name hosts Must be passed as a list of Python dictionaries, with each d...
[ "Sets", "DNS", "host", "records", "settings", "for", "the", "requested", "domain", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_dns.py#L118-L170
[ "def", "set_hosts", "(", "sld", ",", "tld", ",", "hosts", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.dns.setHosts'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "]", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_custom
Sets domain to use custom DNS servers. returns True if the custom nameservers were set successfully sld SLD of the domain name tld TLD of the domain name nameservers array of strings List of nameservers to be associated with this domain CLI Example: .. code-block::...
salt/modules/namecheap_domains_dns.py
def set_custom(sld, tld, nameservers): ''' Sets domain to use custom DNS servers. returns True if the custom nameservers were set successfully sld SLD of the domain name tld TLD of the domain name nameservers array of strings List of nameservers to be associated with...
def set_custom(sld, tld, nameservers): ''' Sets domain to use custom DNS servers. returns True if the custom nameservers were set successfully sld SLD of the domain name tld TLD of the domain name nameservers array of strings List of nameservers to be associated with...
[ "Sets", "domain", "to", "use", "custom", "DNS", "servers", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_dns.py#L173-L203
[ "def", "set_custom", "(", "sld", ",", "tld", ",", "nameservers", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.dns.setCustom'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_default
Sets domain to use namecheap default DNS servers. Required for free services like Host record management, URL forwarding, email forwarding, dynamic DNS and other value added services. sld SLD of the domain name tld TLD of the domain name Returns ``True`` if the domain was successf...
salt/modules/namecheap_domains_dns.py
def set_default(sld, tld): ''' Sets domain to use namecheap default DNS servers. Required for free services like Host record management, URL forwarding, email forwarding, dynamic DNS and other value added services. sld SLD of the domain name tld TLD of the domain name Retu...
def set_default(sld, tld): ''' Sets domain to use namecheap default DNS servers. Required for free services like Host record management, URL forwarding, email forwarding, dynamic DNS and other value added services. sld SLD of the domain name tld TLD of the domain name Retu...
[ "Sets", "domain", "to", "use", "namecheap", "default", "DNS", "servers", ".", "Required", "for", "free", "services", "like", "Host", "record", "management", "URL", "forwarding", "email", "forwarding", "dynamic", "DNS", "and", "other", "value", "added", "services...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_dns.py#L206-L235
[ "def", "set_default", "(", "sld", ",", "tld", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.dns.setDefault'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "]", "=", "tld", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
output
Display the profiling data in a table format.
salt/output/profile.py
def output(data, **kwargs): ''' Display the profiling data in a table format. ''' rows = _find_durations(data) kwargs['opts'] = __opts__ kwargs['rows_key'] = 'rows' kwargs['labels_key'] = 'labels' to_show = {'labels': ['name', 'mod.fun', 'duration (ms)'], 'rows': rows...
def output(data, **kwargs): ''' Display the profiling data in a table format. ''' rows = _find_durations(data) kwargs['opts'] = __opts__ kwargs['rows_key'] = 'rows' kwargs['labels_key'] = 'labels' to_show = {'labels': ['name', 'mod.fun', 'duration (ms)'], 'rows': rows...
[ "Display", "the", "profiling", "data", "in", "a", "table", "format", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/profile.py#L67-L81
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "rows", "=", "_find_durations", "(", "data", ")", "kwargs", "[", "'opts'", "]", "=", "__opts__", "kwargs", "[", "'rows_key'", "]", "=", "'rows'", "kwargs", "[", "'labels_key'", "]", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure an image exists, copy it else from source name : An alias of the image, this is used to check if the image exists and it will be added as alias to the image on copy/create. source : Source dict. For an LXD to LXD copy: .. code-block: yaml source: ...
salt/states/lxd_image.py
def present(name, source, aliases=None, public=None, auto_update=None, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Ensure an image exists, copy it else from source name : An alias of th...
def present(name, source, aliases=None, public=None, auto_update=None, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Ensure an image exists, copy it else from source name : An alias of th...
[ "Ensure", "an", "image", "exists", "copy", "it", "else", "from", "source" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_image.py#L52-L298
[ "def", "present", "(", "name", ",", "source", ",", "aliases", "=", "None", ",", "public", "=", "None", ",", "auto_update", "=", "None", ",", "remote_addr", "=", "None", ",", "cert", "=", "None", ",", "key", "=", "None", ",", "verify_cert", "=", "True...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
hosted_zone_present
Ensure a hosted zone exists with the given attributes. name The name of the state definition. Name The name of the domain. This should be a fully-specified domain, and should terminate with a period. This is the name you have registered with your DNS registrar. It is also the name ...
salt/states/boto3_route53.py
def hosted_zone_present(name, Name=None, PrivateZone=False, CallerReference=None, Comment=None, VPCs=None, region=None, key=None, keyid=None, profile=None): ''' Ensure a hosted zone exists with the given attributes. name The name of the state definiti...
def hosted_zone_present(name, Name=None, PrivateZone=False, CallerReference=None, Comment=None, VPCs=None, region=None, key=None, keyid=None, profile=None): ''' Ensure a hosted zone exists with the given attributes. name The name of the state definiti...
[ "Ensure", "a", "hosted", "zone", "exists", "with", "the", "given", "attributes", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_route53.py#L87-L298
[ "def", "hosted_zone_present", "(", "name", ",", "Name", "=", "None", ",", "PrivateZone", "=", "False", ",", "CallerReference", "=", "None", ",", "Comment", "=", "None", ",", "VPCs", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
hosted_zone_absent
Ensure the Route53 Hostes Zone described is absent name The name of the state definition. Name The name of the domain. This should be a fully-specified domain, and should terminate with a period. If not provided, the value of name will be used. PrivateZone Set True if del...
salt/states/boto3_route53.py
def hosted_zone_absent(name, Name=None, PrivateZone=False, region=None, key=None, keyid=None, profile=None): ''' Ensure the Route53 Hostes Zone described is absent name The name of the state definition. Name The name of the domain. This should be a fully-specifie...
def hosted_zone_absent(name, Name=None, PrivateZone=False, region=None, key=None, keyid=None, profile=None): ''' Ensure the Route53 Hostes Zone described is absent name The name of the state definition. Name The name of the domain. This should be a fully-specifie...
[ "Ensure", "the", "Route53", "Hostes", "Zone", "described", "is", "absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_route53.py#L301-L350
[ "def", "hosted_zone_absent", "(", "name", ",", "Name", "=", "None", ",", "PrivateZone", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "Name", "=", "Name", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rr_present
Ensure the Route53 record is present. name The name of the state definition. This will be used for Name if the latter is not provided. HostedZoneId The ID of a zone to create the record in. Exclusive with DomainName. DomainName The domain name of a zone to create the rec...
salt/states/boto3_route53.py
def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None, SetIdentifier=None, Weight=None, Region=None, GeoLocation=None, Failover=None, TTL=None, ResourceRecords=None, AliasTarget=None, HealthCheckId=None, TrafficPolicyInstanceId=None...
def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None, SetIdentifier=None, Weight=None, Region=None, GeoLocation=None, Failover=None, TTL=None, ResourceRecords=None, AliasTarget=None, HealthCheckId=None, TrafficPolicyInstanceId=None...
[ "Ensure", "the", "Route53", "record", "is", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_route53.py#L353-L692
[ "def", "rr_present", "(", "name", ",", "HostedZoneId", "=", "None", ",", "DomainName", "=", "None", ",", "PrivateZone", "=", "False", ",", "Name", "=", "None", ",", "Type", "=", "None", ",", "SetIdentifier", "=", "None", ",", "Weight", "=", "None", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rr_absent
Ensure the Route53 record is deleted. name The name of the state definition. This will be used for Name if the latter is not provided. HostedZoneId The ID of the zone to delete the record from. Exclusive with DomainName. DomainName The domain name of the zone to delete t...
salt/states/boto3_route53.py
def rr_absent(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None, SetIdentifier=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the Route53 record is deleted. name The name of the state definition. This will be used for ...
def rr_absent(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None, SetIdentifier=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the Route53 record is deleted. name The name of the state definition. This will be used for ...
[ "Ensure", "the", "Route53", "record", "is", "deleted", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_route53.py#L695-L800
[ "def", "rr_absent", "(", "name", ",", "HostedZoneId", "=", "None", ",", "DomainName", "=", "None", ",", "PrivateZone", "=", "False", ",", "Name", "=", "None", ",", "Type", "=", "None", ",", "SetIdentifier", "=", "None", ",", "region", "=", "None", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_module_environment
Get module optional environment. To setup an environment option for a particular module, add either pillar or config at the minion as follows: system-environment: modules: pkg: _: LC_ALL: en_GB.UTF-8 FOO: bar install: HELLO: world ...
salt/utils/environment.py
def get_module_environment(env=None, function=None): ''' Get module optional environment. To setup an environment option for a particular module, add either pillar or config at the minion as follows: system-environment: modules: pkg: _: LC_ALL: en_GB.UTF-8 ...
def get_module_environment(env=None, function=None): ''' Get module optional environment. To setup an environment option for a particular module, add either pillar or config at the minion as follows: system-environment: modules: pkg: _: LC_ALL: en_GB.UTF-8 ...
[ "Get", "module", "optional", "environment", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/environment.py#L9-L65
[ "def", "get_module_environment", "(", "env", "=", "None", ",", "function", "=", "None", ")", ":", "result", "=", "{", "}", "if", "not", "env", ":", "env", "=", "{", "}", "for", "env_src", "in", "[", "env", ".", "get", "(", "'__opts__'", ",", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_cmd_run
Run the aptly command. :return: The string output of the command. :rtype: str
salt/modules/aptly.py
def _cmd_run(cmd): ''' Run the aptly command. :return: The string output of the command. :rtype: str ''' cmd.insert(0, 'aptly') cmd_ret = __salt__['cmd.run_all'](cmd, ignore_retcode=True) if cmd_ret['retcode'] != 0: log.debug('Unable to execute command: %s\nError: %s', cmd, ...
def _cmd_run(cmd): ''' Run the aptly command. :return: The string output of the command. :rtype: str ''' cmd.insert(0, 'aptly') cmd_ret = __salt__['cmd.run_all'](cmd, ignore_retcode=True) if cmd_ret['retcode'] != 0: log.debug('Unable to execute command: %s\nError: %s', cmd, ...
[ "Run", "the", "aptly", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L36-L50
[ "def", "_cmd_run", "(", "cmd", ")", ":", "cmd", ".", "insert", "(", "0", ",", "'aptly'", ")", "cmd_ret", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "ignore_retcode", "=", "True", ")", "if", "cmd_ret", "[", "'retcode'", "]", "!=", "0...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_convert_to_closest_type
Convert string value to it's closest non-string analog, if possible. :param dict value: The string value to attempt conversion on. :return: The converted value. :rtype: Union[bool, int, None, str]
salt/modules/aptly.py
def _convert_to_closest_type(value): ''' Convert string value to it's closest non-string analog, if possible. :param dict value: The string value to attempt conversion on. :return: The converted value. :rtype: Union[bool, int, None, str] ''' value = salt.utils.stringutils.to_bool(value.str...
def _convert_to_closest_type(value): ''' Convert string value to it's closest non-string analog, if possible. :param dict value: The string value to attempt conversion on. :return: The converted value. :rtype: Union[bool, int, None, str] ''' value = salt.utils.stringutils.to_bool(value.str...
[ "Convert", "string", "value", "to", "it", "s", "closest", "non", "-", "string", "analog", "if", "possible", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L53-L67
[ "def", "_convert_to_closest_type", "(", "value", ")", ":", "value", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bool", "(", "value", ".", "strip", "(", ")", ")", "if", "isinstance", "(", "value", ",", "bool", ")", ":", "return", "value", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_format_repo_args
Format the common arguments for creating or editing a repository. :param str comment: The description of the repository. :param str component: The default component to use when publishing. :param str distribution: The default distribution to use when publishing. :param str uploaders_file: The repositor...
salt/modules/aptly.py
def _format_repo_args(comment=None, component=None, distribution=None, uploaders_file=None, saltenv='base'): ''' Format the common arguments for creating or editing a repository. :param str comment: The description of the repository. :param str component: The default component to ...
def _format_repo_args(comment=None, component=None, distribution=None, uploaders_file=None, saltenv='base'): ''' Format the common arguments for creating or editing a repository. :param str comment: The description of the repository. :param str component: The default component to ...
[ "Format", "the", "common", "arguments", "for", "creating", "or", "editing", "a", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L70-L103
[ "def", "_format_repo_args", "(", "comment", "=", "None", ",", "component", "=", "None", ",", "distribution", "=", "None", ",", "uploaders_file", "=", "None", ",", "saltenv", "=", "'base'", ")", ":", "ret", "=", "list", "(", ")", "cached_uploaders_path", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_show_output
Parse the output of an aptly show command. :param str cmd_ret: The text of the command output that needs to be parsed. :return: A dictionary containing the configuration data. :rtype: dict
salt/modules/aptly.py
def _parse_show_output(cmd_ret): ''' Parse the output of an aptly show command. :param str cmd_ret: The text of the command output that needs to be parsed. :return: A dictionary containing the configuration data. :rtype: dict ''' parsed_data = dict() list_key = None for line in cm...
def _parse_show_output(cmd_ret): ''' Parse the output of an aptly show command. :param str cmd_ret: The text of the command output that needs to be parsed. :return: A dictionary containing the configuration data. :rtype: dict ''' parsed_data = dict() list_key = None for line in cm...
[ "Parse", "the", "output", "of", "an", "aptly", "show", "command", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L106-L152
[ "def", "_parse_show_output", "(", "cmd_ret", ")", ":", "parsed_data", "=", "dict", "(", ")", "list_key", "=", "None", "for", "line", "in", "cmd_ret", ".", "splitlines", "(", ")", ":", "# Skip empty lines.", "if", "not", "line", ".", "strip", "(", ")", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_convert_parsed_show_output
Convert matching string values to lists/dictionaries. :param dict parsed_data: The text of the command output that needs to be parsed. :return: A dictionary containing the modified configuration data. :rtype: dict
salt/modules/aptly.py
def _convert_parsed_show_output(parsed_data): ''' Convert matching string values to lists/dictionaries. :param dict parsed_data: The text of the command output that needs to be parsed. :return: A dictionary containing the modified configuration data. :rtype: dict ''' # Match lines like "ma...
def _convert_parsed_show_output(parsed_data): ''' Convert matching string values to lists/dictionaries. :param dict parsed_data: The text of the command output that needs to be parsed. :return: A dictionary containing the modified configuration data. :rtype: dict ''' # Match lines like "ma...
[ "Convert", "matching", "string", "values", "to", "lists", "/", "dictionaries", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L155-L182
[ "def", "_convert_parsed_show_output", "(", "parsed_data", ")", ":", "# Match lines like \"main: xenial [snapshot]\" or \"test [local]\".", "source_pattern", "=", "re", ".", "compile", "(", "r'(?:(?P<component>\\S+):)?\\s*(?P<name>\\S+)\\s+\\[(?P<type>\\S+)\\]'", ")", "sources", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_validate_config
Validate that the configuration file exists and is readable. :param str config_path: The path to the configuration file for the aptly instance. :return: None :rtype: None
salt/modules/aptly.py
def _validate_config(config_path): ''' Validate that the configuration file exists and is readable. :param str config_path: The path to the configuration file for the aptly instance. :return: None :rtype: None ''' log.debug('Checking configuration file: %s', config_path) if not os.pat...
def _validate_config(config_path): ''' Validate that the configuration file exists and is readable. :param str config_path: The path to the configuration file for the aptly instance. :return: None :rtype: None ''' log.debug('Checking configuration file: %s', config_path) if not os.pat...
[ "Validate", "that", "the", "configuration", "file", "exists", "and", "is", "readable", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L185-L200
[ "def", "_validate_config", "(", "config_path", ")", ":", "log", ".", "debug", "(", "'Checking configuration file: %s'", ",", "config_path", ")", "if", "not", "os", ".", "path", ".", "isfile", "(", "config_path", ")", ":", "message", "=", "'Unable to get configur...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_config
Get the configuration data. :param str config_path: The path to the configuration file for the aptly instance. :return: A dictionary containing the configuration data. :rtype: dict CLI Example: .. code-block:: bash salt '*' aptly.get_config
salt/modules/aptly.py
def get_config(config_path=_DEFAULT_CONFIG_PATH): ''' Get the configuration data. :param str config_path: The path to the configuration file for the aptly instance. :return: A dictionary containing the configuration data. :rtype: dict CLI Example: .. code-block:: bash salt '*' a...
def get_config(config_path=_DEFAULT_CONFIG_PATH): ''' Get the configuration data. :param str config_path: The path to the configuration file for the aptly instance. :return: A dictionary containing the configuration data. :rtype: dict CLI Example: .. code-block:: bash salt '*' a...
[ "Get", "the", "configuration", "data", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L203-L224
[ "def", "get_config", "(", "config_path", "=", "_DEFAULT_CONFIG_PATH", ")", ":", "_validate_config", "(", "config_path", ")", "cmd", "=", "[", "'config'", ",", "'show'", ",", "'-config={}'", ".", "format", "(", "config_path", ")", "]", "cmd_ret", "=", "_cmd_run...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_repos
List all of the local package repositories. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: Return a list of packages in the repo. :return: A dictionary of the repositories. :rtype: dict CLI Example: .. code-block:: bash ...
salt/modules/aptly.py
def list_repos(config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' List all of the local package repositories. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: Return a list of packages in the repo. :return: A dictionary of the r...
def list_repos(config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' List all of the local package repositories. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: Return a list of packages in the repo. :return: A dictionary of the r...
[ "List", "all", "of", "the", "local", "package", "repositories", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L227-L256
[ "def", "list_repos", "(", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "with_packages", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "ret", "=", "dict", "(", ")", "cmd", "=", "[", "'repo'", ",", "'list'", ",", "'-config={}'", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_repo
Get detailed information about a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: Return a list of packages in the repo. :return: A dictionary containing informatio...
salt/modules/aptly.py
def get_repo(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' Get detailed information about a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: ...
def get_repo(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' Get detailed information about a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: ...
[ "Get", "detailed", "information", "about", "a", "local", "package", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L259-L292
[ "def", "get_repo", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "with_packages", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "with_packages", "=", "six", ".", "text_type", "(", "bool", "(", "with_packages", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
new_repo
Create a new local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param str comment: The description of the repository. :param str component: The default component to use when publishing. :pa...
salt/modules/aptly.py
def new_repo(name, config_path=_DEFAULT_CONFIG_PATH, comment=None, component=None, distribution=None, uploaders_file=None, from_snapshot=None, saltenv='base'): ''' Create a new local package repository. :param str name: The name of the local repository. :param str config_path:...
def new_repo(name, config_path=_DEFAULT_CONFIG_PATH, comment=None, component=None, distribution=None, uploaders_file=None, from_snapshot=None, saltenv='base'): ''' Create a new local package repository. :param str name: The name of the local repository. :param str config_path:...
[ "Create", "a", "new", "local", "package", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L295-L344
[ "def", "new_repo", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "comment", "=", "None", ",", "component", "=", "None", ",", "distribution", "=", "None", ",", "uploaders_file", "=", "None", ",", "from_snapshot", "=", "None", ",", "salten...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_repo
Configure the settings for a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param str comment: The description of the repository. :param str component: The default component to use when pub...
salt/modules/aptly.py
def set_repo(name, config_path=_DEFAULT_CONFIG_PATH, comment=None, component=None, distribution=None, uploaders_file=None, saltenv='base'): ''' Configure the settings for a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the ...
def set_repo(name, config_path=_DEFAULT_CONFIG_PATH, comment=None, component=None, distribution=None, uploaders_file=None, saltenv='base'): ''' Configure the settings for a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the ...
[ "Configure", "the", "settings", "for", "a", "local", "package", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L347-L419
[ "def", "set_repo", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "comment", "=", "None", ",", "component", "=", "None", ",", "distribution", "=", "None", ",", "uploaders_file", "=", "None", ",", "saltenv", "=", "'base'", ")", ":", "_va...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_repo
Remove a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool force: Whether to remove the repository even if it is used as the source of an existing snapshot. :return: A bool...
salt/modules/aptly.py
def delete_repo(name, config_path=_DEFAULT_CONFIG_PATH, force=False): ''' Remove a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool force: Whether to remove the repository even...
def delete_repo(name, config_path=_DEFAULT_CONFIG_PATH, force=False): ''' Remove a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool force: Whether to remove the repository even...
[ "Remove", "a", "local", "package", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L422-L459
[ "def", "delete_repo", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "force", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "force", "=", "six", ".", "text_type", "(", "bool", "(", "force", ")", ")", ".", "lower",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_mirrors
Get a list of all the mirrored remote repositories. :param str config_path: The path to the configuration file for the aptly instance. :return: A list of the mirror names. :rtype: list CLI Example: .. code-block:: bash salt '*' aptly.list_mirrors
salt/modules/aptly.py
def list_mirrors(config_path=_DEFAULT_CONFIG_PATH): ''' Get a list of all the mirrored remote repositories. :param str config_path: The path to the configuration file for the aptly instance. :return: A list of the mirror names. :rtype: list CLI Example: .. code-block:: bash salt...
def list_mirrors(config_path=_DEFAULT_CONFIG_PATH): ''' Get a list of all the mirrored remote repositories. :param str config_path: The path to the configuration file for the aptly instance. :return: A list of the mirror names. :rtype: list CLI Example: .. code-block:: bash salt...
[ "Get", "a", "list", "of", "all", "the", "mirrored", "remote", "repositories", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L462-L485
[ "def", "list_mirrors", "(", "config_path", "=", "_DEFAULT_CONFIG_PATH", ")", ":", "_validate_config", "(", "config_path", ")", "cmd", "=", "[", "'mirror'", ",", "'list'", ",", "'-config={}'", ".", "format", "(", "config_path", ")", ",", "'-raw=true'", "]", "cm...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_mirror
Get detailed information about a mirrored remote repository. :param str name: The name of the remote repository mirror. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: Return a list of packages in the repo. :return: A dictionary containing ...
salt/modules/aptly.py
def get_mirror(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' Get detailed information about a mirrored remote repository. :param str name: The name of the remote repository mirror. :param str config_path: The path to the configuration file for the aptly instance. :param bool wit...
def get_mirror(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' Get detailed information about a mirrored remote repository. :param str name: The name of the remote repository mirror. :param str config_path: The path to the configuration file for the aptly instance. :param bool wit...
[ "Get", "detailed", "information", "about", "a", "mirrored", "remote", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L488-L521
[ "def", "get_mirror", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "with_packages", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "ret", "=", "dict", "(", ")", "cmd", "=", "[", "'mirror'", ",", "'show'", ",", "'-...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_mirror
Remove a mirrored remote repository. By default, Package data is not removed. :param str name: The name of the remote repository mirror. :param str config_path: The path to the configuration file for the aptly instance. :param bool force: Whether to remove the mirror even if it is used as the source ...
salt/modules/aptly.py
def delete_mirror(name, config_path=_DEFAULT_CONFIG_PATH, force=False): ''' Remove a mirrored remote repository. By default, Package data is not removed. :param str name: The name of the remote repository mirror. :param str config_path: The path to the configuration file for the aptly instance. :pa...
def delete_mirror(name, config_path=_DEFAULT_CONFIG_PATH, force=False): ''' Remove a mirrored remote repository. By default, Package data is not removed. :param str name: The name of the remote repository mirror. :param str config_path: The path to the configuration file for the aptly instance. :pa...
[ "Remove", "a", "mirrored", "remote", "repository", ".", "By", "default", "Package", "data", "is", "not", "removed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L524-L561
[ "def", "delete_mirror", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "force", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "force", "=", "six", ".", "text_type", "(", "bool", "(", "force", ")", ")", ".", "lower...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_published
Get a list of all the published repositories. :param str config_path: The path to the configuration file for the aptly instance. :return: A list of the published repositories. :rtype: list CLI Example: .. code-block:: bash salt '*' aptly.list_published
salt/modules/aptly.py
def list_published(config_path=_DEFAULT_CONFIG_PATH): ''' Get a list of all the published repositories. :param str config_path: The path to the configuration file for the aptly instance. :return: A list of the published repositories. :rtype: list CLI Example: .. code-block:: bash ...
def list_published(config_path=_DEFAULT_CONFIG_PATH): ''' Get a list of all the published repositories. :param str config_path: The path to the configuration file for the aptly instance. :return: A list of the published repositories. :rtype: list CLI Example: .. code-block:: bash ...
[ "Get", "a", "list", "of", "all", "the", "published", "repositories", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L564-L594
[ "def", "list_published", "(", "config_path", "=", "_DEFAULT_CONFIG_PATH", ")", ":", "_validate_config", "(", "config_path", ")", "ret", "=", "list", "(", ")", "cmd", "=", "[", "'publish'", ",", "'list'", ",", "'-config={}'", ".", "format", "(", "config_path", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_published
Get the details of a published repository. :param str name: The distribution name of the published repository. :param str config_path: The path to the configuration file for the aptly instance. :param str endpoint: The publishing endpoint. :param str prefix: The prefix for publishing. :return: A d...
salt/modules/aptly.py
def get_published(name, config_path=_DEFAULT_CONFIG_PATH, endpoint='', prefix=None): ''' Get the details of a published repository. :param str name: The distribution name of the published repository. :param str config_path: The path to the configuration file for the aptly instance. :param str endpo...
def get_published(name, config_path=_DEFAULT_CONFIG_PATH, endpoint='', prefix=None): ''' Get the details of a published repository. :param str name: The distribution name of the published repository. :param str config_path: The path to the configuration file for the aptly instance. :param str endpo...
[ "Get", "the", "details", "of", "a", "published", "repository", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L597-L633
[ "def", "get_published", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "endpoint", "=", "''", ",", "prefix", "=", "None", ")", ":", "_validate_config", "(", "config_path", ")", "ret", "=", "dict", "(", ")", "sources", "=", "list", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_published
Remove files belonging to a published repository. Aptly tries to remove as many files belonging to this repository as possible. :param str name: The distribution name of the published repository. :param str config_path: The path to the configuration file for the aptly instance. :param str endpoint:...
salt/modules/aptly.py
def delete_published(name, config_path=_DEFAULT_CONFIG_PATH, endpoint='', prefix=None, skip_cleanup=False, force=False): ''' Remove files belonging to a published repository. Aptly tries to remove as many files belonging to this repository as possible. :param str name: The dist...
def delete_published(name, config_path=_DEFAULT_CONFIG_PATH, endpoint='', prefix=None, skip_cleanup=False, force=False): ''' Remove files belonging to a published repository. Aptly tries to remove as many files belonging to this repository as possible. :param str name: The dist...
[ "Remove", "files", "belonging", "to", "a", "published", "repository", ".", "Aptly", "tries", "to", "remove", "as", "many", "files", "belonging", "to", "this", "repository", "as", "possible", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L636-L685
[ "def", "delete_published", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "endpoint", "=", "''", ",", "prefix", "=", "None", ",", "skip_cleanup", "=", "False", ",", "force", "=", "False", ")", ":", "_validate_config", "(", "config_path", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_snapshots
Get a list of all the existing snapshots. :param str config_path: The path to the configuration file for the aptly instance. :param bool sort_by_time: Whether to sort by creation time instead of by name. :return: A list of the snapshot names. :rtype: list CLI Example: .. code-block:: bash ...
salt/modules/aptly.py
def list_snapshots(config_path=_DEFAULT_CONFIG_PATH, sort_by_time=False): ''' Get a list of all the existing snapshots. :param str config_path: The path to the configuration file for the aptly instance. :param bool sort_by_time: Whether to sort by creation time instead of by name. :return: A list ...
def list_snapshots(config_path=_DEFAULT_CONFIG_PATH, sort_by_time=False): ''' Get a list of all the existing snapshots. :param str config_path: The path to the configuration file for the aptly instance. :param bool sort_by_time: Whether to sort by creation time instead of by name. :return: A list ...
[ "Get", "a", "list", "of", "all", "the", "existing", "snapshots", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L688-L717
[ "def", "list_snapshots", "(", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "sort_by_time", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "cmd", "=", "[", "'snapshot'", ",", "'list'", ",", "'-config={}'", ".", "format", "(", "config_pat...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_snapshot
Get detailed information about a snapshot. :param str name: The name of the snapshot given during snapshot creation. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: Return a list of packages in the snapshot. :return: A dictionary containing...
salt/modules/aptly.py
def get_snapshot(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' Get detailed information about a snapshot. :param str name: The name of the snapshot given during snapshot creation. :param str config_path: The path to the configuration file for the aptly instance. :param bool with...
def get_snapshot(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' Get detailed information about a snapshot. :param str name: The name of the snapshot given during snapshot creation. :param str config_path: The path to the configuration file for the aptly instance. :param bool with...
[ "Get", "detailed", "information", "about", "a", "snapshot", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L720-L754
[ "def", "get_snapshot", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "with_packages", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "sources", "=", "list", "(", ")", "cmd", "=", "[", "'snapshot'", ",", "'show'", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_snapshot
Remove information about a snapshot. If a snapshot is published, it can not be dropped without first removing publishing for that snapshot. If a snapshot is used as the source for other snapshots, Aptly will refuse to remove it unless forced. :param str name: The name of the snapshot given ...
salt/modules/aptly.py
def delete_snapshot(name, config_path=_DEFAULT_CONFIG_PATH, force=False): ''' Remove information about a snapshot. If a snapshot is published, it can not be dropped without first removing publishing for that snapshot. If a snapshot is used as the source for other snapshots, Aptly will refuse to ...
def delete_snapshot(name, config_path=_DEFAULT_CONFIG_PATH, force=False): ''' Remove information about a snapshot. If a snapshot is published, it can not be dropped without first removing publishing for that snapshot. If a snapshot is used as the source for other snapshots, Aptly will refuse to ...
[ "Remove", "information", "about", "a", "snapshot", ".", "If", "a", "snapshot", "is", "published", "it", "can", "not", "be", "dropped", "without", "first", "removing", "publishing", "for", "that", "snapshot", ".", "If", "a", "snapshot", "is", "used", "as", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L757-L797
[ "def", "delete_snapshot", "(", "name", ",", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "force", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "force", "=", "six", ".", "text_type", "(", "bool", "(", "force", ")", ")", ".", "low...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cleanup_db
Remove data regarding unreferenced packages and delete files in the package pool that are no longer being used by packages. :param bool dry_run: Report potential changes without making any changes. :return: A dictionary of the package keys and files that were removed. :rtype: dict CLI Example...
salt/modules/aptly.py
def cleanup_db(config_path=_DEFAULT_CONFIG_PATH, dry_run=False): ''' Remove data regarding unreferenced packages and delete files in the package pool that are no longer being used by packages. :param bool dry_run: Report potential changes without making any changes. :return: A dictionary of th...
def cleanup_db(config_path=_DEFAULT_CONFIG_PATH, dry_run=False): ''' Remove data regarding unreferenced packages and delete files in the package pool that are no longer being used by packages. :param bool dry_run: Report potential changes without making any changes. :return: A dictionary of th...
[ "Remove", "data", "regarding", "unreferenced", "packages", "and", "delete", "files", "in", "the", "package", "pool", "that", "are", "no", "longer", "being", "used", "by", "packages", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/aptly.py#L800-L848
[ "def", "cleanup_db", "(", "config_path", "=", "_DEFAULT_CONFIG_PATH", ",", "dry_run", "=", "False", ")", ":", "_validate_config", "(", "config_path", ")", "dry_run", "=", "six", ".", "text_type", "(", "bool", "(", "dry_run", ")", ")", ".", "lower", "(", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.publish_minions
Publishes minions as a list of dicts.
salt/netapi/rest_cherrypy/event_processor.py
def publish_minions(self): ''' Publishes minions as a list of dicts. ''' minions = [] for minion, minion_info in six.iteritems(self.minions): curr_minion = {} curr_minion.update(minion_info) curr_minion.update({'id': minion}) minio...
def publish_minions(self): ''' Publishes minions as a list of dicts. ''' minions = [] for minion, minion_info in six.iteritems(self.minions): curr_minion = {} curr_minion.update(minion_info) curr_minion.update({'id': minion}) minio...
[ "Publishes", "minions", "as", "a", "list", "of", "dicts", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/event_processor.py#L35-L48
[ "def", "publish_minions", "(", "self", ")", ":", "minions", "=", "[", "]", "for", "minion", ",", "minion_info", "in", "six", ".", "iteritems", "(", "self", ".", "minions", ")", ":", "curr_minion", "=", "{", "}", "curr_minion", ".", "update", "(", "mini...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.publish
Publishes the data to the event stream.
salt/netapi/rest_cherrypy/event_processor.py
def publish(self, key, data): ''' Publishes the data to the event stream. ''' publish_data = {key: data} self.handler.send(salt.utils.json.dumps(publish_data), False)
def publish(self, key, data): ''' Publishes the data to the event stream. ''' publish_data = {key: data} self.handler.send(salt.utils.json.dumps(publish_data), False)
[ "Publishes", "the", "data", "to", "the", "event", "stream", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/event_processor.py#L50-L55
[ "def", "publish", "(", "self", ",", "key", ",", "data", ")", ":", "publish_data", "=", "{", "key", ":", "data", "}", "self", ".", "handler", ".", "send", "(", "salt", ".", "utils", ".", "json", ".", "dumps", "(", "publish_data", ")", ",", "False", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process_presence_events
Check if any minions have connected or dropped. Send a message to the client if they have.
salt/netapi/rest_cherrypy/event_processor.py
def process_presence_events(self, event_data, token, opts): ''' Check if any minions have connected or dropped. Send a message to the client if they have. ''' tag = event_data['tag'] event_info = event_data['data'] minions_detected = event_info['present'] ...
def process_presence_events(self, event_data, token, opts): ''' Check if any minions have connected or dropped. Send a message to the client if they have. ''' tag = event_data['tag'] event_info = event_data['data'] minions_detected = event_info['present'] ...
[ "Check", "if", "any", "minions", "have", "connected", "or", "dropped", ".", "Send", "a", "message", "to", "the", "client", "if", "they", "have", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/event_processor.py#L148-L188
[ "def", "process_presence_events", "(", "self", ",", "event_data", ",", "token", ",", "opts", ")", ":", "tag", "=", "event_data", "[", "'tag'", "]", "event_info", "=", "event_data", "[", "'data'", "]", "minions_detected", "=", "event_info", "[", "'present'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process
Process events and publish data
salt/netapi/rest_cherrypy/event_processor.py
def process(self, salt_data, token, opts): ''' Process events and publish data ''' parts = salt_data['tag'].split('/') if len(parts) < 2: return # TBD: Simplify these conditional expressions if parts[1] == 'job': if parts[3] == 'new': ...
def process(self, salt_data, token, opts): ''' Process events and publish data ''' parts = salt_data['tag'].split('/') if len(parts) < 2: return # TBD: Simplify these conditional expressions if parts[1] == 'job': if parts[3] == 'new': ...
[ "Process", "events", "and", "publish", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/event_processor.py#L190-L211
[ "def", "process", "(", "self", ",", "salt_data", ",", "token", ",", "opts", ")", ":", "parts", "=", "salt_data", "[", "'tag'", "]", ".", "split", "(", "'/'", ")", "if", "len", "(", "parts", ")", "<", "2", ":", "return", "# TBD: Simplify these condition...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
distinguished_name_list_exists
Ensures that a distinguished name list exists with the items provided. name: The name of the module function to execute. name(str): The name of the distinguished names list. items(list): A list of items to ensure exist on the distinguished names list. SLS Example: .. code-block:: yaml ...
salt/states/bluecoat_sslv.py
def distinguished_name_list_exists(name, items): ''' Ensures that a distinguished name list exists with the items provided. name: The name of the module function to execute. name(str): The name of the distinguished names list. items(list): A list of items to ensure exist on the distinguished name...
def distinguished_name_list_exists(name, items): ''' Ensures that a distinguished name list exists with the items provided. name: The name of the module function to execute. name(str): The name of the distinguished names list. items(list): A list of items to ensure exist on the distinguished name...
[ "Ensures", "that", "a", "distinguished", "name", "list", "exists", "with", "the", "items", "provided", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bluecoat_sslv.py#L50-L95
[ "def", "distinguished_name_list_exists", "(", "name", ",", "items", ")", ":", "ret", "=", "_default_ret", "(", "name", ")", "req_change", "=", "False", "try", ":", "existing_lists", "=", "__salt__", "[", "'bluecoat_sslv.get_distinguished_name_lists'", "]", "(", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_alarm
Get alarm details. Also can be used to check to see if an alarm exists. CLI example:: salt myminion boto_cloudwatch.get_alarm myalarm region=us-east-1
salt/modules/boto_cloudwatch.py
def get_alarm(name, region=None, key=None, keyid=None, profile=None): ''' Get alarm details. Also can be used to check to see if an alarm exists. CLI example:: salt myminion boto_cloudwatch.get_alarm myalarm region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile...
def get_alarm(name, region=None, key=None, keyid=None, profile=None): ''' Get alarm details. Also can be used to check to see if an alarm exists. CLI example:: salt myminion boto_cloudwatch.get_alarm myalarm region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile...
[ "Get", "alarm", "details", ".", "Also", "can", "be", "used", "to", "check", "to", "see", "if", "an", "alarm", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch.py#L85-L100
[ "def", "get_alarm", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_safe_dump
this presenter magic makes yaml.safe_dump work with the objects returned from boto.describe_alarms()
salt/modules/boto_cloudwatch.py
def _safe_dump(data): ''' this presenter magic makes yaml.safe_dump work with the objects returned from boto.describe_alarms() ''' custom_dumper = __utils__['yaml.get_dumper']('SafeOrderedDumper') def boto_listelement_presenter(dumper, data): return dumper.represent_list(list(data))...
def _safe_dump(data): ''' this presenter magic makes yaml.safe_dump work with the objects returned from boto.describe_alarms() ''' custom_dumper = __utils__['yaml.get_dumper']('SafeOrderedDumper') def boto_listelement_presenter(dumper, data): return dumper.represent_list(list(data))...
[ "this", "presenter", "magic", "makes", "yaml", ".", "safe_dump", "work", "with", "the", "objects", "returned", "from", "boto", ".", "describe_alarms", "()" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch.py#L103-L124
[ "def", "_safe_dump", "(", "data", ")", ":", "custom_dumper", "=", "__utils__", "[", "'yaml.get_dumper'", "]", "(", "'SafeOrderedDumper'", ")", "def", "boto_listelement_presenter", "(", "dumper", ",", "data", ")", ":", "return", "dumper", ".", "represent_list", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_alarms
Get all alarm details. Produces results that can be used to create an sls file. If prefix parameter is given, alarm names in the output will be prepended with the prefix; alarms that have the prefix will be skipped. This can be used to convert existing alarms to be managed by salt, as follows: ...
salt/modules/boto_cloudwatch.py
def get_all_alarms(region=None, prefix=None, key=None, keyid=None, profile=None): ''' Get all alarm details. Produces results that can be used to create an sls file. If prefix parameter is given, alarm names in the output will be prepended with the prefix; alarms that have the p...
def get_all_alarms(region=None, prefix=None, key=None, keyid=None, profile=None): ''' Get all alarm details. Produces results that can be used to create an sls file. If prefix parameter is given, alarm names in the output will be prepended with the prefix; alarms that have the p...
[ "Get", "all", "alarm", "details", ".", "Produces", "results", "that", "can", "be", "used", "to", "create", "an", "sls", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch.py#L127-L175
[ "def", "get_all_alarms", "(", "region", "=", "None", ",", "prefix", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "ke...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_or_update_alarm
Create or update a cloudwatch alarm. Params are the same as: https://boto.readthedocs.io/en/latest/ref/cloudwatch.html#boto.ec2.cloudwatch.alarm.MetricAlarm. Dimensions must be a dict. If the value of Dimensions is a string, it will be json decoded to produce a dict. alarm_actions, insufficient_da...
salt/modules/boto_cloudwatch.py
def create_or_update_alarm( connection=None, name=None, metric=None, namespace=None, statistic=None, comparison=None, threshold=None, period=None, evaluation_periods=None, unit=None, description='', dimensions=None, alarm_actions=None, insufficient_data_actions=None, ok_actions=N...
def create_or_update_alarm( connection=None, name=None, metric=None, namespace=None, statistic=None, comparison=None, threshold=None, period=None, evaluation_periods=None, unit=None, description='', dimensions=None, alarm_actions=None, insufficient_data_actions=None, ok_actions=N...
[ "Create", "or", "update", "a", "cloudwatch", "alarm", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch.py#L178-L271
[ "def", "create_or_update_alarm", "(", "connection", "=", "None", ",", "name", "=", "None", ",", "metric", "=", "None", ",", "namespace", "=", "None", ",", "statistic", "=", "None", ",", "comparison", "=", "None", ",", "threshold", "=", "None", ",", "peri...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
convert_to_arn
Convert a list of strings into actual arns. Converts convenience names such as 'scaling_policy:...' CLI Example:: salt '*' convert_to_arn 'scaling_policy:'
salt/modules/boto_cloudwatch.py
def convert_to_arn(arns, region=None, key=None, keyid=None, profile=None): ''' Convert a list of strings into actual arns. Converts convenience names such as 'scaling_policy:...' CLI Example:: salt '*' convert_to_arn 'scaling_policy:' ''' results = [] for arn in arns: if ar...
def convert_to_arn(arns, region=None, key=None, keyid=None, profile=None): ''' Convert a list of strings into actual arns. Converts convenience names such as 'scaling_policy:...' CLI Example:: salt '*' convert_to_arn 'scaling_policy:' ''' results = [] for arn in arns: if ar...
[ "Convert", "a", "list", "of", "strings", "into", "actual", "arns", ".", "Converts", "convenience", "names", "such", "as", "scaling_policy", ":", "..." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch.py#L274-L296
[ "def", "convert_to_arn", "(", "arns", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "results", "=", "[", "]", "for", "arn", "in", "arns", ":", "if", "arn", ".", "startswith", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_alarm
Delete a cloudwatch alarm CLI example to delete a queue:: salt myminion boto_cloudwatch.delete_alarm myalarm region=us-east-1
salt/modules/boto_cloudwatch.py
def delete_alarm(name, region=None, key=None, keyid=None, profile=None): ''' Delete a cloudwatch alarm CLI example to delete a queue:: salt myminion boto_cloudwatch.delete_alarm myalarm region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) conn.de...
def delete_alarm(name, region=None, key=None, keyid=None, profile=None): ''' Delete a cloudwatch alarm CLI example to delete a queue:: salt myminion boto_cloudwatch.delete_alarm myalarm region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) conn.de...
[ "Delete", "a", "cloudwatch", "alarm" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch.py#L299-L311
[ "def", "delete_alarm", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_metric_alarm_to_dict
Convert a boto.ec2.cloudwatch.alarm.MetricAlarm into a dict. Convenience for pretty printing.
salt/modules/boto_cloudwatch.py
def _metric_alarm_to_dict(alarm): ''' Convert a boto.ec2.cloudwatch.alarm.MetricAlarm into a dict. Convenience for pretty printing. ''' d = odict.OrderedDict() fields = ['name', 'metric', 'namespace', 'statistic', 'comparison', 'threshold', 'period', 'evaluation_periods', 'unit', ...
def _metric_alarm_to_dict(alarm): ''' Convert a boto.ec2.cloudwatch.alarm.MetricAlarm into a dict. Convenience for pretty printing. ''' d = odict.OrderedDict() fields = ['name', 'metric', 'namespace', 'statistic', 'comparison', 'threshold', 'period', 'evaluation_periods', 'unit', ...
[ "Convert", "a", "boto", ".", "ec2", ".", "cloudwatch", ".", "alarm", ".", "MetricAlarm", "into", "a", "dict", ".", "Convenience", "for", "pretty", "printing", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudwatch.py#L314-L327
[ "def", "_metric_alarm_to_dict", "(", "alarm", ")", ":", "d", "=", "odict", ".", "OrderedDict", "(", ")", "fields", "=", "[", "'name'", ",", "'metric'", ",", "'namespace'", ",", "'statistic'", ",", "'comparison'", ",", "'threshold'", ",", "'period'", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure GPG public key is present in keychain name The unique name or keyid for the GPG public key. keys The keyId or keyIds to add to the GPG keychain. user Add GPG keys to the specified user's keychain keyserver The keyserver to retrieve the keys from. gnupghome...
salt/states/gpg.py
def present(name, keys=None, user=None, keyserver=None, gnupghome=None, trust=None, **kwargs): ''' Ensure GPG public key is present in keychain name The unique name or keyid for the GPG public key. keys The keyId o...
def present(name, keys=None, user=None, keyserver=None, gnupghome=None, trust=None, **kwargs): ''' Ensure GPG public key is present in keychain name The unique name or keyid for the GPG public key. keys The keyId o...
[ "Ensure", "GPG", "public", "key", "is", "present", "in", "keychain" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gpg.py#L34-L136
[ "def", "present", "(", "name", ",", "keys", "=", "None", ",", "user", "=", "None", ",", "keyserver", "=", "None", ",", "gnupghome", "=", "None", ",", "trust", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure GPG public key is absent in keychain name The unique name or keyid for the GPG public key. keys The keyId or keyIds to add to the GPG keychain. user Remove GPG keys from the specified user's keychain gnupghome Override GNUPG Home directory
salt/states/gpg.py
def absent(name, keys=None, user=None, gnupghome=None, **kwargs): ''' Ensure GPG public key is absent in keychain name The unique name or keyid for the GPG public key. keys The keyId or keyIds to add to the GPG keychain. user Rem...
def absent(name, keys=None, user=None, gnupghome=None, **kwargs): ''' Ensure GPG public key is absent in keychain name The unique name or keyid for the GPG public key. keys The keyId or keyIds to add to the GPG keychain. user Rem...
[ "Ensure", "GPG", "public", "key", "is", "absent", "in", "keychain" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/gpg.py#L139-L192
[ "def", "absent", "(", "name", ",", "keys", "=", "None", ",", "user", "=", "None", ",", "gnupghome", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Extract pillar from an hg repository
salt/pillar/hg_pillar.py
def ext_pillar(minion_id, pillar, repo, branch='default', root=None): ''' Extract pillar from an hg repository ''' with Repo(repo) as repo: repo.update(branch) envname = 'base' if branch == 'default' else branch if root: path = os.path.normpath(os.path.join(repo.working_dir, root...
def ext_pillar(minion_id, pillar, repo, branch='default', root=None): ''' Extract pillar from an hg repository ''' with Repo(repo) as repo: repo.update(branch) envname = 'base' if branch == 'default' else branch if root: path = os.path.normpath(os.path.join(repo.working_dir, root...
[ "Extract", "pillar", "from", "an", "hg", "repository" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/hg_pillar.py#L69-L84
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "repo", ",", "branch", "=", "'default'", ",", "root", "=", "None", ")", ":", "with", "Repo", "(", "repo", ")", "as", "repo", ":", "repo", ".", "update", "(", "branch", ")", "envname", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Repo.update
Ensure we are using the latest revision in the hg repository
salt/pillar/hg_pillar.py
def update(self, branch='default'): ''' Ensure we are using the latest revision in the hg repository ''' log.debug('Updating hg repo from hg_pillar module (pull)') self.repo.pull() log.debug('Updating hg repo from hg_pillar module (update)') self.repo.update(branc...
def update(self, branch='default'): ''' Ensure we are using the latest revision in the hg repository ''' log.debug('Updating hg repo from hg_pillar module (pull)') self.repo.pull() log.debug('Updating hg repo from hg_pillar module (update)') self.repo.update(branc...
[ "Ensure", "we", "are", "using", "the", "latest", "revision", "in", "the", "hg", "repository" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/hg_pillar.py#L120-L127
[ "def", "update", "(", "self", ",", "branch", "=", "'default'", ")", ":", "log", ".", "debug", "(", "'Updating hg repo from hg_pillar module (pull)'", ")", "self", ".", "repo", ".", "pull", "(", ")", "log", ".", "debug", "(", "'Updating hg repo from hg_pillar mod...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
init
Open the connection to the network device managed through netmiko.
salt/proxy/netmiko_px.py
def init(opts): ''' Open the connection to the network device managed through netmiko. ''' proxy_dict = opts.get('proxy', {}) opts['multiprocessing'] = proxy_dict.get('multiprocessing', False) netmiko_connection_args = proxy_dict.copy() netmiko_connection_args.pop('proxytype', None) ...
def init(opts): ''' Open the connection to the network device managed through netmiko. ''' proxy_dict = opts.get('proxy', {}) opts['multiprocessing'] = proxy_dict.get('multiprocessing', False) netmiko_connection_args = proxy_dict.copy() netmiko_connection_args.pop('proxytype', None) ...
[ "Open", "the", "connection", "to", "the", "network", "device", "managed", "through", "netmiko", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/netmiko_px.py#L234-L257
[ "def", "init", "(", "opts", ")", ":", "proxy_dict", "=", "opts", ".", "get", "(", "'proxy'", ",", "{", "}", ")", "opts", "[", "'multiprocessing'", "]", "=", "proxy_dict", ".", "get", "(", "'multiprocessing'", ",", "False", ")", "netmiko_connection_args", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
alive
Return the connection status with the network device.
salt/proxy/netmiko_px.py
def alive(opts): ''' Return the connection status with the network device. ''' log.debug('Checking if %s is still alive', opts.get('id', '')) if not netmiko_device['always_alive']: return True if ping() and initialized(): return netmiko_device['connection'].remote_conn.transport....
def alive(opts): ''' Return the connection status with the network device. ''' log.debug('Checking if %s is still alive', opts.get('id', '')) if not netmiko_device['always_alive']: return True if ping() and initialized(): return netmiko_device['connection'].remote_conn.transport....
[ "Return", "the", "connection", "status", "with", "the", "network", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/netmiko_px.py#L260-L269
[ "def", "alive", "(", "opts", ")", ":", "log", ".", "debug", "(", "'Checking if %s is still alive'", ",", "opts", ".", "get", "(", "'id'", ",", "''", ")", ")", "if", "not", "netmiko_device", "[", "'always_alive'", "]", ":", "return", "True", "if", "ping",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call
Calls an arbitrary netmiko method.
salt/proxy/netmiko_px.py
def call(method, *args, **kwargs): ''' Calls an arbitrary netmiko method. ''' kwargs = clean_kwargs(**kwargs) if not netmiko_device['always_alive']: connection = ConnectHandler(**netmiko_device['args']) ret = getattr(connection, method)(*args, **kwargs) connection.disconnect(...
def call(method, *args, **kwargs): ''' Calls an arbitrary netmiko method. ''' kwargs = clean_kwargs(**kwargs) if not netmiko_device['always_alive']: connection = ConnectHandler(**netmiko_device['args']) ret = getattr(connection, method)(*args, **kwargs) connection.disconnect(...
[ "Calls", "an", "arbitrary", "netmiko", "method", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/netmiko_px.py#L312-L322
[ "def", "call", "(", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "clean_kwargs", "(", "*", "*", "kwargs", ")", "if", "not", "netmiko_device", "[", "'always_alive'", "]", ":", "connection", "=", "ConnectHandler", "(", "*...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
exists
Given a trail name, check to see if the given trail exists. Returns True if the given trail exists and returns False if the given trail does not exist. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.exists mytrail
salt/modules/boto_cloudtrail.py
def exists(Name, region=None, key=None, keyid=None, profile=None): ''' Given a trail name, check to see if the given trail exists. Returns True if the given trail exists and returns False if the given trail does not exist. CLI Example: .. code-block:: bash salt myminion bo...
def exists(Name, region=None, key=None, keyid=None, profile=None): ''' Given a trail name, check to see if the given trail exists. Returns True if the given trail exists and returns False if the given trail does not exist. CLI Example: .. code-block:: bash salt myminion bo...
[ "Given", "a", "trail", "name", "check", "to", "see", "if", "the", "given", "trail", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L98-L122
[ "def", "exists", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
describe
Given a trail name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.describe mytrail
salt/modules/boto_cloudtrail.py
def describe(Name, region=None, key=None, keyid=None, profile=None): ''' Given a trail name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.describe mytrail ''' try: co...
def describe(Name, region=None, key=None, keyid=None, profile=None): ''' Given a trail name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.describe mytrail ''' try: co...
[ "Given", "a", "trail", "name", "describe", "its", "properties", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L196-L229
[ "def", "describe", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
Given a trail name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.describe mytrail
salt/modules/boto_cloudtrail.py
def status(Name, region=None, key=None, keyid=None, profile=None): ''' Given a trail name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.describe mytrail ''' try: conn...
def status(Name, region=None, key=None, keyid=None, profile=None): ''' Given a trail name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.describe mytrail ''' try: conn...
[ "Given", "a", "trail", "name", "describe", "its", "properties", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L232-L270
[ "def", "status", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list
List all trails Returns list of trails CLI Example: .. code-block:: yaml policies: - {...} - {...}
salt/modules/boto_cloudtrail.py
def list(region=None, key=None, keyid=None, profile=None): ''' List all trails Returns list of trails CLI Example: .. code-block:: yaml policies: - {...} - {...} ''' try: conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) t...
def list(region=None, key=None, keyid=None, profile=None): ''' List all trails Returns list of trails CLI Example: .. code-block:: yaml policies: - {...} - {...} ''' try: conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) t...
[ "List", "all", "trails" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L273-L295
[ "def", "list", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Given a valid config, update a trail. Returns {created: true} if the trail was created and returns {created: False} if the trail was not created. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.update my_trail my_bucket
salt/modules/boto_cloudtrail.py
def update(Name, S3BucketName, S3KeyPrefix=None, SnsTopicName=None, IncludeGlobalServiceEvents=None, IsMultiRegionTrail=None, EnableLogFileValidation=None, CloudWatchLogsLogGroupArn=None, CloudWatchLogsRoleArn=None, KmsKeyId=None, ...
def update(Name, S3BucketName, S3KeyPrefix=None, SnsTopicName=None, IncludeGlobalServiceEvents=None, IsMultiRegionTrail=None, EnableLogFileValidation=None, CloudWatchLogsLogGroupArn=None, CloudWatchLogsRoleArn=None, KmsKeyId=None, ...
[ "Given", "a", "valid", "config", "update", "a", "trail", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L298-L342
[ "def", "update", "(", "Name", ",", "S3BucketName", ",", "S3KeyPrefix", "=", "None", ",", "SnsTopicName", "=", "None", ",", "IncludeGlobalServiceEvents", "=", "None", ",", "IsMultiRegionTrail", "=", "None", ",", "EnableLogFileValidation", "=", "None", ",", "Cloud...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start_logging
Start logging for a trail Returns {started: true} if the trail was started and returns {started: False} if the trail was not started. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.start_logging my_trail
salt/modules/boto_cloudtrail.py
def start_logging(Name, region=None, key=None, keyid=None, profile=None): ''' Start logging for a trail Returns {started: true} if the trail was started and returns {started: False} if the trail was not started. CLI Example: .. code-block:: bash salt myminion boto_cloudtra...
def start_logging(Name, region=None, key=None, keyid=None, profile=None): ''' Start logging for a trail Returns {started: true} if the trail was started and returns {started: False} if the trail was not started. CLI Example: .. code-block:: bash salt myminion boto_cloudtra...
[ "Start", "logging", "for", "a", "trail" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L345-L366
[ "def", "start_logging", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_tags
Add tags to a trail Returns {tagged: true} if the trail was tagged and returns {tagged: False} if the trail was not tagged. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.add_tags my_trail tag_a=tag_value tag_b=tag_value
salt/modules/boto_cloudtrail.py
def add_tags(Name, region=None, key=None, keyid=None, profile=None, **kwargs): ''' Add tags to a trail Returns {tagged: true} if the trail was tagged and returns {tagged: False} if the trail was not tagged. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.ad...
def add_tags(Name, region=None, key=None, keyid=None, profile=None, **kwargs): ''' Add tags to a trail Returns {tagged: true} if the trail was tagged and returns {tagged: False} if the trail was not tagged. CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.ad...
[ "Add", "tags", "to", "a", "trail" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L407-L435
[ "def", "add_tags", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_tags
List tags of a trail Returns: tags: - {...} - {...} CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.list_tags my_trail
salt/modules/boto_cloudtrail.py
def list_tags(Name, region=None, key=None, keyid=None, profile=None): ''' List tags of a trail Returns: tags: - {...} - {...} CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.list_tags my_trail ''' try: conn = _get_c...
def list_tags(Name, region=None, key=None, keyid=None, profile=None): ''' List tags of a trail Returns: tags: - {...} - {...} CLI Example: .. code-block:: bash salt myminion boto_cloudtrail.list_tags my_trail ''' try: conn = _get_c...
[ "List", "tags", "of", "a", "trail" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudtrail.py#L469-L499
[ "def", "list_tags", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_list_distributions
Private function that returns an iterator over all CloudFront distributions. The caller is responsible for all boto-related error handling. name (Optional) Only yield the distribution with the given name
salt/modules/boto_cloudfront.py
def _list_distributions( conn, name=None, region=None, key=None, keyid=None, profile=None, ): ''' Private function that returns an iterator over all CloudFront distributions. The caller is responsible for all boto-related error handling. name (Optional) Only yield the di...
def _list_distributions( conn, name=None, region=None, key=None, keyid=None, profile=None, ): ''' Private function that returns an iterator over all CloudFront distributions. The caller is responsible for all boto-related error handling. name (Optional) Only yield the di...
[ "Private", "function", "that", "returns", "an", "iterator", "over", "all", "CloudFront", "distributions", ".", "The", "caller", "is", "responsible", "for", "all", "boto", "-", "related", "error", "handling", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L87-L156
[ "def", "_list_distributions", "(", "conn", ",", "name", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", ")", ":", "for", "dl_", "in", "conn", ".", "get_paginator", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_distribution
Get information about a CloudFront distribution (configuration, tags) with a given name. name Name of the CloudFront distribution region Region to connect to key Secret key to use keyid Access key to use profile A dict with region, key, and keyid, ...
salt/modules/boto_cloudfront.py
def get_distribution(name, region=None, key=None, keyid=None, profile=None): ''' Get information about a CloudFront distribution (configuration, tags) with a given name. name Name of the CloudFront distribution region Region to connect to key Secret key to use keyid ...
def get_distribution(name, region=None, key=None, keyid=None, profile=None): ''' Get information about a CloudFront distribution (configuration, tags) with a given name. name Name of the CloudFront distribution region Region to connect to key Secret key to use keyid ...
[ "Get", "information", "about", "a", "CloudFront", "distribution", "(", "configuration", "tags", ")", "with", "a", "given", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L159-L231
[ "def", "get_distribution", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "distribution", "=", "_cache_id", "(", "'cloudfront'", ",", "sub_resource", "=", "name", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
export_distributions
Get details of all CloudFront distributions. Produces results that can be used to create an SLS file. CLI Example: .. code-block:: bash salt-call boto_cloudfront.export_distributions --out=txt |\ sed "s/local: //" > cloudfront_distributions.sls
salt/modules/boto_cloudfront.py
def export_distributions(region=None, key=None, keyid=None, profile=None): ''' Get details of all CloudFront distributions. Produces results that can be used to create an SLS file. CLI Example: .. code-block:: bash salt-call boto_cloudfront.export_distributions --out=txt |\ se...
def export_distributions(region=None, key=None, keyid=None, profile=None): ''' Get details of all CloudFront distributions. Produces results that can be used to create an SLS file. CLI Example: .. code-block:: bash salt-call boto_cloudfront.export_distributions --out=txt |\ se...
[ "Get", "details", "of", "all", "CloudFront", "distributions", ".", "Produces", "results", "that", "can", "be", "used", "to", "create", "an", "SLS", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L234-L278
[ "def", "export_distributions", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "results", "=", "OrderedDict", "(", ")", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_distribution
Create a CloudFront distribution with the given name, config, and (optionally) tags. name Name for the CloudFront distribution config Configuration for the distribution tags Tags to associate with the distribution region Region to connect to key Secret ke...
salt/modules/boto_cloudfront.py
def create_distribution( name, config, tags=None, region=None, key=None, keyid=None, profile=None, ): ''' Create a CloudFront distribution with the given name, config, and (optionally) tags. name Name for the CloudFront distribution config Configuration for ...
def create_distribution( name, config, tags=None, region=None, key=None, keyid=None, profile=None, ): ''' Create a CloudFront distribution with the given name, config, and (optionally) tags. name Name for the CloudFront distribution config Configuration for ...
[ "Create", "a", "CloudFront", "distribution", "with", "the", "given", "name", "config", "and", "(", "optionally", ")", "tags", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L281-L353
[ "def", "create_distribution", "(", "name", ",", "config", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", ")", ":", "if", "tags", "is", "None", ":", "tags",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_distribution
Update the config (and optionally tags) for the CloudFront distribution with the given name. name Name of the CloudFront distribution config Configuration for the distribution tags Tags to associate with the distribution region Region to connect to key Se...
salt/modules/boto_cloudfront.py
def update_distribution( name, config, tags=None, region=None, key=None, keyid=None, profile=None, ): ''' Update the config (and optionally tags) for the CloudFront distribution with the given name. name Name of the CloudFront distribution config Configurati...
def update_distribution( name, config, tags=None, region=None, key=None, keyid=None, profile=None, ): ''' Update the config (and optionally tags) for the CloudFront distribution with the given name. name Name of the CloudFront distribution config Configurati...
[ "Update", "the", "config", "(", "and", "optionally", "tags", ")", "for", "the", "CloudFront", "distribution", "with", "the", "given", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L356-L461
[ "def", "update_distribution", "(", "name", ",", "config", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", ")", ":", "### FIXME - BUG. This function can NEVER work as...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_distributions
List, with moderate information, all CloudFront distributions in the bound account. region Region to connect to. key Secret key to use. keyid Access key to use. profile Dict, or pillar key pointing to a dict, containing AWS region/key/keyid. CLI Example: .. ...
salt/modules/boto_cloudfront.py
def list_distributions(region=None, key=None, keyid=None, profile=None): ''' List, with moderate information, all CloudFront distributions in the bound account. region Region to connect to. key Secret key to use. keyid Access key to use. profile Dict, or pilla...
def list_distributions(region=None, key=None, keyid=None, profile=None): ''' List, with moderate information, all CloudFront distributions in the bound account. region Region to connect to. key Secret key to use. keyid Access key to use. profile Dict, or pilla...
[ "List", "with", "moderate", "information", "all", "CloudFront", "distributions", "in", "the", "bound", "account", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L564-L609
[ "def", "list_distributions", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "retries", "=", "10", "sleep", "=", "6", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
distribution_exists
Return True if a CloudFront distribution exists with the given Resource ID or False otherwise. Id Resource ID of the CloudFront distribution. region Region to connect to. key Secret key to use. keyid Access key to use. profile Dict, or pillar key pointing...
salt/modules/boto_cloudfront.py
def distribution_exists(Id, region=None, key=None, keyid=None, profile=None): ''' Return True if a CloudFront distribution exists with the given Resource ID or False otherwise. Id Resource ID of the CloudFront distribution. region Region to connect to. key Secret key to us...
def distribution_exists(Id, region=None, key=None, keyid=None, profile=None): ''' Return True if a CloudFront distribution exists with the given Resource ID or False otherwise. Id Resource ID of the CloudFront distribution. region Region to connect to. key Secret key to us...
[ "Return", "True", "if", "a", "CloudFront", "distribution", "exists", "with", "the", "given", "Resource", "ID", "or", "False", "otherwise", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L612-L640
[ "def", "distribution_exists", "(", "Id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "authargs", "=", "{", "'region'", ":", "region", ",", "'key'", ":", "key", ",", "'keyid'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_distributions_by_comment
Find and return any CloudFront distributions which happen to have a Comment sub-field either exactly matching the given Comment, or beginning with it AND with the remainder separated by a colon. Comment The string to be matched when searching for the given Distribution. Note that this will...
salt/modules/boto_cloudfront.py
def get_distributions_by_comment(Comment, region=None, key=None, keyid=None, profile=None): ''' Find and return any CloudFront distributions which happen to have a Comment sub-field either exactly matching the given Comment, or beginning with it AND with the remainder separated by a colon. Comment ...
def get_distributions_by_comment(Comment, region=None, key=None, keyid=None, profile=None): ''' Find and return any CloudFront distributions which happen to have a Comment sub-field either exactly matching the given Comment, or beginning with it AND with the remainder separated by a colon. Comment ...
[ "Find", "and", "return", "any", "CloudFront", "distributions", "which", "happen", "to", "have", "a", "Comment", "sub", "-", "field", "either", "exactly", "matching", "the", "given", "Comment", "or", "beginning", "with", "it", "AND", "with", "the", "remainder",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L643-L688
[ "def", "get_distributions_by_comment", "(", "Comment", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "'Dereferincing CloudFront distribution(s) by Comment `%s`.'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disable_distribution
Set a CloudFront distribution to be disabled. Id Id of the distribution to update. region Region to connect to. key Secret key to use. keyid Access key to use. profile Dict, or pillar key pointing to a dict, containing AWS region/key/keyid. CLI Examp...
salt/modules/boto_cloudfront.py
def disable_distribution(region=None, key=None, keyid=None, profile=None, **kwargs): ''' Set a CloudFront distribution to be disabled. Id Id of the distribution to update. region Region to connect to. key Secret key to use. keyid Access key to use. profil...
def disable_distribution(region=None, key=None, keyid=None, profile=None, **kwargs): ''' Set a CloudFront distribution to be disabled. Id Id of the distribution to update. region Region to connect to. key Secret key to use. keyid Access key to use. profil...
[ "Set", "a", "CloudFront", "distribution", "to", "be", "disabled", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L978-L1036
[ "def", "disable_distribution", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "retries", "=", "10", "sleep", "=", "6", "kwargs", "=", "{", "k", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_cloud_front_origin_access_identities_by_comment
Find and return any CloudFront Origin Access Identities which happen to have a Comment sub-field either exactly matching the given Comment, or beginning with it AND with the remainder separate by a colon. Comment The string to be matched when searching for the given Origin Access Identity. Note ...
salt/modules/boto_cloudfront.py
def get_cloud_front_origin_access_identities_by_comment(Comment, region=None, key=None, keyid=None, profile=None): ''' Find and return any CloudFront Origin Access Identities which happen to have a Comment sub-field either exactly matching the given Co...
def get_cloud_front_origin_access_identities_by_comment(Comment, region=None, key=None, keyid=None, profile=None): ''' Find and return any CloudFront Origin Access Identities which happen to have a Comment sub-field either exactly matching the given Co...
[ "Find", "and", "return", "any", "CloudFront", "Origin", "Access", "Identities", "which", "happen", "to", "have", "a", "Comment", "sub", "-", "field", "either", "exactly", "matching", "the", "given", "Comment", "or", "beginning", "with", "it", "AND", "with", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1237-L1283
[ "def", "get_cloud_front_origin_access_identities_by_comment", "(", "Comment", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "log", ".", "debug", "(", "'Dereferincing CloudFront origin access ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cloud_front_origin_access_identity_exists
Return True if a CloudFront origin access identity exists with the given Resource ID or False otherwise. Id Resource ID of the CloudFront origin access identity. region Region to connect to. key Secret key to use. keyid Access key to use. profile Dict...
salt/modules/boto_cloudfront.py
def cloud_front_origin_access_identity_exists(Id, region=None, key=None, keyid=None, profile=None): ''' Return True if a CloudFront origin access identity exists with the given Resource ID or False otherwise. Id Resource ID of the CloudFront origin access identity. region Region to...
def cloud_front_origin_access_identity_exists(Id, region=None, key=None, keyid=None, profile=None): ''' Return True if a CloudFront origin access identity exists with the given Resource ID or False otherwise. Id Resource ID of the CloudFront origin access identity. region Region to...
[ "Return", "True", "if", "a", "CloudFront", "origin", "access", "identity", "exists", "with", "the", "given", "Resource", "ID", "or", "False", "otherwise", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1455-L1484
[ "def", "cloud_front_origin_access_identity_exists", "(", "Id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "authargs", "=", "{", "'region'", ":", "region", ",", "'key'", ":", "key...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tag_resource
Add tags to a CloudFront resource. Resource The ARN of the affected CloudFront resource. Tags Dict of {'Tag': 'Value', ...} providing the tags to be set. region Region to connect to. key Secret key to use. keyid Access key to use. profile Dic...
salt/modules/boto_cloudfront.py
def tag_resource(region=None, key=None, keyid=None, profile=None, **kwargs): ''' Add tags to a CloudFront resource. Resource The ARN of the affected CloudFront resource. Tags Dict of {'Tag': 'Value', ...} providing the tags to be set. region Region to connect to. key ...
def tag_resource(region=None, key=None, keyid=None, profile=None, **kwargs): ''' Add tags to a CloudFront resource. Resource The ARN of the affected CloudFront resource. Tags Dict of {'Tag': 'Value', ...} providing the tags to be set. region Region to connect to. key ...
[ "Add", "tags", "to", "a", "CloudFront", "resource", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1537-L1588
[ "def", "tag_resource", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "kwargs", ")", ":", "retries", "=", "10", "sleep", "=", "6", "kwargs", "=", "{", "k", ":", "v", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enforce_tags
Enforce a given set of tags on a CloudFront resource: adding, removing, or changing them as necessary to ensure the resource's tags are exactly and only those specified. Resource The ARN of the affected CloudFront resource. Tags Dict of {'Tag': 'Value', ...} providing the tags to be enfor...
salt/modules/boto_cloudfront.py
def enforce_tags(Resource, Tags, region=None, key=None, keyid=None, profile=None): ''' Enforce a given set of tags on a CloudFront resource: adding, removing, or changing them as necessary to ensure the resource's tags are exactly and only those specified. Resource The ARN of the affected Clou...
def enforce_tags(Resource, Tags, region=None, key=None, keyid=None, profile=None): ''' Enforce a given set of tags on a CloudFront resource: adding, removing, or changing them as necessary to ensure the resource's tags are exactly and only those specified. Resource The ARN of the affected Clou...
[ "Enforce", "a", "given", "set", "of", "tags", "on", "a", "CloudFront", "resource", ":", "adding", "removing", "or", "changing", "them", "as", "necessary", "to", "ensure", "the", "resource", "s", "tags", "are", "exactly", "and", "only", "those", "specified", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cloudfront.py#L1644-L1692
[ "def", "enforce_tags", "(", "Resource", ",", "Tags", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "authargs", "=", "{", "'region'", ":", "region", ",", "'key'", ":", "key", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_file_read
Read a file and return content
salt/states/pcs.py
def _file_read(path): ''' Read a file and return content ''' content = False if os.path.exists(path): with salt.utils.files.fopen(path, 'r+') as fp_: content = salt.utils.stringutils.to_unicode(fp_.read()) fp_.close() return content
def _file_read(path): ''' Read a file and return content ''' content = False if os.path.exists(path): with salt.utils.files.fopen(path, 'r+') as fp_: content = salt.utils.stringutils.to_unicode(fp_.read()) fp_.close() return content
[ "Read", "a", "file", "and", "return", "content" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L191-L200
[ "def", "_file_read", "(", "path", ")", ":", "content", "=", "False", "if", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'r+'", ")", "as", "fp_", ":", "conten...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_file_write
Write content to a file
salt/states/pcs.py
def _file_write(path, content): ''' Write content to a file ''' with salt.utils.files.fopen(path, 'w+') as fp_: fp_.write(salt.utils.stringutils.to_str(content)) fp_.close()
def _file_write(path, content): ''' Write content to a file ''' with salt.utils.files.fopen(path, 'w+') as fp_: fp_.write(salt.utils.stringutils.to_str(content)) fp_.close()
[ "Write", "content", "to", "a", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L203-L209
[ "def", "_file_write", "(", "path", ",", "content", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'w+'", ")", "as", "fp_", ":", "fp_", ".", "write", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_str...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_cibpath
Get the path to the directory on the minion where CIB's are saved
salt/states/pcs.py
def _get_cibpath(): ''' Get the path to the directory on the minion where CIB's are saved ''' cibpath = os.path.join(__opts__['cachedir'], 'pcs', __env__) log.trace('cibpath: %s', cibpath) return cibpath
def _get_cibpath(): ''' Get the path to the directory on the minion where CIB's are saved ''' cibpath = os.path.join(__opts__['cachedir'], 'pcs', __env__) log.trace('cibpath: %s', cibpath) return cibpath
[ "Get", "the", "path", "to", "the", "directory", "on", "the", "minion", "where", "CIB", "s", "are", "saved" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L212-L218
[ "def", "_get_cibpath", "(", ")", ":", "cibpath", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'pcs'", ",", "__env__", ")", "log", ".", "trace", "(", "'cibpath: %s'", ",", "cibpath", ")", "return", "cibpath" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_cibfile
Get the full path of a cached CIB-file with the name of the CIB
salt/states/pcs.py
def _get_cibfile(cibname): ''' Get the full path of a cached CIB-file with the name of the CIB ''' cibfile = os.path.join(_get_cibpath(), '{0}.{1}'.format(cibname, 'cib')) log.trace('cibfile: %s', cibfile) return cibfile
def _get_cibfile(cibname): ''' Get the full path of a cached CIB-file with the name of the CIB ''' cibfile = os.path.join(_get_cibpath(), '{0}.{1}'.format(cibname, 'cib')) log.trace('cibfile: %s', cibfile) return cibfile
[ "Get", "the", "full", "path", "of", "a", "cached", "CIB", "-", "file", "with", "the", "name", "of", "the", "CIB" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L221-L227
[ "def", "_get_cibfile", "(", "cibname", ")", ":", "cibfile", "=", "os", ".", "path", ".", "join", "(", "_get_cibpath", "(", ")", ",", "'{0}.{1}'", ".", "format", "(", "cibname", ",", "'cib'", ")", ")", "log", ".", "trace", "(", "'cibfile: %s'", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_cibfile_tmp
Get the full path of a temporary CIB-file with the name of the CIB
salt/states/pcs.py
def _get_cibfile_tmp(cibname): ''' Get the full path of a temporary CIB-file with the name of the CIB ''' cibfile_tmp = '{0}.tmp'.format(_get_cibfile(cibname)) log.trace('cibfile_tmp: %s', cibfile_tmp) return cibfile_tmp
def _get_cibfile_tmp(cibname): ''' Get the full path of a temporary CIB-file with the name of the CIB ''' cibfile_tmp = '{0}.tmp'.format(_get_cibfile(cibname)) log.trace('cibfile_tmp: %s', cibfile_tmp) return cibfile_tmp
[ "Get", "the", "full", "path", "of", "a", "temporary", "CIB", "-", "file", "with", "the", "name", "of", "the", "CIB" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L230-L236
[ "def", "_get_cibfile_tmp", "(", "cibname", ")", ":", "cibfile_tmp", "=", "'{0}.tmp'", ".", "format", "(", "_get_cibfile", "(", "cibname", ")", ")", "log", ".", "trace", "(", "'cibfile_tmp: %s'", ",", "cibfile_tmp", ")", "return", "cibfile_tmp" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_cibfile_cksum
Get the full path of the file containing a checksum of a CIB-file with the name of the CIB
salt/states/pcs.py
def _get_cibfile_cksum(cibname): ''' Get the full path of the file containing a checksum of a CIB-file with the name of the CIB ''' cibfile_cksum = '{0}.cksum'.format(_get_cibfile(cibname)) log.trace('cibfile_cksum: %s', cibfile_cksum) return cibfile_cksum
def _get_cibfile_cksum(cibname): ''' Get the full path of the file containing a checksum of a CIB-file with the name of the CIB ''' cibfile_cksum = '{0}.cksum'.format(_get_cibfile(cibname)) log.trace('cibfile_cksum: %s', cibfile_cksum) return cibfile_cksum
[ "Get", "the", "full", "path", "of", "the", "file", "containing", "a", "checksum", "of", "a", "CIB", "-", "file", "with", "the", "name", "of", "the", "CIB" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pcs.py#L239-L245
[ "def", "_get_cibfile_cksum", "(", "cibname", ")", ":", "cibfile_cksum", "=", "'{0}.cksum'", ".", "format", "(", "_get_cibfile", "(", "cibname", ")", ")", "log", ".", "trace", "(", "'cibfile_cksum: %s'", ",", "cibfile_cksum", ")", "return", "cibfile_cksum" ]
e8541fd6e744ab0df786c0f76102e41631f45d46