repository_name
stringclasses
316 values
func_path_in_repository
stringlengths
6
223
func_name
stringlengths
1
134
language
stringclasses
1 value
func_code_string
stringlengths
57
65.5k
func_documentation_string
stringlengths
1
46.3k
split_name
stringclasses
1 value
func_code_url
stringlengths
91
315
called_functions
listlengths
1
156
enclosing_scope
stringlengths
2
1.48M
saltstack/salt
salt/modules/postgres.py
is_installed_extension
python
def is_installed_extension(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None): ''' Test if a specific extension is...
Test if a specific extension is installed CLI Example: .. code-block:: bash salt '*' postgres.is_installed_extension
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1514-L1539
[ "def get_installed_extension(name,\n user=None,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None):\n '''\n Get info ab...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
create_metadata
python
def create_metadata(name, ext_version=None, schema=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None): ''' Get lifec...
Get lifecycle information about an extension CLI Example: .. code-block:: bash salt '*' postgres.create_metadata adminpack
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1542-L1586
[ "def get_installed_extension(name,\n user=None,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None):\n '''\n Get info ab...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
drop_extension
python
def drop_extension(name, if_exists=None, restrict=None, cascade=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None...
Drop an installed postgresql extension CLI Example: .. code-block:: bash salt '*' postgres.drop_extension 'adminpack'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1589-L1645
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
create_extension
python
def create_extension(name, if_not_exists=None, schema=None, ext_version=None, from_version=None, user=None, host=None, port=None, maintenance_db=None, ...
Install a postgresql extension CLI Example: .. code-block:: bash salt '*' postgres.create_extension 'adminpack'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1648-L1735
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
user_remove
python
def user_remove(username, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None): ''' Removes a user from the Postgres server. CLI Example: .. code-block:: bash salt '*' p...
Removes a user from the Postgres server. CLI Example: .. code-block:: bash salt '*' postgres.user_remove 'username'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1738-L1760
[ "def _role_remove(name, user=None, host=None, port=None, maintenance_db=None,\n password=None, runas=None):\n '''\n Removes a role from the Postgres Server\n '''\n\n # check if user exists\n if not user_exists(name, user, host, port, maintenance_db,\n password=pa...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
group_create
python
def group_create(groupname, user=None, host=None, port=None, maintenance_db=None, password=None, createdb=None, createroles=None, encrypted=None, login=None, ...
Creates a Postgres group. A group is postgres is similar to a user, but cannot login. CLI Example: .. code-block:: bash salt '*' postgres.group_create 'groupname' user='user' \\ host='hostname' port='port' password='password' \\ rolepassword='rolepassword'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1765-L1809
[ "def _role_create(name,\n user=None,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n createdb=None,\n createroles=None,\n encrypted=None,\n superuser=No...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
group_remove
python
def group_remove(groupname, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None): ''' Removes a group from the Postgres server. CLI Example: .. code-block:: bash s...
Removes a group from the Postgres server. CLI Example: .. code-block:: bash salt '*' postgres.group_remove 'groupname'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1858-L1880
[ "def _role_remove(name, user=None, host=None, port=None, maintenance_db=None,\n password=None, runas=None):\n '''\n Removes a role from the Postgres Server\n '''\n\n # check if user exists\n if not user_exists(name, user, host, port, maintenance_db,\n password=pa...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
owner_to
python
def owner_to(dbname, ownername, user=None, host=None, port=None, password=None, runas=None): ''' Set the owner of all schemas, functions, tables, views and sequences to the given username. CLI Example: .. code-block:: ba...
Set the owner of all schemas, functions, tables, views and sequences to the given username. CLI Example: .. code-block:: bash salt '*' postgres.owner_to 'dbname' 'username'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1883-L1955
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
schema_create
python
def schema_create(dbname, name, owner=None, user=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Creates a Postgres schema. CLI Example: .. code-block:: bash salt '*' postgres.schema_create dbname name owner='owner' ...
Creates a Postgres schema. CLI Example: .. code-block:: bash salt '*' postgres.schema_create dbname name owner='owner' \\ user='user' \\ db_user='user' db_password='password' db_host='hostname' db_port='port'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1960-L1993
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
schema_remove
python
def schema_remove(dbname, name, user=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Removes a schema from the Postgres server. CLI Example: .. code-block:: bash salt '*' postgres.schema_remove dbname schemaname ...
Removes a schema from the Postgres server. CLI Example: .. code-block:: bash salt '*' postgres.schema_remove dbname schemaname dbname Database name we work on schemaname The schema's name we'll remove user System user all operations should be performed on behalf...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L1996-L2053
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
schema_exists
python
def schema_exists(dbname, name, user=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Checks if a schema exists on the Postgres server. CLI Example: .. code-block:: bash salt '*' postgres.schema_exists dbname schemaname dbname ...
Checks if a schema exists on the Postgres server. CLI Example: .. code-block:: bash salt '*' postgres.schema_exists dbname schemaname dbname Database name we query on name Schema name we look for user The system user the operation should be performed on behalf of...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2056-L2095
[ "def schema_get(dbname, name, user=None,\n db_user=None, db_password=None,\n db_host=None, db_port=None):\n '''\n Return a dict with information about schemas in a database.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' postgres.schema_get dbname name\n\n d...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
schema_get
python
def schema_get(dbname, name, user=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Return a dict with information about schemas in a database. CLI Example: .. code-block:: bash salt '*' postgres.schema_get dbname name dbname Dat...
Return a dict with information about schemas in a database. CLI Example: .. code-block:: bash salt '*' postgres.schema_get dbname name dbname Database name we query on name Schema name we look for user The system user the operation should be performed on behalf o...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2098-L2140
[ "def schema_list(dbname, user=None,\n db_user=None, db_password=None,\n db_host=None, db_port=None):\n '''\n Return a dict with information about schemas in a Postgres database.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' postgres.schema_list dbname\n\n ...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
schema_list
python
def schema_list(dbname, user=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Return a dict with information about schemas in a Postgres database. CLI Example: .. code-block:: bash salt '*' postgres.schema_list dbname dbname D...
Return a dict with information about schemas in a Postgres database. CLI Example: .. code-block:: bash salt '*' postgres.schema_list dbname dbname Database name we query on user The system user the operation should be performed on behalf of db_user database user...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2143-L2198
[ "def psql_query(query, user=None, host=None, port=None, maintenance_db=None,\n password=None, runas=None, write=False):\n '''\n Run an SQL-Query and return the results as a list. This command\n only supports SELECT statements. This limitation can be worked around\n with a query like this:...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
language_list
python
def language_list( maintenance_db, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2016.3.0 Return a list of languages in a database. CLI Example: .. code-block:: bash salt '*' postgres.language_list dbnam...
.. versionadded:: 2016.3.0 Return a list of languages in a database. CLI Example: .. code-block:: bash salt '*' postgres.language_list dbname maintenance_db The database to check user database username if different from config or default password user passw...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2201-L2253
[ "def psql_query(query, user=None, host=None, port=None, maintenance_db=None,\n password=None, runas=None, write=False):\n '''\n Run an SQL-Query and return the results as a list. This command\n only supports SELECT statements. This limitation can be worked around\n with a query like this:...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
language_exists
python
def language_exists( name, maintenance_db, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2016.3.0 Checks if language exists in a database. CLI Example: .. code-block:: bash salt '*' postgres.lang...
.. versionadded:: 2016.3.0 Checks if language exists in a database. CLI Example: .. code-block:: bash salt '*' postgres.language_exists plpgsql dbname name Language to check for maintenance_db The database to check in user database username if different from...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2256-L2303
[ "def language_list(\n maintenance_db,\n user=None,\n host=None,\n port=None,\n password=None,\n runas=None):\n '''\n .. versionadded:: 2016.3.0\n\n Return a list of languages in a database.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' postgre...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
language_create
python
def language_create(name, maintenance_db, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2016.3.0 Installs a language into a database CLI Example:...
.. versionadded:: 2016.3.0 Installs a language into a database CLI Example: .. code-block:: bash salt '*' postgres.language_create plpgsql dbname name Language to install maintenance_db The database to install the language in user database username if differ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2306-L2360
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_make_default_privileges_list_query
python
def _make_default_privileges_list_query(name, object_type, prepend): ''' Generate the SQL required for specific object type ''' if object_type == 'table': query = (' '.join([ 'SELECT defacl.defaclacl AS name', 'FROM pg_default_acl defacl', 'JOIN pg_authid aid'...
Generate the SQL required for specific object type
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2420-L2480
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_make_privileges_list_query
python
def _make_privileges_list_query(name, object_type, prepend): ''' Generate the SQL required for specific object type ''' if object_type == 'table': query = (' '.join([ 'SELECT relacl AS name', 'FROM pg_catalog.pg_class c', 'JOIN pg_catalog.pg_namespace n', ...
Generate the SQL required for specific object type
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2483-L2560
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_get_object_owner
python
def _get_object_owner(name, object_type, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' Return the owner of a postgres object ''' if object_type == 'table': query = (' '.join(...
Return the owner of a postgres object
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2563-L2650
[ "def psql_query(query, user=None, host=None, port=None, maintenance_db=None,\n password=None, runas=None, write=False):\n '''\n Run an SQL-Query and return the results as a list. This command\n only supports SELECT statements. This limitation can be worked around\n with a query like this:...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_validate_default_privileges
python
def _validate_default_privileges(object_type, defprivs, defprivileges): ''' Validate the supplied privileges ''' if object_type != 'group': _defperms = [_DEFAULT_PRIVILEGES_MAP[defperm] for defperm in _DEFAULT_PRIVILEGE_TYPE_MAP[object_type]] _defperms.append('ALL') ...
Validate the supplied privileges
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2653-L2674
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_mod_defpriv_opts
python
def _mod_defpriv_opts(object_type, defprivileges): ''' Format options ''' object_type = object_type.lower() defprivileges = '' if defprivileges is None else defprivileges _defprivs = re.split(r'\s?,\s?', defprivileges.upper()) return object_type, defprivileges, _defprivs
Format options
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2677-L2685
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_process_defpriv_part
python
def _process_defpriv_part(defperms): ''' Process part ''' _tmp = {} previous = None for defperm in defperms: if previous is None: _tmp[_DEFAULT_PRIVILEGES_MAP[defperm]] = False previous = _DEFAULT_PRIVILEGES_MAP[defperm] else: if defperm == '*'...
Process part
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2688-L2704
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_validate_privileges
python
def _validate_privileges(object_type, privs, privileges): ''' Validate the supplied privileges ''' if object_type != 'group': _perms = [_PRIVILEGES_MAP[perm] for perm in _PRIVILEGE_TYPE_MAP[object_type]] _perms.append('ALL') if object_type not in _PRIVILEGES_OBJE...
Validate the supplied privileges
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2707-L2728
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_mod_priv_opts
python
def _mod_priv_opts(object_type, privileges): ''' Format options ''' object_type = object_type.lower() privileges = '' if privileges is None else privileges _privs = re.split(r'\s?,\s?', privileges.upper()) return object_type, privileges, _privs
Format options
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2731-L2739
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
_process_priv_part
python
def _process_priv_part(perms): ''' Process part ''' _tmp = {} previous = None for perm in perms: if previous is None: _tmp[_PRIVILEGES_MAP[perm]] = False previous = _PRIVILEGES_MAP[perm] else: if perm == '*': _tmp[previous] = Tr...
Process part
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2742-L2758
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
default_privileges_list
python
def default_privileges_list( name, object_type, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2019.0.0 Return a list of default privileges for the specified ob...
.. versionadded:: 2019.0.0 Return a list of default privileges for the specified object. CLI Example: .. code-block:: bash salt '*' postgres.default_privileges_list table_name table maintenance_db=db_name name Name of the object for which the permissions should be returned objec...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2761-L2854
[ "def psql_query(query, user=None, host=None, port=None, maintenance_db=None,\n password=None, runas=None, write=False):\n '''\n Run an SQL-Query and return the results as a list. This command\n only supports SELECT statements. This limitation can be worked around\n with a query like this:...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
privileges_list
python
def privileges_list( name, object_type, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2016.3.0 Return a list of privileges for the specified object. CLI E...
.. versionadded:: 2016.3.0 Return a list of privileges for the specified object. CLI Example: .. code-block:: bash salt '*' postgres.privileges_list table_name table maintenance_db=db_name name Name of the object for which the permissions should be returned object_type Th...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2857-L2953
[ "def psql_query(query, user=None, host=None, port=None, maintenance_db=None,\n password=None, runas=None, write=False):\n '''\n Run an SQL-Query and return the results as a list. This command\n only supports SELECT statements. This limitation can be worked around\n with a query like this:...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
has_default_privileges
python
def has_default_privileges(name, object_name, object_type, defprivileges=None, grant_option=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2019...
.. versionadded:: 2019.0.0 Check if a role has the specified privileges on an object CLI Example: .. code-block:: bash salt '*' postgres.has_default_privileges user_name table_name table \\ SELECT,INSERT maintenance_db=db_name name Name of the role whose privileges should be ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L2956-L3071
[ "def _get_object_owner(name,\n object_type,\n prepend='public',\n maintenance_db=None,\n user=None,\n host=None,\n port=None,\n password=None,\n runas=None):\n '''\n Return the owner of a postgres object\n '''\n if object_type == 'table':\n ...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
has_privileges
python
def has_privileges(name, object_name, object_type, privileges=None, grant_option=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2016.3.0 C...
.. versionadded:: 2016.3.0 Check if a role has the specified privileges on an object CLI Example: .. code-block:: bash salt '*' postgres.has_privileges user_name table_name table \\ SELECT,INSERT maintenance_db=db_name name Name of the role whose privileges should be checked ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L3074-L3194
[ "def _get_object_owner(name,\n object_type,\n prepend='public',\n maintenance_db=None,\n user=None,\n host=None,\n port=None,\n password=None,\n runas=None):\n '''\n Return the owner of a postgres object\n '''\n if object_type == 'table':\n ...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
default_privileges_grant
python
def default_privileges_grant(name, object_name, object_type, defprivileges=None, grant_option=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 20...
.. versionadded:: 2019.0.0 Grant default privileges on a postgres object CLI Example: .. code-block:: bash salt '*' postgres.default_privileges_grant user_name table_name table \\ SELECT,UPDATE maintenance_db=db_name name Name of the role to which default privileges should be...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L3197-L3328
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
default_privileges_revoke
python
def default_privileges_revoke(name, object_name, object_type, defprivileges=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2019.0.0 Revoke default...
.. versionadded:: 2019.0.0 Revoke default privileges on a postgres object CLI Example: .. code-block:: bash salt '*' postgres.default_privileges_revoke user_name table_name table \\ SELECT,UPDATE maintenance_db=db_name name Name of the role whose default privileges should be ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L3331-L3434
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
privileges_grant
python
def privileges_grant(name, object_name, object_type, privileges=None, grant_option=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2016.3.0 ...
.. versionadded:: 2016.3.0 Grant privileges on a postgres object CLI Example: .. code-block:: bash salt '*' postgres.privileges_grant user_name table_name table \\ SELECT,UPDATE maintenance_db=db_name name Name of the role to which privileges should be granted object_nam...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L3437-L3573
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
privileges_revoke
python
def privileges_revoke(name, object_name, object_type, privileges=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None): ''' .. versionadded:: 2016.3.0 Revoke privileges on a po...
.. versionadded:: 2016.3.0 Revoke privileges on a postgres object CLI Example: .. code-block:: bash salt '*' postgres.privileges_revoke user_name table_name table \\ SELECT,UPDATE maintenance_db=db_name name Name of the role whose privileges should be revoked object_name...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L3576-L3684
[ "def _psql_prepare_and_run(cmd,\n host=None,\n port=None,\n maintenance_db=None,\n password=None,\n runas=None,\n user=None):\n rcmd = _psql_cmd(\n host=hos...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
datadir_init
python
def datadir_init(name, auth='password', user=None, password=None, encoding='UTF8', locale=None, waldir=None, checksums=False, runas=None): ''' .. versionadded:: 2016.3.0 Initializes a postgres data directory CLI Example: .. code-bloc...
.. versionadded:: 2016.3.0 Initializes a postgres data directory CLI Example: .. code-block:: bash salt '*' postgres.datadir_init '/var/lib/pgsql/data' name The name of the directory to initialize auth The default authentication method for local connections passwor...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L3687-L3754
[ "def datadir_exists(name):\n '''\n .. versionadded:: 2016.3.0\n\n Checks if postgres data directory has been initialized\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' postgres.datadir_exists '/var/lib/pgsql/data'\n\n name\n Name of the directory to check\n '''\n _versi...
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/postgres.py
datadir_exists
python
def datadir_exists(name): ''' .. versionadded:: 2016.3.0 Checks if postgres data directory has been initialized CLI Example: .. code-block:: bash salt '*' postgres.datadir_exists '/var/lib/pgsql/data' name Name of the directory to check ''' _version_file = os.path.jo...
.. versionadded:: 2016.3.0 Checks if postgres data directory has been initialized CLI Example: .. code-block:: bash salt '*' postgres.datadir_exists '/var/lib/pgsql/data' name Name of the directory to check
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/postgres.py#L3757-L3775
null
# -*- coding: utf-8 -*- ''' Module to provide Postgres compatibility to salt. :configuration: In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:: postgres.host: 'localhost' postgres.port: '5432' ...
saltstack/salt
salt/modules/eselect.py
exec_action
python
def exec_action(module, action, module_parameter=None, action_parameter=None, state_only=False): ''' Execute an arbitrary action on a module. module name of the module to be executed action name of the module's action to be run module_parameter additional params passed to ...
Execute an arbitrary action on a module. module name of the module to be executed action name of the module's action to be run module_parameter additional params passed to the defined module action_parameter additional params passed to the defined action state_on...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/eselect.py#L25-L69
null
# -*- coding: utf-8 -*- ''' Support for eselect, Gentoo's configuration and management tool. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import salt libs import salt.utils.path log = logging.getLogger(__name__) def __virtual__(): ''' On...
saltstack/salt
salt/modules/eselect.py
get_modules
python
def get_modules(): ''' List available ``eselect`` modules. CLI Example: .. code-block:: bash salt '*' eselect.get_modules ''' modules = [] module_list = exec_action('modules', 'list', action_parameter='--only-names') if not module_list: return None for module in m...
List available ``eselect`` modules. CLI Example: .. code-block:: bash salt '*' eselect.get_modules
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/eselect.py#L72-L90
[ "def exec_action(module, action, module_parameter=None, action_parameter=None, state_only=False):\n '''\n Execute an arbitrary action on a module.\n\n module\n name of the module to be executed\n\n action\n name of the module's action to be run\n\n module_parameter\n additional p...
# -*- coding: utf-8 -*- ''' Support for eselect, Gentoo's configuration and management tool. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import salt libs import salt.utils.path log = logging.getLogger(__name__) def __virtual__(): ''' On...
saltstack/salt
salt/modules/eselect.py
get_target_list
python
def get_target_list(module, action_parameter=None): ''' List available targets for the given module. module name of the module to be queried for its targets action_parameter additional params passed to the defined action .. versionadded:: 2016.11.0 CLI Example: .. co...
List available targets for the given module. module name of the module to be queried for its targets action_parameter additional params passed to the defined action .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' eselect.get_target_list kernel
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/eselect.py#L93-L121
[ "def exec_action(module, action, module_parameter=None, action_parameter=None, state_only=False):\n '''\n Execute an arbitrary action on a module.\n\n module\n name of the module to be executed\n\n action\n name of the module's action to be run\n\n module_parameter\n additional p...
# -*- coding: utf-8 -*- ''' Support for eselect, Gentoo's configuration and management tool. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import salt libs import salt.utils.path log = logging.getLogger(__name__) def __virtual__(): ''' On...
saltstack/salt
salt/modules/eselect.py
get_current_target
python
def get_current_target(module, module_parameter=None, action_parameter=None): ''' Get the currently selected target for the given module. module name of the module to be queried for its current target module_parameter additional params passed to the defined module action_parameter...
Get the currently selected target for the given module. module name of the module to be queried for its current target module_parameter additional params passed to the defined module action_parameter additional params passed to the 'show' action CLI Example (current target of...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/eselect.py#L124-L156
[ "def exec_action(module, action, module_parameter=None, action_parameter=None, state_only=False):\n '''\n Execute an arbitrary action on a module.\n\n module\n name of the module to be executed\n\n action\n name of the module's action to be run\n\n module_parameter\n additional p...
# -*- coding: utf-8 -*- ''' Support for eselect, Gentoo's configuration and management tool. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import salt libs import salt.utils.path log = logging.getLogger(__name__) def __virtual__(): ''' On...
saltstack/salt
salt/modules/eselect.py
set_target
python
def set_target(module, target, module_parameter=None, action_parameter=None): ''' Set the target for the given module. Target can be specified by index or name. module name of the module for which a target should be set target name of the target to be set for this module modul...
Set the target for the given module. Target can be specified by index or name. module name of the module for which a target should be set target name of the target to be set for this module module_parameter additional params passed to the defined module action_parameter ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/eselect.py#L159-L201
[ "def get_modules():\n '''\n List available ``eselect`` modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' eselect.get_modules\n '''\n modules = []\n module_list = exec_action('modules', 'list', action_parameter='--only-names')\n if not module_list:\n return None\n\...
# -*- coding: utf-8 -*- ''' Support for eselect, Gentoo's configuration and management tool. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import salt libs import salt.utils.path log = logging.getLogger(__name__) def __virtual__(): ''' On...
saltstack/salt
salt/thorium/calc.py
calc
python
def calc(name, num, oper, minimum=0, maximum=0, ref=None): ''' Perform a calculation on the ``num`` most recent values. Requires a list. Valid values for ``oper`` are: - add: Add last ``num`` values together - mul: Multiple last ``num`` values together - mean: Calculate mean of last ``num`` val...
Perform a calculation on the ``num`` most recent values. Requires a list. Valid values for ``oper`` are: - add: Add last ``num`` values together - mul: Multiple last ``num`` values together - mean: Calculate mean of last ``num`` values - median: Calculate median of last ``num`` values - median_...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L28-L108
null
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
add
python
def add(name, num, minimum=0, maximum=0, ref=None): ''' Adds together the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.add: - name: myregentry - num: 5 ''' return calc( name=name, num=num, ...
Adds together the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.add: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L111-L131
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
mul
python
def mul(name, num, minimum=0, maximum=0, ref=None): ''' Multiplies together the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.mul: - name: myregentry - num: 5 ''' return calc( name=name, num=num, ...
Multiplies together the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.mul: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L134-L154
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
mean
python
def mean(name, num, minimum=0, maximum=0, ref=None): ''' Calculates the mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.mean: - name: myregentry - num: 5 ''' return calc( name=name, num=nu...
Calculates the mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.mean: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L157-L177
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
median
python
def median(name, num, minimum=0, maximum=0, ref=None): ''' Calculates the mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median: - name: myregentry - num: 5 ''' return calc( name=name, nu...
Calculates the mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L180-L200
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
median_low
python
def median_low(name, num, minimum=0, maximum=0, ref=None): ''' Calculates the low mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median_low: - name: myregentry - num: 5 ''' return calc( name=name...
Calculates the low mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median_low: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L203-L223
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
median_high
python
def median_high(name, num, minimum=0, maximum=0, ref=None): ''' Calculates the high mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median_high: - name: myregentry - num: 5 ''' return calc( name=n...
Calculates the high mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median_high: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L226-L246
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
median_grouped
python
def median_grouped(name, num, minimum=0, maximum=0, ref=None): ''' Calculates the grouped mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median_grouped: - name: myregentry - num: 5 ''' return calc( ...
Calculates the grouped mean of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.median_grouped: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L249-L270
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/thorium/calc.py
mode
python
def mode(name, num, minimum=0, maximum=0, ref=None): ''' Calculates the mode of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.mode: - name: myregentry - num: 5 ''' return calc( name=name, num=nu...
Calculates the mode of the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.mode: - name: myregentry - num: 5
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/calc.py#L273-L293
[ "def calc(name, num, oper, minimum=0, maximum=0, ref=None):\n '''\n Perform a calculation on the ``num`` most recent values. Requires a list.\n Valid values for ``oper`` are:\n\n - add: Add last ``num`` values together\n - mul: Multiple last ``num`` values together\n - mean: Calculate mean of last...
# -*- coding: utf-8 -*- ''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. .. versionadded:: 2016.11.0 :depends: statistics PyPi module ''' # import python libs from __future__ import absolute_import, print_function, unicode_literals ...
saltstack/salt
salt/engines/libvirt_events.py
_get_libvirt_enum_string
python
def _get_libvirt_enum_string(prefix, value): ''' Convert the libvirt enum integer value into a human readable string. :param prefix: start of the libvirt attribute to look for. :param value: integer to convert to string ''' attributes = [attr[len(prefix):] for attr in libvirt.__dict__ if attr.s...
Convert the libvirt enum integer value into a human readable string. :param prefix: start of the libvirt attribute to look for. :param value: integer to convert to string
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L156-L175
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_get_domain_event_detail
python
def _get_domain_event_detail(event, detail): ''' Convert event and detail numeric values into a tuple of human readable strings ''' event_name = _get_libvirt_enum_string('VIR_DOMAIN_EVENT_', event) if event_name == 'unknown': return event_name, 'unknown' prefix = 'VIR_DOMAIN_EVENT_{0}_'...
Convert event and detail numeric values into a tuple of human readable strings
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L178-L189
[ "def _get_libvirt_enum_string(prefix, value):\n '''\n Convert the libvirt enum integer value into a human readable string.\n\n :param prefix: start of the libvirt attribute to look for.\n :param value: integer to convert to string\n '''\n attributes = [attr[len(prefix):] for attr in libvirt.__dict...
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_salt_send_event
python
def _salt_send_event(opaque, conn, data): ''' Convenience function adding common data to the event and sending it on the salt event bus. :param opaque: the opaque data that is passed to the callback. This is a dict with 'prefix', 'object' and 'event' keys. :param conn: libvirt co...
Convenience function adding common data to the event and sending it on the salt event bus. :param opaque: the opaque data that is passed to the callback. This is a dict with 'prefix', 'object' and 'event' keys. :param conn: libvirt connection :param data: additional event data dict t...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L192-L231
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_salt_send_domain_event
python
def _salt_send_domain_event(opaque, conn, domain, event, event_data): ''' Helper function send a salt event for a libvirt domain. :param opaque: the opaque data that is passed to the callback. This is a dict with 'prefix', 'object' and 'event' keys. :param conn: libvirt connection ...
Helper function send a salt event for a libvirt domain. :param opaque: the opaque data that is passed to the callback. This is a dict with 'prefix', 'object' and 'event' keys. :param conn: libvirt connection :param domain: name of the domain related to the event :param event: name of...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L234-L254
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_lifecycle_cb
python
def _domain_event_lifecycle_cb(conn, domain, event, detail, opaque): ''' Domain lifecycle events handler ''' event_str, detail_str = _get_domain_event_detail(event, detail) _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'event': event_str, 'detail': detail_str ...
Domain lifecycle events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L257-L266
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_rtc_change_cb
python
def _domain_event_rtc_change_cb(conn, domain, utcoffset, opaque): ''' Domain RTC change events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'utcoffset': utcoffset })
Domain RTC change events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L276-L282
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_watchdog_cb
python
def _domain_event_watchdog_cb(conn, domain, action, opaque): ''' Domain watchdog events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'action': _get_libvirt_enum_string('VIR_DOMAIN_EVENT_WATCHDOG_', action) })
Domain watchdog events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L285-L291
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_io_error_cb
python
def _domain_event_io_error_cb(conn, domain, srcpath, devalias, action, reason, opaque): ''' Domain I/O Error events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'srcPath': srcpath, 'dev': devalias, 'action': _get_libvirt_enum_string('VIR_DOMAIN_EVE...
Domain I/O Error events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L294-L303
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_graphics_cb
python
def _domain_event_graphics_cb(conn, domain, phase, local, remote, auth, subject, opaque): ''' Domain graphics events handler ''' prefix = 'VIR_DOMAIN_EVENT_GRAPHICS_' def get_address(addr): ''' transform address structure into event data piece ''' return {'family': _...
Domain graphics events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L306-L326
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_disk_change_cb
python
def _domain_event_disk_change_cb(conn, domain, old_src, new_src, dev, reason, opaque): ''' Domain disk change events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'oldSrcPath': old_src, 'newSrcPath': new_src, 'dev': dev, 'reason': _get_libvi...
Domain disk change events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L336-L345
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_tray_change_cb
python
def _domain_event_tray_change_cb(conn, domain, dev, reason, opaque): ''' Domain tray change events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'dev': dev, 'reason': _get_libvirt_enum_string('VIR_DOMAIN_EVENT_TRAY_CHANGE_', reason) })
Domain tray change events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L348-L355
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_pmwakeup_cb
python
def _domain_event_pmwakeup_cb(conn, domain, reason, opaque): ''' Domain wakeup events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'reason': 'unknown' # currently unused })
Domain wakeup events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L358-L364
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_pmsuspend_cb
python
def _domain_event_pmsuspend_cb(conn, domain, reason, opaque): ''' Domain suspend events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'reason': 'unknown' # currently unused })
Domain suspend events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L367-L373
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_balloon_change_cb
python
def _domain_event_balloon_change_cb(conn, domain, actual, opaque): ''' Domain balloon change events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'actual': actual })
Domain balloon change events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L376-L382
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_pmsuspend_disk_cb
python
def _domain_event_pmsuspend_disk_cb(conn, domain, reason, opaque): ''' Domain disk suspend events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'reason': 'unknown' # currently unused })
Domain disk suspend events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L385-L391
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_block_job_cb
python
def _domain_event_block_job_cb(conn, domain, disk, job_type, status, opaque): ''' Domain block job events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'disk': disk, 'type': _get_libvirt_enum_string('VIR_DOMAIN_BLOCK_JOB_TYPE_', job_type), 'status':...
Domain block job events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L394-L402
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_device_removed_cb
python
def _domain_event_device_removed_cb(conn, domain, dev, opaque): ''' Domain device removal events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'dev': dev })
Domain device removal events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L405-L411
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_tunable_cb
python
def _domain_event_tunable_cb(conn, domain, params, opaque): ''' Domain tunable events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'params': params })
Domain tunable events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L414-L420
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_agent_lifecycle_cb
python
def _domain_event_agent_lifecycle_cb(conn, domain, state, reason, opaque): ''' Domain agent lifecycle events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'state': _get_libvirt_enum_string('VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_', state), 'reason':...
Domain agent lifecycle events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L424-L431
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_device_added_cb
python
def _domain_event_device_added_cb(conn, domain, dev, opaque): ''' Domain device addition events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'dev': dev })
Domain device addition events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L434-L440
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_migration_iteration_cb
python
def _domain_event_migration_iteration_cb(conn, domain, iteration, opaque): ''' Domain migration iteration events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'iteration': iteration })
Domain migration iteration events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L444-L450
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_job_completed_cb
python
def _domain_event_job_completed_cb(conn, domain, params, opaque): ''' Domain job completion events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'params': params })
Domain job completion events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L453-L459
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_device_removal_failed_cb
python
def _domain_event_device_removal_failed_cb(conn, domain, dev, opaque): ''' Domain device removal failure events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'dev': dev })
Domain device removal failure events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L462-L468
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_metadata_change_cb
python
def _domain_event_metadata_change_cb(conn, domain, mtype, nsuri, opaque): ''' Domain metadata change events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'type': _get_libvirt_enum_string('VIR_DOMAIN_METADATA_', mtype), 'nsuri': nsuri })
Domain metadata change events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L471-L478
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_domain_event_block_threshold_cb
python
def _domain_event_block_threshold_cb(conn, domain, dev, path, threshold, excess, opaque): ''' Domain block threshold events handler ''' _salt_send_domain_event(opaque, conn, domain, opaque['event'], { 'dev': dev, 'path': path, 'threshold': threshold, 'excess': excess ...
Domain block threshold events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L481-L490
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_network_event_lifecycle_cb
python
def _network_event_lifecycle_cb(conn, net, event, detail, opaque): ''' Network lifecycle events handler ''' _salt_send_event(opaque, conn, { 'network': { 'name': net.name(), 'uuid': net.UUIDString() }, 'event': _get_libvirt_enum_string('VIR_NETWORK_EVENT_...
Network lifecycle events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L493-L505
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_pool_event_lifecycle_cb
python
def _pool_event_lifecycle_cb(conn, pool, event, detail, opaque): ''' Storage pool lifecycle events handler ''' _salt_send_event(opaque, conn, { 'pool': { 'name': pool.name(), 'uuid': pool.UUIDString() }, 'event': _get_libvirt_enum_string('VIR_STORAGE_POOL_...
Storage pool lifecycle events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L508-L519
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_pool_event_refresh_cb
python
def _pool_event_refresh_cb(conn, pool, opaque): ''' Storage pool refresh events handler ''' _salt_send_event(opaque, conn, { 'pool': { 'name': pool.name(), 'uuid': pool.UUIDString() }, 'event': opaque['event'] })
Storage pool refresh events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L522-L532
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_nodedev_event_lifecycle_cb
python
def _nodedev_event_lifecycle_cb(conn, dev, event, detail, opaque): ''' Node device lifecycle events handler ''' _salt_send_event(opaque, conn, { 'nodedev': { 'name': dev.name() }, 'event': _get_libvirt_enum_string('VIR_NODE_DEVICE_EVENT_', event), 'detail': 'u...
Node device lifecycle events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L535-L545
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_nodedev_event_update_cb
python
def _nodedev_event_update_cb(conn, dev, opaque): ''' Node device update events handler ''' _salt_send_event(opaque, conn, { 'nodedev': { 'name': dev.name() }, 'event': opaque['event'] })
Node device update events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L548-L557
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_secret_event_lifecycle_cb
python
def _secret_event_lifecycle_cb(conn, secret, event, detail, opaque): ''' Secret lifecycle events handler ''' _salt_send_event(opaque, conn, { 'secret': { 'uuid': secret.UUIDString() }, 'event': _get_libvirt_enum_string('VIR_SECRET_EVENT_', event), 'detail': 'u...
Secret lifecycle events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L560-L570
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_secret_event_value_changed_cb
python
def _secret_event_value_changed_cb(conn, secret, opaque): ''' Secret value change events handler ''' _salt_send_event(opaque, conn, { 'secret': { 'uuid': secret.UUIDString() }, 'event': opaque['event'] })
Secret value change events handler
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L573-L582
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_callbacks_cleanup
python
def _callbacks_cleanup(cnx, callback_ids): ''' Unregister all the registered callbacks :param cnx: libvirt connection :param callback_ids: dictionary mapping a libvirt object type to an ID list of callbacks to deregister ''' for obj, ids in callback_ids.items(): ...
Unregister all the registered callbacks :param cnx: libvirt connection :param callback_ids: dictionary mapping a libvirt object type to an ID list of callbacks to deregister
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L595-L608
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_register_callback
python
def _register_callback(cnx, tag_prefix, obj, event, real_id): ''' Helper function registering a callback :param cnx: libvirt connection :param tag_prefix: salt event tag prefix to use :param obj: the libvirt object name for the event. Needs to be one of the REGISTER_FUNCTIONS keys. ...
Helper function registering a callback :param cnx: libvirt connection :param tag_prefix: salt event tag prefix to use :param obj: the libvirt object name for the event. Needs to be one of the REGISTER_FUNCTIONS keys. :param event: the event type name. :param real_id: the libvirt nam...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L611-L643
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
_append_callback_id
python
def _append_callback_id(ids, obj, callback_id): ''' Helper function adding a callback ID to the IDs dict. The callback ids dict maps an object to event callback ids. :param ids: dict of callback IDs to update :param obj: one of the keys of REGISTER_FUNCTIONS :param callback_id: the result of _r...
Helper function adding a callback ID to the IDs dict. The callback ids dict maps an object to event callback ids. :param ids: dict of callback IDs to update :param obj: one of the keys of REGISTER_FUNCTIONS :param callback_id: the result of _register_callback
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L646-L657
null
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/engines/libvirt_events.py
start
python
def start(uri=None, tag_prefix='salt/engines/libvirt_events', filters=None): ''' Listen to libvirt events and forward them to salt. :param uri: libvirt URI to listen on. Defaults to None to pick the first available local hypervisor :param tag_prefix: the begining of ...
Listen to libvirt events and forward them to salt. :param uri: libvirt URI to listen on. Defaults to None to pick the first available local hypervisor :param tag_prefix: the begining of the salt event tag to use. Defaults to 'salt/engines/libvirt_events' :param filter...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/libvirt_events.py#L660-L702
[ "def _register_callback(cnx, tag_prefix, obj, event, real_id):\n '''\n Helper function registering a callback\n\n :param cnx: libvirt connection\n :param tag_prefix: salt event tag prefix to use\n :param obj: the libvirt object name for the event. Needs to\n be one of the REGISTER_FUNC...
# -*- coding: utf-8 -*- ''' An engine that listens for libvirt events and resends them to the salt event bus. The minimal configuration is the following and will listen to all events on the local hypervisor and send them with a tag starting with ``salt/engines/libvirt_events``: .. code-block:: yaml engines: ...
saltstack/salt
salt/modules/status.py
_number
python
def _number(text): ''' Convert a string to a number. Returns an integer if the string represents an integer, a floating point number if the string is a real number, or the string unchanged otherwise. ''' if text.isdigit(): return int(text) try: return float(text) exce...
Convert a string to a number. Returns an integer if the string represents an integer, a floating point number if the string is a real number, or the string unchanged otherwise.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L59-L71
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
_get_boot_time_aix
python
def _get_boot_time_aix(): ''' Return the number of seconds since boot time on AIX t=$(LC_ALL=POSIX ps -o etime= -p 1) d=0 h=0 case $t in *-*) d=${t%%-*}; t=${t#*-};; esac case $t in *:*:*) h=${t%%:*}; t=${t#*:};; esac s=$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:})) t is 7-20:46:46 ...
Return the number of seconds since boot time on AIX t=$(LC_ALL=POSIX ps -o etime= -p 1) d=0 h=0 case $t in *-*) d=${t%%-*}; t=${t#*-};; esac case $t in *:*:*) h=${t%%:*}; t=${t#*:};; esac s=$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:})) t is 7-20:46:46
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L74-L94
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
_aix_loadavg
python
def _aix_loadavg(): ''' Return the load average on AIX ''' # 03:42PM up 9 days, 20:41, 2 users, load average: 0.28, 0.47, 0.69 uptime = __salt__['cmd.run']('uptime') ldavg = uptime.split('load average') load_avg = ldavg[1].split() return {'1-min': load_avg[1].strip(','), ...
Return the load average on AIX
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L97-L107
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
procs
python
def procs(): ''' Return the process data .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.procs ''' # Get the user, pid and cmd ret = {} uind = 0 pind = 0 cind = 0 plines = __salt__['cmd.run'](__grai...
Return the process data .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.procs
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L118-L154
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
custom
python
def custom(): ''' Return a custom composite of status data and info for this minion, based on the minion config file. An example config like might be:: status.cpustats.custom: [ 'cpu', 'ctxt', 'btime', 'processes' ] Where status refers to status.py, cpustats is the function where we get ou...
Return a custom composite of status data and info for this minion, based on the minion config file. An example config like might be:: status.cpustats.custom: [ 'cpu', 'ctxt', 'btime', 'processes' ] Where status refers to status.py, cpustats is the function where we get our data, and custom is this...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L157-L189
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n" ]
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
uptime
python
def uptime(): ''' Return the uptime for this system. .. versionchanged:: 2015.8.9 The uptime function was changed to return a dictionary of easy-to-read key/value pairs containing uptime information, instead of the output from a ``cmd.run`` call. .. versionchanged:: 2016.11.0 ...
Return the uptime for this system. .. versionchanged:: 2015.8.9 The uptime function was changed to return a dictionary of easy-to-read key/value pairs containing uptime information, instead of the output from a ``cmd.run`` call. .. versionchanged:: 2016.11.0 Support for OpenBSD...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L192-L265
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
loadavg
python
def loadavg(): ''' Return the load averages for this minion .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.loadavg :raises CommandExecutionError: If the system cannot report loadaverages to Python ''' if __gr...
Return the load averages for this minion .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.loadavg :raises CommandExecutionError: If the system cannot report loadaverages to Python
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L268-L293
[ "def _aix_loadavg():\n '''\n Return the load average on AIX\n '''\n # 03:42PM up 9 days, 20:41, 2 users, load average: 0.28, 0.47, 0.69\n uptime = __salt__['cmd.run']('uptime')\n ldavg = uptime.split('load average')\n load_avg = ldavg[1].split()\n return {'1-min': load_avg[1].strip(','...
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
cpustats
python
def cpustats(): ''' Return the CPU stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for OpenBSD CLI Example: .. code-block:: bash salt '*' status.cpustats ''' def linux_cpustats(): ''...
Return the CPU stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for OpenBSD CLI Example: .. code-block:: bash salt '*' status.cpustats
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L296-L441
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
meminfo
python
def meminfo(): ''' Return the memory info for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for OpenBSD CLI Example: .. code-block:: bash salt '*' status.meminfo ''' def linux_meminfo(): '''...
Return the memory info for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for OpenBSD CLI Example: .. code-block:: bash salt '*' status.meminfo
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L444-L604
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
cpuinfo
python
def cpuinfo(): ''' .. versionchanged:: 2016.3.2 Return the CPU info for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for NetBSD and OpenBSD CLI Example: .. code-block:: bash salt '*' status.cpuinfo...
.. versionchanged:: 2016.3.2 Return the CPU info for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for NetBSD and OpenBSD CLI Example: .. code-block:: bash salt '*' status.cpuinfo
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L607-L812
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
diskstats
python
def diskstats(): ''' .. versionchanged:: 2016.3.2 Return the disk stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.diskstats ''' def linux_diskstats(): ''' linux specific im...
.. versionchanged:: 2016.3.2 Return the disk stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.diskstats
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L815-L941
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
diskusage
python
def diskusage(*args): ''' Return the disk usage for this minion Usage:: salt '*' status.diskusage [paths and/or filesystem types] CLI Example: .. code-block:: bash salt '*' status.diskusage # usage for all filesystems salt '*' status.diskusage / /tmp # usage for...
Return the disk usage for this minion Usage:: salt '*' status.diskusage [paths and/or filesystem types] CLI Example: .. code-block:: bash salt '*' status.diskusage # usage for all filesystems salt '*' status.diskusage / /tmp # usage for / and /tmp salt '*' statu...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L944-L1017
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
vmstats
python
def vmstats(): ''' .. versionchanged:: 2016.3.2 Return the virtual memory stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.vmstats ''' def linux_vmstats(): ''' linux specifi...
.. versionchanged:: 2016.3.2 Return the virtual memory stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' status.vmstats
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L1020-L1074
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
nproc
python
def nproc(): ''' Return the number of processing units available on this system .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for Darwin, FreeBSD and OpenBSD CLI Example: .. code-block:: bash salt '*' status.nproc ...
Return the number of processing units available on this system .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for Darwin, FreeBSD and OpenBSD CLI Example: .. code-block:: bash salt '*' status.nproc
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L1077-L1123
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...
saltstack/salt
salt/modules/status.py
netstats
python
def netstats(): ''' Return the network stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for OpenBSD CLI Example: .. code-block:: bash salt '*' status.netstats ''' def linux_netstats(): ...
Return the network stats for this minion .. versionchanged:: 2016.11.4 Added support for AIX .. versionchanged:: 2018.3.0 Added support for OpenBSD CLI Example: .. code-block:: bash salt '*' status.netstats
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/status.py#L1126-L1251
null
# -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import datetime import os import re import logging import fnmatch import collec...