repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
saltstack/salt
salt/modules/dockercompose.py
__write_docker_compose
def __write_docker_compose(path, docker_compose, already_existed): ''' Write docker-compose to a path in order to use it with docker-compose ( config check ) :param path: docker_compose contains the docker-compose file :return: ''' if path.lower().endswith(('.yml', '.yaml')): ...
python
def __write_docker_compose(path, docker_compose, already_existed): ''' Write docker-compose to a path in order to use it with docker-compose ( config check ) :param path: docker_compose contains the docker-compose file :return: ''' if path.lower().endswith(('.yml', '.yaml')): ...
[ "def", "__write_docker_compose", "(", "path", ",", "docker_compose", ",", "already_existed", ")", ":", "if", "path", ".", "lower", "(", ")", ".", "endswith", "(", "(", "'.yml'", ",", "'.yaml'", ")", ")", ":", "file_path", "=", "path", "dir_name", "=", "o...
Write docker-compose to a path in order to use it with docker-compose ( config check ) :param path: docker_compose contains the docker-compose file :return:
[ "Write", "docker", "-", "compose", "to", "a", "path", "in", "order", "to", "use", "it", "with", "docker", "-", "compose", "(", "config", "check", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L283-L315
train
Write docker - compose to a path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
__load_project
def __load_project(path): ''' Load a docker-compose project from path :param path: :return: ''' file_path = __get_docker_file_path(path) if file_path is None: msg = 'Could not find docker-compose file at {0}'.format(path) return __standardize_result(False, ...
python
def __load_project(path): ''' Load a docker-compose project from path :param path: :return: ''' file_path = __get_docker_file_path(path) if file_path is None: msg = 'Could not find docker-compose file at {0}'.format(path) return __standardize_result(False, ...
[ "def", "__load_project", "(", "path", ")", ":", "file_path", "=", "__get_docker_file_path", "(", "path", ")", "if", "file_path", "is", "None", ":", "msg", "=", "'Could not find docker-compose file at {0}'", ".", "format", "(", "path", ")", "return", "__standardize...
Load a docker-compose project from path :param path: :return:
[ "Load", "a", "docker", "-", "compose", "project", "from", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L318-L331
train
Load a docker - compose project from path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
__load_project_from_file_path
def __load_project_from_file_path(file_path): ''' Load a docker-compose project from file path :param path: :return: ''' try: project = get_project(project_dir=os.path.dirname(file_path), config_path=[os.path.basename(file_path)]) except Exception as in...
python
def __load_project_from_file_path(file_path): ''' Load a docker-compose project from file path :param path: :return: ''' try: project = get_project(project_dir=os.path.dirname(file_path), config_path=[os.path.basename(file_path)]) except Exception as in...
[ "def", "__load_project_from_file_path", "(", "file_path", ")", ":", "try", ":", "project", "=", "get_project", "(", "project_dir", "=", "os", ".", "path", ".", "dirname", "(", "file_path", ")", ",", "config_path", "=", "[", "os", ".", "path", ".", "basenam...
Load a docker-compose project from file path :param path: :return:
[ "Load", "a", "docker", "-", "compose", "project", "from", "file", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L334-L346
train
Load a docker - compose project from file path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
__load_compose_definitions
def __load_compose_definitions(path, definition): ''' Will load the compose file located at path Then determines the format/contents of the sent definition err or results are only set if there were any :param path: :param definition: :return tuple(compose_result, loaded_definition, err): ...
python
def __load_compose_definitions(path, definition): ''' Will load the compose file located at path Then determines the format/contents of the sent definition err or results are only set if there were any :param path: :param definition: :return tuple(compose_result, loaded_definition, err): ...
[ "def", "__load_compose_definitions", "(", "path", ",", "definition", ")", ":", "compose_result", ",", "err", "=", "__load_docker_compose", "(", "path", ")", "if", "err", ":", "return", "None", ",", "None", ",", "err", "if", "isinstance", "(", "definition", "...
Will load the compose file located at path Then determines the format/contents of the sent definition err or results are only set if there were any :param path: :param definition: :return tuple(compose_result, loaded_definition, err):
[ "Will", "load", "the", "compose", "file", "located", "at", "path", "Then", "determines", "the", "format", "/", "contents", "of", "the", "sent", "definition" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L349-L379
train
Loads the compose file located at path and determines the format and contents of the sent definition
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
__dump_compose_file
def __dump_compose_file(path, compose_result, success_msg, already_existed): ''' Utility function to dump the compose result to a file. :param path: :param compose_result: :param success_msg: the message to give upon success :return: ''' ret = __dump_docker_compose(path, ...
python
def __dump_compose_file(path, compose_result, success_msg, already_existed): ''' Utility function to dump the compose result to a file. :param path: :param compose_result: :param success_msg: the message to give upon success :return: ''' ret = __dump_docker_compose(path, ...
[ "def", "__dump_compose_file", "(", "path", ",", "compose_result", ",", "success_msg", ",", "already_existed", ")", ":", "ret", "=", "__dump_docker_compose", "(", "path", ",", "compose_result", "[", "'compose_content'", "]", ",", "already_existed", ")", "if", "isin...
Utility function to dump the compose result to a file. :param path: :param compose_result: :param success_msg: the message to give upon success :return:
[ "Utility", "function", "to", "dump", "the", "compose", "result", "to", "a", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L382-L397
train
Utility function to dump the compose result to a file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
_get_convergence_plans
def _get_convergence_plans(project, service_names): ''' Get action executed for each container :param project: :param service_names: :return: ''' ret = {} plans = project._get_convergence_plans(project.get_services(service_names), ConvergenceSt...
python
def _get_convergence_plans(project, service_names): ''' Get action executed for each container :param project: :param service_names: :return: ''' ret = {} plans = project._get_convergence_plans(project.get_services(service_names), ConvergenceSt...
[ "def", "_get_convergence_plans", "(", "project", ",", "service_names", ")", ":", "ret", "=", "{", "}", "plans", "=", "project", ".", "_get_convergence_plans", "(", "project", ".", "get_services", "(", "service_names", ")", ",", "ConvergenceStrategy", ".", "chang...
Get action executed for each container :param project: :param service_names: :return:
[ "Get", "action", "executed", "for", "each", "container" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L413-L434
train
Get action executed for each container in the list of service_names
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
get
def get(path): ''' Get the content of the docker-compose file into a directory path Path where the docker-compose file is stored on the server CLI Example: .. code-block:: bash salt myminion dockercompose.get /path/where/docker-compose/stored ''' file_path = __get_docker_...
python
def get(path): ''' Get the content of the docker-compose file into a directory path Path where the docker-compose file is stored on the server CLI Example: .. code-block:: bash salt myminion dockercompose.get /path/where/docker-compose/stored ''' file_path = __get_docker_...
[ "def", "get", "(", "path", ")", ":", "file_path", "=", "__get_docker_file_path", "(", "path", ")", "if", "file_path", "is", "None", ":", "return", "__standardize_result", "(", "False", ",", "'Path {} is not present'", ".", "format", "(", "path", ")", ",", "N...
Get the content of the docker-compose file into a directory path Path where the docker-compose file is stored on the server CLI Example: .. code-block:: bash salt myminion dockercompose.get /path/where/docker-compose/stored
[ "Get", "the", "content", "of", "the", "docker", "-", "compose", "file", "into", "a", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L437-L463
train
Get the content of the docker - compose file into a directory
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
create
def create(path, docker_compose): ''' Create and validate a docker-compose file into a directory path Path where the docker-compose file will be stored on the server docker_compose docker_compose file CLI Example: .. code-block:: bash salt myminion dockercompose.crea...
python
def create(path, docker_compose): ''' Create and validate a docker-compose file into a directory path Path where the docker-compose file will be stored on the server docker_compose docker_compose file CLI Example: .. code-block:: bash salt myminion dockercompose.crea...
[ "def", "create", "(", "path", ",", "docker_compose", ")", ":", "if", "docker_compose", ":", "ret", "=", "__write_docker_compose", "(", "path", ",", "docker_compose", ",", "already_existed", "=", "False", ")", "if", "isinstance", "(", "ret", ",", "dict", ")",...
Create and validate a docker-compose file into a directory path Path where the docker-compose file will be stored on the server docker_compose docker_compose file CLI Example: .. code-block:: bash salt myminion dockercompose.create /path/where/docker-compose/stored content
[ "Create", "and", "validate", "a", "docker", "-", "compose", "file", "into", "a", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L466-L495
train
Create a docker - compose file into a directory
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
pull
def pull(path, service_names=None): ''' Pull image for containers in the docker-compose file, service_names is a python list, if omitted pull all images path Path where the docker-compose file is stored on the server service_names If specified will pull only the image for the specif...
python
def pull(path, service_names=None): ''' Pull image for containers in the docker-compose file, service_names is a python list, if omitted pull all images path Path where the docker-compose file is stored on the server service_names If specified will pull only the image for the specif...
[ "def", "pull", "(", "path", ",", "service_names", "=", "None", ")", ":", "project", "=", "__load_project", "(", "path", ")", "if", "isinstance", "(", "project", ",", "dict", ")", ":", "return", "project", "else", ":", "try", ":", "project", ".", "pull"...
Pull image for containers in the docker-compose file, service_names is a python list, if omitted pull all images path Path where the docker-compose file is stored on the server service_names If specified will pull only the image for the specified services CLI Example: .. code-bloc...
[ "Pull", "image", "for", "containers", "in", "the", "docker", "-", "compose", "file", "service_names", "is", "a", "python", "list", "if", "omitted", "pull", "all", "images" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L498-L525
train
Pull images for containers in the docker - compose file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
pause
def pause(path, service_names=None): ''' Pause running containers in the docker-compose file, service_names is a python list, if omitted pause all containers path Path where the docker-compose file is stored on the server service_names If specified will pause only the specified serv...
python
def pause(path, service_names=None): ''' Pause running containers in the docker-compose file, service_names is a python list, if omitted pause all containers path Path where the docker-compose file is stored on the server service_names If specified will pause only the specified serv...
[ "def", "pause", "(", "path", ",", "service_names", "=", "None", ")", ":", "project", "=", "__load_project", "(", "path", ")", "debug_ret", "=", "{", "}", "result", "=", "{", "}", "if", "isinstance", "(", "project", ",", "dict", ")", ":", "return", "p...
Pause running containers in the docker-compose file, service_names is a python list, if omitted pause all containers path Path where the docker-compose file is stored on the server service_names If specified will pause only the specified services CLI Example: .. code-block:: bash ...
[ "Pause", "running", "containers", "in", "the", "docker", "-", "compose", "file", "service_names", "is", "a", "python", "list", "if", "omitted", "pause", "all", "containers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L637-L671
train
Pause running containers in the docker - compose file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
rm
def rm(path, service_names=None): ''' Remove stopped containers in the docker-compose file, service_names is a python list, if omitted remove all stopped containers path Path where the docker-compose file is stored on the server service_names If specified will remove only the specif...
python
def rm(path, service_names=None): ''' Remove stopped containers in the docker-compose file, service_names is a python list, if omitted remove all stopped containers path Path where the docker-compose file is stored on the server service_names If specified will remove only the specif...
[ "def", "rm", "(", "path", ",", "service_names", "=", "None", ")", ":", "project", "=", "__load_project", "(", "path", ")", "if", "isinstance", "(", "project", ",", "dict", ")", ":", "return", "project", "else", ":", "try", ":", "project", ".", "remove_...
Remove stopped containers in the docker-compose file, service_names is a python list, if omitted remove all stopped containers path Path where the docker-compose file is stored on the server service_names If specified will remove only the specified stopped services CLI Example: .....
[ "Remove", "stopped", "containers", "in", "the", "docker", "-", "compose", "file", "service_names", "is", "a", "python", "list", "if", "omitted", "remove", "all", "stopped", "containers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L785-L811
train
Remove stopped containers in the docker - compose file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
ps
def ps(path): ''' List all running containers and report some information about them path Path where the docker-compose file is stored on the server CLI Example: .. code-block:: bash salt myminion dockercompose.ps /path/where/docker-compose/stored ''' project = __load_pr...
python
def ps(path): ''' List all running containers and report some information about them path Path where the docker-compose file is stored on the server CLI Example: .. code-block:: bash salt myminion dockercompose.ps /path/where/docker-compose/stored ''' project = __load_pr...
[ "def", "ps", "(", "path", ")", ":", "project", "=", "__load_project", "(", "path", ")", "result", "=", "{", "}", "if", "isinstance", "(", "project", ",", "dict", ")", ":", "return", "project", "else", ":", "if", "USE_FILTERCLASS", ":", "containers", "=...
List all running containers and report some information about them path Path where the docker-compose file is stored on the server CLI Example: .. code-block:: bash salt myminion dockercompose.ps /path/where/docker-compose/stored
[ "List", "all", "running", "containers", "and", "report", "some", "information", "about", "them" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L814-L854
train
List all running containers and report some information about them
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
up
def up(path, service_names=None): ''' Create and start containers defined in the docker-compose.yml file located in path, service_names is a python list, if omitted create and start all containers path Path where the docker-compose file is stored on the server service_names If s...
python
def up(path, service_names=None): ''' Create and start containers defined in the docker-compose.yml file located in path, service_names is a python list, if omitted create and start all containers path Path where the docker-compose file is stored on the server service_names If s...
[ "def", "up", "(", "path", ",", "service_names", "=", "None", ")", ":", "debug_ret", "=", "{", "}", "project", "=", "__load_project", "(", "path", ")", "if", "isinstance", "(", "project", ",", "dict", ")", ":", "return", "project", "else", ":", "try", ...
Create and start containers defined in the docker-compose.yml file located in path, service_names is a python list, if omitted create and start all containers path Path where the docker-compose file is stored on the server service_names If specified will create and start only the specif...
[ "Create", "and", "start", "containers", "defined", "in", "the", "docker", "-", "compose", ".", "yml", "file", "located", "in", "path", "service_names", "is", "a", "python", "list", "if", "omitted", "create", "and", "start", "all", "containers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L857-L891
train
Create and start containers in the docker - compose. yml file located in path service_names is a python list of service names
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
service_upsert
def service_upsert(path, service_name, definition): ''' Create or update the definition of a docker-compose service This does not pull or up the service This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored ...
python
def service_upsert(path, service_name, definition): ''' Create or update the definition of a docker-compose service This does not pull or up the service This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored ...
[ "def", "service_upsert", "(", "path", ",", "service_name", ",", "definition", ")", ":", "compose_result", ",", "loaded_definition", ",", "err", "=", "__load_compose_definitions", "(", "path", ",", "definition", ")", "if", "err", ":", "return", "err", "services",...
Create or update the definition of a docker-compose service This does not pull or up the service This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored on the server service_name Name of the service to cr...
[ "Create", "or", "update", "the", "definition", "of", "a", "docker", "-", "compose", "service", "This", "does", "not", "pull", "or", "up", "the", "service", "This", "wil", "re", "-", "write", "your", "yaml", "file", ".", "Comments", "will", "be", "lost", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L927-L956
train
Create or update a docker - compose service
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
service_remove
def service_remove(path, service_name): ''' Remove the definition of a docker-compose service This does not rm the container This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored on the server service_na...
python
def service_remove(path, service_name): ''' Remove the definition of a docker-compose service This does not rm the container This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored on the server service_na...
[ "def", "service_remove", "(", "path", ",", "service_name", ")", ":", "compose_result", ",", "err", "=", "__load_docker_compose", "(", "path", ")", "if", "err", ":", "return", "err", "services", "=", "compose_result", "[", "'compose_content'", "]", "[", "'servi...
Remove the definition of a docker-compose service This does not rm the container This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored on the server service_name Name of the service to remove CLI Ex...
[ "Remove", "the", "definition", "of", "a", "docker", "-", "compose", "service", "This", "does", "not", "rm", "the", "container", "This", "wil", "re", "-", "write", "your", "yaml", "file", ".", "Comments", "will", "be", "lost", ".", "Indentation", "is", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L959-L987
train
Remove a service from a docker - compose file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dockercompose.py
service_set_tag
def service_set_tag(path, service_name, tag): ''' Change the tag of a docker-compose service This does not pull or up the service This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored on the server servi...
python
def service_set_tag(path, service_name, tag): ''' Change the tag of a docker-compose service This does not pull or up the service This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored on the server servi...
[ "def", "service_set_tag", "(", "path", ",", "service_name", ",", "tag", ")", ":", "compose_result", ",", "err", "=", "__load_docker_compose", "(", "path", ")", "if", "err", ":", "return", "err", "services", "=", "compose_result", "[", "'compose_content'", "]",...
Change the tag of a docker-compose service This does not pull or up the service This wil re-write your yaml file. Comments will be lost. Indentation is set to 2 spaces path Path where the docker-compose file is stored on the server service_name Name of the service to remove tag ...
[ "Change", "the", "tag", "of", "a", "docker", "-", "compose", "service", "This", "does", "not", "pull", "or", "up", "the", "service", "This", "wil", "re", "-", "write", "your", "yaml", "file", ".", "Comments", "will", "be", "lost", ".", "Indentation", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dockercompose.py#L990-L1025
train
Change the tag of a docker - compose service
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
split_low_tag
def split_low_tag(tag): ''' Take a low tag and split it back into the low dict that it came from ''' state, id_, name, fun = tag.split('_|-') return {'state': state, '__id__': id_, 'name': name, 'fun': fun}
python
def split_low_tag(tag): ''' Take a low tag and split it back into the low dict that it came from ''' state, id_, name, fun = tag.split('_|-') return {'state': state, '__id__': id_, 'name': name, 'fun': fun}
[ "def", "split_low_tag", "(", "tag", ")", ":", "state", ",", "id_", ",", "name", ",", "fun", "=", "tag", ".", "split", "(", "'_|-'", ")", "return", "{", "'state'", ":", "state", ",", "'__id__'", ":", "id_", ",", "'name'", ":", "name", ",", "'fun'", ...
Take a low tag and split it back into the low dict that it came from
[ "Take", "a", "low", "tag", "and", "split", "it", "back", "into", "the", "low", "dict", "that", "it", "came", "from" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L144-L153
train
Take a low tag and split it back into the low dict that it came from
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
_calculate_fake_duration
def _calculate_fake_duration(): ''' Generate a NULL duration for when states do not run but we want the results to be consistent. ''' utc_start_time = datetime.datetime.utcnow() local_start_time = utc_start_time - \ (datetime.datetime.utcnow() - datetime.datetime.now()) utc_finish_ti...
python
def _calculate_fake_duration(): ''' Generate a NULL duration for when states do not run but we want the results to be consistent. ''' utc_start_time = datetime.datetime.utcnow() local_start_time = utc_start_time - \ (datetime.datetime.utcnow() - datetime.datetime.now()) utc_finish_ti...
[ "def", "_calculate_fake_duration", "(", ")", ":", "utc_start_time", "=", "datetime", ".", "datetime", ".", "utcnow", "(", ")", "local_start_time", "=", "utc_start_time", "-", "(", "datetime", ".", "datetime", ".", "utcnow", "(", ")", "-", "datetime", ".", "d...
Generate a NULL duration for when states do not run but we want the results to be consistent.
[ "Generate", "a", "NULL", "duration", "for", "when", "states", "do", "not", "run", "but", "we", "want", "the", "results", "to", "be", "consistent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L178-L192
train
Generate a NULL duration for when states do not run but we want the results to be consistent.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
get_accumulator_dir
def get_accumulator_dir(cachedir): ''' Return the directory that accumulator data is stored in, creating it if it doesn't exist. ''' fn_ = os.path.join(cachedir, 'accumulator') if not os.path.isdir(fn_): # accumulator_dir is not present, create it os.makedirs(fn_) return fn_
python
def get_accumulator_dir(cachedir): ''' Return the directory that accumulator data is stored in, creating it if it doesn't exist. ''' fn_ = os.path.join(cachedir, 'accumulator') if not os.path.isdir(fn_): # accumulator_dir is not present, create it os.makedirs(fn_) return fn_
[ "def", "get_accumulator_dir", "(", "cachedir", ")", ":", "fn_", "=", "os", ".", "path", ".", "join", "(", "cachedir", ",", "'accumulator'", ")", "if", "not", "os", ".", "path", ".", "isdir", "(", "fn_", ")", ":", "# accumulator_dir is not present, create it"...
Return the directory that accumulator data is stored in, creating it if it doesn't exist.
[ "Return", "the", "directory", "that", "accumulator", "data", "is", "stored", "in", "creating", "it", "if", "it", "doesn", "t", "exist", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L195-L204
train
Returns the directory that accumulator data is stored in creating it if it doesn t exist.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
trim_req
def trim_req(req): ''' Trim any function off of a requisite ''' reqfirst = next(iter(req)) if '.' in reqfirst: return {reqfirst.split('.')[0]: req[reqfirst]} return req
python
def trim_req(req): ''' Trim any function off of a requisite ''' reqfirst = next(iter(req)) if '.' in reqfirst: return {reqfirst.split('.')[0]: req[reqfirst]} return req
[ "def", "trim_req", "(", "req", ")", ":", "reqfirst", "=", "next", "(", "iter", "(", "req", ")", ")", "if", "'.'", "in", "reqfirst", ":", "return", "{", "reqfirst", ".", "split", "(", "'.'", ")", "[", "0", "]", ":", "req", "[", "reqfirst", "]", ...
Trim any function off of a requisite
[ "Trim", "any", "function", "off", "of", "a", "requisite" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L207-L214
train
Trim any function off of a requisite
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
state_args
def state_args(id_, state, high): ''' Return a set of the arguments passed to the named state ''' args = set() if id_ not in high: return args if state not in high[id_]: return args for item in high[id_][state]: if not isinstance(item, dict): continue ...
python
def state_args(id_, state, high): ''' Return a set of the arguments passed to the named state ''' args = set() if id_ not in high: return args if state not in high[id_]: return args for item in high[id_][state]: if not isinstance(item, dict): continue ...
[ "def", "state_args", "(", "id_", ",", "state", ",", "high", ")", ":", "args", "=", "set", "(", ")", "if", "id_", "not", "in", "high", ":", "return", "args", "if", "state", "not", "in", "high", "[", "id_", "]", ":", "return", "args", "for", "item"...
Return a set of the arguments passed to the named state
[ "Return", "a", "set", "of", "the", "arguments", "passed", "to", "the", "named", "state" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L217-L232
train
Return a set of the arguments passed to the named state
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
find_name
def find_name(name, state, high): ''' Scan high data for the id referencing the given name and return a list of (IDs, state) tuples that match Note: if `state` is sls, then we are looking for all IDs that match the given SLS ''' ext_id = [] if name in high: ext_id.append((name, state)) ...
python
def find_name(name, state, high): ''' Scan high data for the id referencing the given name and return a list of (IDs, state) tuples that match Note: if `state` is sls, then we are looking for all IDs that match the given SLS ''' ext_id = [] if name in high: ext_id.append((name, state)) ...
[ "def", "find_name", "(", "name", ",", "state", ",", "high", ")", ":", "ext_id", "=", "[", "]", "if", "name", "in", "high", ":", "ext_id", ".", "append", "(", "(", "name", ",", "state", ")", ")", "# if we are requiring an entire SLS, then we need to add ourse...
Scan high data for the id referencing the given name and return a list of (IDs, state) tuples that match Note: if `state` is sls, then we are looking for all IDs that match the given SLS
[ "Scan", "high", "data", "for", "the", "id", "referencing", "the", "given", "name", "and", "return", "a", "list", "of", "(", "IDs", "state", ")", "tuples", "that", "match" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L235-L262
train
Find the name in the given state and return a list of tuples that match the given name
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
find_sls_ids
def find_sls_ids(sls, high): ''' Scan for all ids in the given sls and return them in a dict; {name: state} ''' ret = [] for nid, item in six.iteritems(high): try: sls_tgt = item['__sls__'] except TypeError: if nid != '__exclude__': log.error( ...
python
def find_sls_ids(sls, high): ''' Scan for all ids in the given sls and return them in a dict; {name: state} ''' ret = [] for nid, item in six.iteritems(high): try: sls_tgt = item['__sls__'] except TypeError: if nid != '__exclude__': log.error( ...
[ "def", "find_sls_ids", "(", "sls", ",", "high", ")", ":", "ret", "=", "[", "]", "for", "nid", ",", "item", "in", "six", ".", "iteritems", "(", "high", ")", ":", "try", ":", "sls_tgt", "=", "item", "[", "'__sls__'", "]", "except", "TypeError", ":", ...
Scan for all ids in the given sls and return them in a dict; {name: state}
[ "Scan", "for", "all", "ids", "in", "the", "given", "sls", "and", "return", "them", "in", "a", "dict", ";", "{", "name", ":", "state", "}" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L265-L286
train
Scan for all ids in the given sls and return them in a dict ; { name : state }
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
format_log
def format_log(ret): ''' Format the state into a log message ''' msg = '' if isinstance(ret, dict): # Looks like the ret may be a valid state return if 'changes' in ret: # Yep, looks like a valid state return chg = ret['changes'] if not chg: ...
python
def format_log(ret): ''' Format the state into a log message ''' msg = '' if isinstance(ret, dict): # Looks like the ret may be a valid state return if 'changes' in ret: # Yep, looks like a valid state return chg = ret['changes'] if not chg: ...
[ "def", "format_log", "(", "ret", ")", ":", "msg", "=", "''", "if", "isinstance", "(", "ret", ",", "dict", ")", ":", "# Looks like the ret may be a valid state return", "if", "'changes'", "in", "ret", ":", "# Yep, looks like a valid state return", "chg", "=", "ret"...
Format the state into a log message
[ "Format", "the", "state", "into", "a", "log", "message" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L289-L330
train
Format the state into a log message
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
master_compile
def master_compile(master_opts, minion_opts, grains, id_, saltenv): ''' Compile the master side low state data, and build the hidden state file ''' st_ = MasterHighState(master_opts, minion_opts, grains, id_, saltenv) return st_.compile_highstate()
python
def master_compile(master_opts, minion_opts, grains, id_, saltenv): ''' Compile the master side low state data, and build the hidden state file ''' st_ = MasterHighState(master_opts, minion_opts, grains, id_, saltenv) return st_.compile_highstate()
[ "def", "master_compile", "(", "master_opts", ",", "minion_opts", ",", "grains", ",", "id_", ",", "saltenv", ")", ":", "st_", "=", "MasterHighState", "(", "master_opts", ",", "minion_opts", ",", "grains", ",", "id_", ",", "saltenv", ")", "return", "st_", "....
Compile the master side low state data, and build the hidden state file
[ "Compile", "the", "master", "side", "low", "state", "data", "and", "build", "the", "hidden", "state", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L333-L338
train
Compile the master side low state data and build the hidden state file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
Compiler.render_template
def render_template(self, template, **kwargs): ''' Enforce the states in a template ''' high = compile_template(template, self.rend, self.opts['renderer'], self.opts['renderer_blacklist'], ...
python
def render_template(self, template, **kwargs): ''' Enforce the states in a template ''' high = compile_template(template, self.rend, self.opts['renderer'], self.opts['renderer_blacklist'], ...
[ "def", "render_template", "(", "self", ",", "template", ",", "*", "*", "kwargs", ")", ":", "high", "=", "compile_template", "(", "template", ",", "self", ".", "rend", ",", "self", ".", "opts", "[", "'renderer'", "]", ",", "self", ".", "opts", "[", "'...
Enforce the states in a template
[ "Enforce", "the", "states", "in", "a", "template" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L381-L393
train
Render a template and return the high state
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
Compiler.verify_high
def verify_high(self, high): ''' Verify that the high data is viable and follows the data structure ''' errors = [] if not isinstance(high, dict): errors.append('High data is not a dictionary and is invalid') reqs = OrderedDict() for name, body in six....
python
def verify_high(self, high): ''' Verify that the high data is viable and follows the data structure ''' errors = [] if not isinstance(high, dict): errors.append('High data is not a dictionary and is invalid') reqs = OrderedDict() for name, body in six....
[ "def", "verify_high", "(", "self", ",", "high", ")", ":", "errors", "=", "[", "]", "if", "not", "isinstance", "(", "high", ",", "dict", ")", ":", "errors", ".", "append", "(", "'High data is not a dictionary and is invalid'", ")", "reqs", "=", "OrderedDict",...
Verify that the high data is viable and follows the data structure
[ "Verify", "that", "the", "high", "data", "is", "viable", "and", "follows", "the", "data", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L444-L584
train
Verify that the high data is viable and follows the data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
Compiler.order_chunks
def order_chunks(self, chunks): ''' Sort the chunk list verifying that the chunks follow the order specified in the order options. ''' cap = 1 for chunk in chunks: if 'order' in chunk: if not isinstance(chunk['order'], int): ...
python
def order_chunks(self, chunks): ''' Sort the chunk list verifying that the chunks follow the order specified in the order options. ''' cap = 1 for chunk in chunks: if 'order' in chunk: if not isinstance(chunk['order'], int): ...
[ "def", "order_chunks", "(", "self", ",", "chunks", ")", ":", "cap", "=", "1", "for", "chunk", "in", "chunks", ":", "if", "'order'", "in", "chunk", ":", "if", "not", "isinstance", "(", "chunk", "[", "'order'", "]", ",", "int", ")", ":", "continue", ...
Sort the chunk list verifying that the chunks follow the order specified in the order options.
[ "Sort", "the", "chunk", "list", "verifying", "that", "the", "chunks", "follow", "the", "order", "specified", "in", "the", "order", "options", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L586-L618
train
Sort the list of the chunks verifying that the chunks follow the order options.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
Compiler.apply_exclude
def apply_exclude(self, high): ''' Read in the __exclude__ list and remove all excluded objects from the high data ''' if '__exclude__' not in high: return high ex_sls = set() ex_id = set() exclude = high.pop('__exclude__') for exc in e...
python
def apply_exclude(self, high): ''' Read in the __exclude__ list and remove all excluded objects from the high data ''' if '__exclude__' not in high: return high ex_sls = set() ex_id = set() exclude = high.pop('__exclude__') for exc in e...
[ "def", "apply_exclude", "(", "self", ",", "high", ")", ":", "if", "'__exclude__'", "not", "in", "high", ":", "return", "high", "ex_sls", "=", "set", "(", ")", "ex_id", "=", "set", "(", ")", "exclude", "=", "high", ".", "pop", "(", "'__exclude__'", ")...
Read in the __exclude__ list and remove all excluded objects from the high data
[ "Read", "in", "the", "__exclude__", "list", "and", "remove", "all", "excluded", "objects", "from", "the", "high", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L677-L711
train
Apply the exclude statements to the high data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._gather_pillar
def _gather_pillar(self): ''' Whenever a state run starts, gather the pillar data fresh ''' if self._pillar_override: if self._pillar_enc: try: self._pillar_override = salt.utils.crypt.decrypt( self._pillar_override,...
python
def _gather_pillar(self): ''' Whenever a state run starts, gather the pillar data fresh ''' if self._pillar_override: if self._pillar_enc: try: self._pillar_override = salt.utils.crypt.decrypt( self._pillar_override,...
[ "def", "_gather_pillar", "(", "self", ")", ":", "if", "self", ".", "_pillar_override", ":", "if", "self", ".", "_pillar_enc", ":", "try", ":", "self", ".", "_pillar_override", "=", "salt", ".", "utils", ".", "crypt", ".", "decrypt", "(", "self", ".", "...
Whenever a state run starts, gather the pillar data fresh
[ "Whenever", "a", "state", "run", "starts", "gather", "the", "pillar", "data", "fresh" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L767-L808
train
Gather pillar data from the pillar file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._mod_init
def _mod_init(self, low): ''' Check the module initialization function, if this is the first run of a state package that has a mod_init function, then execute the mod_init function in the state module. ''' # ensure that the module is loaded try: self.s...
python
def _mod_init(self, low): ''' Check the module initialization function, if this is the first run of a state package that has a mod_init function, then execute the mod_init function in the state module. ''' # ensure that the module is loaded try: self.s...
[ "def", "_mod_init", "(", "self", ",", "low", ")", ":", "# ensure that the module is loaded", "try", ":", "self", ".", "states", "[", "'{0}.{1}'", ".", "format", "(", "low", "[", "'state'", "]", ",", "low", "[", "'fun'", "]", ")", "]", "# pylint: disable=W0...
Check the module initialization function, if this is the first run of a state package that has a mod_init function, then execute the mod_init function in the state module.
[ "Check", "the", "module", "initialization", "function", "if", "this", "is", "the", "first", "run", "of", "a", "state", "package", "that", "has", "a", "mod_init", "function", "then", "execute", "the", "mod_init", "function", "in", "the", "state", "module", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L810-L827
train
Check the module initialization function and execute it if it is not already done.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._mod_aggregate
def _mod_aggregate(self, low, running, chunks): ''' Execute the aggregation systems to runtime modify the low chunk ''' agg_opt = self.functions['config.option']('state_aggregate') if 'aggregate' in low: agg_opt = low['aggregate'] if agg_opt is True: ...
python
def _mod_aggregate(self, low, running, chunks): ''' Execute the aggregation systems to runtime modify the low chunk ''' agg_opt = self.functions['config.option']('state_aggregate') if 'aggregate' in low: agg_opt = low['aggregate'] if agg_opt is True: ...
[ "def", "_mod_aggregate", "(", "self", ",", "low", ",", "running", ",", "chunks", ")", ":", "agg_opt", "=", "self", ".", "functions", "[", "'config.option'", "]", "(", "'state_aggregate'", ")", "if", "'aggregate'", "in", "low", ":", "agg_opt", "=", "low", ...
Execute the aggregation systems to runtime modify the low chunk
[ "Execute", "the", "aggregation", "systems", "to", "runtime", "modify", "the", "low", "chunk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L829-L848
train
Execute the aggregation systems to runtime modify the low chunk
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._run_check
def _run_check(self, low_data): ''' Check that unless doesn't return 0, and that onlyif returns a 0. ''' ret = {'result': False, 'comment': []} cmd_opts = {} if 'shell' in self.opts['grains']: cmd_opts['shell'] = self.opts['grains'].get('shell') if '...
python
def _run_check(self, low_data): ''' Check that unless doesn't return 0, and that onlyif returns a 0. ''' ret = {'result': False, 'comment': []} cmd_opts = {} if 'shell' in self.opts['grains']: cmd_opts['shell'] = self.opts['grains'].get('shell') if '...
[ "def", "_run_check", "(", "self", ",", "low_data", ")", ":", "ret", "=", "{", "'result'", ":", "False", ",", "'comment'", ":", "[", "]", "}", "cmd_opts", "=", "{", "}", "if", "'shell'", "in", "self", ".", "opts", "[", "'grains'", "]", ":", "cmd_opt...
Check that unless doesn't return 0, and that onlyif returns a 0.
[ "Check", "that", "unless", "doesn", "t", "return", "0", "and", "that", "onlyif", "returns", "a", "0", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L850-L876
train
Check that onlyif doesn t return 0 and that unless returns a 0.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._run_check_onlyif
def _run_check_onlyif(self, low_data, cmd_opts): ''' Check that unless doesn't return 0, and that onlyif returns a 0. ''' ret = {'result': False} if not isinstance(low_data['onlyif'], list): low_data_onlyif = [low_data['onlyif']] else: low_data_on...
python
def _run_check_onlyif(self, low_data, cmd_opts): ''' Check that unless doesn't return 0, and that onlyif returns a 0. ''' ret = {'result': False} if not isinstance(low_data['onlyif'], list): low_data_onlyif = [low_data['onlyif']] else: low_data_on...
[ "def", "_run_check_onlyif", "(", "self", ",", "low_data", ",", "cmd_opts", ")", ":", "ret", "=", "{", "'result'", ":", "False", "}", "if", "not", "isinstance", "(", "low_data", "[", "'onlyif'", "]", ",", "list", ")", ":", "low_data_onlyif", "=", "[", "...
Check that unless doesn't return 0, and that onlyif returns a 0.
[ "Check", "that", "unless", "doesn", "t", "return", "0", "and", "that", "onlyif", "returns", "a", "0", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L878-L921
train
Check that unless doesn t return 0 and that onlyif returns a 0.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._run_check_cmd
def _run_check_cmd(self, low_data): ''' Alter the way a successful state run is determined ''' ret = {'result': False} cmd_opts = {} if 'shell' in self.opts['grains']: cmd_opts['shell'] = self.opts['grains'].get('shell') for entry in low_data['check_cm...
python
def _run_check_cmd(self, low_data): ''' Alter the way a successful state run is determined ''' ret = {'result': False} cmd_opts = {} if 'shell' in self.opts['grains']: cmd_opts['shell'] = self.opts['grains'].get('shell') for entry in low_data['check_cm...
[ "def", "_run_check_cmd", "(", "self", ",", "low_data", ")", ":", "ret", "=", "{", "'result'", ":", "False", "}", "cmd_opts", "=", "{", "}", "if", "'shell'", "in", "self", ".", "opts", "[", "'grains'", "]", ":", "cmd_opts", "[", "'shell'", "]", "=", ...
Alter the way a successful state run is determined
[ "Alter", "the", "way", "a", "successful", "state", "run", "is", "determined" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L968-L985
train
Run the check_cmd function
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._load_states
def _load_states(self): ''' Read the state loader value and loadup the correct states subsystem ''' if self.states_loader == 'thorium': self.states = salt.loader.thorium(self.opts, self.functions, {}) # TODO: Add runners, proxy? else: self.states = salt.l...
python
def _load_states(self): ''' Read the state loader value and loadup the correct states subsystem ''' if self.states_loader == 'thorium': self.states = salt.loader.thorium(self.opts, self.functions, {}) # TODO: Add runners, proxy? else: self.states = salt.l...
[ "def", "_load_states", "(", "self", ")", ":", "if", "self", ".", "states_loader", "==", "'thorium'", ":", "self", ".", "states", "=", "salt", ".", "loader", ".", "thorium", "(", "self", ".", "opts", ",", "self", ".", "functions", ",", "{", "}", ")", ...
Read the state loader value and loadup the correct states subsystem
[ "Read", "the", "state", "loader", "value", "and", "loadup", "the", "correct", "states", "subsystem" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L993-L1001
train
Read the state loader value and loadup the correct states subsystem
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.load_modules
def load_modules(self, data=None, proxy=None): ''' Load the modules into the state ''' log.info('Loading fresh modules for state activity') self.utils = salt.loader.utils(self.opts) self.functions = salt.loader.minion_mods(self.opts, self.state_con, ...
python
def load_modules(self, data=None, proxy=None): ''' Load the modules into the state ''' log.info('Loading fresh modules for state activity') self.utils = salt.loader.utils(self.opts) self.functions = salt.loader.minion_mods(self.opts, self.state_con, ...
[ "def", "load_modules", "(", "self", ",", "data", "=", "None", ",", "proxy", "=", "None", ")", ":", "log", ".", "info", "(", "'Loading fresh modules for state activity'", ")", "self", ".", "utils", "=", "salt", ".", "loader", ".", "utils", "(", "self", "....
Load the modules into the state
[ "Load", "the", "modules", "into", "the", "state" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1003-L1035
train
Load the modules into the state
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.module_refresh
def module_refresh(self): ''' Refresh all the modules ''' log.debug('Refreshing modules...') if self.opts['grains'].get('os') != 'MacOS': # In case a package has been installed into the current python # process 'site-packages', the 'site' module needs to b...
python
def module_refresh(self): ''' Refresh all the modules ''' log.debug('Refreshing modules...') if self.opts['grains'].get('os') != 'MacOS': # In case a package has been installed into the current python # process 'site-packages', the 'site' module needs to b...
[ "def", "module_refresh", "(", "self", ")", ":", "log", ".", "debug", "(", "'Refreshing modules...'", ")", "if", "self", ".", "opts", "[", "'grains'", "]", ".", "get", "(", "'os'", ")", "!=", "'MacOS'", ":", "# In case a package has been installed into the curren...
Refresh all the modules
[ "Refresh", "all", "the", "modules" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1037-L1054
train
Refresh all the modules in the system
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.check_refresh
def check_refresh(self, data, ret): ''' Check to see if the modules for this state instance need to be updated, only update if the state is a file or a package and if it changed something. If the file function is managed check to see if the file is a possible module type, e.g. a ...
python
def check_refresh(self, data, ret): ''' Check to see if the modules for this state instance need to be updated, only update if the state is a file or a package and if it changed something. If the file function is managed check to see if the file is a possible module type, e.g. a ...
[ "def", "check_refresh", "(", "self", ",", "data", ",", "ret", ")", ":", "_reload_modules", "=", "False", "if", "data", ".", "get", "(", "'reload_grains'", ",", "False", ")", ":", "log", ".", "debug", "(", "'Refreshing grains...'", ")", "self", ".", "opts...
Check to see if the modules for this state instance need to be updated, only update if the state is a file or a package and if it changed something. If the file function is managed check to see if the file is a possible module type, e.g. a python, pyx, or .so. Always refresh if the funct...
[ "Check", "to", "see", "if", "the", "modules", "for", "this", "state", "instance", "need", "to", "be", "updated", "only", "update", "if", "the", "state", "is", "a", "file", "or", "a", "package", "and", "if", "it", "changed", "something", ".", "If", "the...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1056-L1096
train
Check to see if the modules for this state instance need to be updated if so refresh the modules for this state instance.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.verify_data
def verify_data(self, data): ''' Verify the data, return an error statement if something is wrong ''' errors = [] if 'state' not in data: errors.append('Missing "state" data') if 'fun' not in data: errors.append('Missing "fun" data') if 'na...
python
def verify_data(self, data): ''' Verify the data, return an error statement if something is wrong ''' errors = [] if 'state' not in data: errors.append('Missing "state" data') if 'fun' not in data: errors.append('Missing "fun" data') if 'na...
[ "def", "verify_data", "(", "self", ",", "data", ")", ":", "errors", "=", "[", "]", "if", "'state'", "not", "in", "data", ":", "errors", ".", "append", "(", "'Missing \"state\" data'", ")", "if", "'fun'", "not", "in", "data", ":", "errors", ".", "append...
Verify the data, return an error statement if something is wrong
[ "Verify", "the", "data", "return", "an", "error", "statement", "if", "something", "is", "wrong" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1098-L1186
train
Verify the data for the current state and state.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.verify_chunks
def verify_chunks(self, chunks): ''' Verify the chunks in a list of low data structures ''' err = [] for chunk in chunks: err.extend(self.verify_data(chunk)) return err
python
def verify_chunks(self, chunks): ''' Verify the chunks in a list of low data structures ''' err = [] for chunk in chunks: err.extend(self.verify_data(chunk)) return err
[ "def", "verify_chunks", "(", "self", ",", "chunks", ")", ":", "err", "=", "[", "]", "for", "chunk", "in", "chunks", ":", "err", ".", "extend", "(", "self", ".", "verify_data", "(", "chunk", ")", ")", "return", "err" ]
Verify the chunks in a list of low data structures
[ "Verify", "the", "chunks", "in", "a", "list", "of", "low", "data", "structures" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1346-L1353
train
Verify the chunks in a list of low data structures
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.order_chunks
def order_chunks(self, chunks): ''' Sort the chunk list verifying that the chunks follow the order specified in the order options. ''' cap = 1 for chunk in chunks: if 'order' in chunk: if not isinstance(chunk['order'], int): ...
python
def order_chunks(self, chunks): ''' Sort the chunk list verifying that the chunks follow the order specified in the order options. ''' cap = 1 for chunk in chunks: if 'order' in chunk: if not isinstance(chunk['order'], int): ...
[ "def", "order_chunks", "(", "self", ",", "chunks", ")", ":", "cap", "=", "1", "for", "chunk", "in", "chunks", ":", "if", "'order'", "in", "chunk", ":", "if", "not", "isinstance", "(", "chunk", "[", "'order'", "]", ",", "int", ")", ":", "continue", ...
Sort the chunk list verifying that the chunks follow the order specified in the order options.
[ "Sort", "the", "chunk", "list", "verifying", "that", "the", "chunks", "follow", "the", "order", "specified", "in", "the", "order", "options", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1355-L1386
train
Sort the list of the chunks verifying that the chunks follow the order options.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.compile_high_data
def compile_high_data(self, high, orchestration_jid=None): ''' "Compile" the high data as it is retrieved from the CLI or YAML into the individual state executor structures ''' chunks = [] for name, body in six.iteritems(high): if name.startswith('__'): ...
python
def compile_high_data(self, high, orchestration_jid=None): ''' "Compile" the high data as it is retrieved from the CLI or YAML into the individual state executor structures ''' chunks = [] for name, body in six.iteritems(high): if name.startswith('__'): ...
[ "def", "compile_high_data", "(", "self", ",", "high", ",", "orchestration_jid", "=", "None", ")", ":", "chunks", "=", "[", "]", "for", "name", ",", "body", "in", "six", ".", "iteritems", "(", "high", ")", ":", "if", "name", ".", "startswith", "(", "'...
"Compile" the high data as it is retrieved from the CLI or YAML into the individual state executor structures
[ "Compile", "the", "high", "data", "as", "it", "is", "retrieved", "from", "the", "CLI", "or", "YAML", "into", "the", "individual", "state", "executor", "structures" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1388-L1452
train
Compile the high data into a dictionary of high data structures.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.reconcile_extend
def reconcile_extend(self, high): ''' Pull the extend data and add it to the respective high data ''' errors = [] if '__extend__' not in high: return high, errors ext = high.pop('__extend__') for ext_chunk in ext: for name, body in six.iter...
python
def reconcile_extend(self, high): ''' Pull the extend data and add it to the respective high data ''' errors = [] if '__extend__' not in high: return high, errors ext = high.pop('__extend__') for ext_chunk in ext: for name, body in six.iter...
[ "def", "reconcile_extend", "(", "self", ",", "high", ")", ":", "errors", "=", "[", "]", "if", "'__extend__'", "not", "in", "high", ":", "return", "high", ",", "errors", "ext", "=", "high", ".", "pop", "(", "'__extend__'", ")", "for", "ext_chunk", "in",...
Pull the extend data and add it to the respective high data
[ "Pull", "the", "extend", "data", "and", "add", "it", "to", "the", "respective", "high", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1454-L1520
train
Reconcile the extend data in the high data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.requisite_in
def requisite_in(self, high): ''' Extend the data reference with requisite_in arguments ''' req_in = {'require_in', 'watch_in', 'onfail_in', 'onchanges_in', 'use', 'use_in', 'prereq', 'prereq_in'} req_in_all = req_in.union({'require', 'watch', 'onfail', 'onfail_stop', 'onchanges'...
python
def requisite_in(self, high): ''' Extend the data reference with requisite_in arguments ''' req_in = {'require_in', 'watch_in', 'onfail_in', 'onchanges_in', 'use', 'use_in', 'prereq', 'prereq_in'} req_in_all = req_in.union({'require', 'watch', 'onfail', 'onfail_stop', 'onchanges'...
[ "def", "requisite_in", "(", "self", ",", "high", ")", ":", "req_in", "=", "{", "'require_in'", ",", "'watch_in'", ",", "'onfail_in'", ",", "'onchanges_in'", ",", "'use'", ",", "'use_in'", ",", "'prereq'", ",", "'prereq_in'", "}", "req_in_all", "=", "req_in",...
Extend the data reference with requisite_in arguments
[ "Extend", "the", "data", "reference", "with", "requisite_in", "arguments" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1562-L1787
train
Extend the data reference with requisite_in arguments
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State._call_parallel_target
def _call_parallel_target(self, name, cdata, low): ''' The target function to call that will create the parallel thread/process ''' # we need to re-record start/end duration here because it is impossible to # correctly calculate further down the chain utc_start_time = dat...
python
def _call_parallel_target(self, name, cdata, low): ''' The target function to call that will create the parallel thread/process ''' # we need to re-record start/end duration here because it is impossible to # correctly calculate further down the chain utc_start_time = dat...
[ "def", "_call_parallel_target", "(", "self", ",", "name", ",", "cdata", ",", "low", ")", ":", "# we need to re-record start/end duration here because it is impossible to", "# correctly calculate further down the chain", "utc_start_time", "=", "datetime", ".", "datetime", ".", ...
The target function to call that will create the parallel thread/process
[ "The", "target", "function", "to", "call", "that", "will", "create", "the", "parallel", "thread", "/", "process" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1789-L1830
train
The target function to call that will create the parallel thread and process the current state.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call_parallel
def call_parallel(self, cdata, low): ''' Call the state defined in the given cdata in parallel ''' # There are a number of possibilities to not have the cdata # populated with what we might have expected, so just be smart # enough to not raise another KeyError as the name...
python
def call_parallel(self, cdata, low): ''' Call the state defined in the given cdata in parallel ''' # There are a number of possibilities to not have the cdata # populated with what we might have expected, so just be smart # enough to not raise another KeyError as the name...
[ "def", "call_parallel", "(", "self", ",", "cdata", ",", "low", ")", ":", "# There are a number of possibilities to not have the cdata", "# populated with what we might have expected, so just be smart", "# enough to not raise another KeyError as the name is easily", "# guessable and fallbac...
Call the state defined in the given cdata in parallel
[ "Call", "the", "state", "defined", "in", "the", "given", "cdata", "in", "parallel" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1832-L1854
train
Call the state defined in the given cdata in parallel
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call
def call(self, low, chunks=None, running=None, retries=1): ''' Call a state directly with the low data structure, verify data before processing. ''' use_uptime = False if os.path.isfile('/proc/uptime'): use_uptime = True with salt.utils.files.fopen...
python
def call(self, low, chunks=None, running=None, retries=1): ''' Call a state directly with the low data structure, verify data before processing. ''' use_uptime = False if os.path.isfile('/proc/uptime'): use_uptime = True with salt.utils.files.fopen...
[ "def", "call", "(", "self", ",", "low", ",", "chunks", "=", "None", ",", "running", "=", "None", ",", "retries", "=", "1", ")", ":", "use_uptime", "=", "False", "if", "os", ".", "path", ".", "isfile", "(", "'/proc/uptime'", ")", ":", "use_uptime", ...
Call a state directly with the low data structure, verify data before processing.
[ "Call", "a", "state", "directly", "with", "the", "low", "data", "structure", "verify", "data", "before", "processing", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L1857-L2100
train
Call a state directly with the low data structure verify the data structure before processing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.format_slots
def format_slots(self, cdata): ''' Read in the arguments from the low level slot syntax to make a last minute runtime call to gather relevant data for the specific routine Will parse strings, first level of dictionary values, and strings and first level dict values inside of lis...
python
def format_slots(self, cdata): ''' Read in the arguments from the low level slot syntax to make a last minute runtime call to gather relevant data for the specific routine Will parse strings, first level of dictionary values, and strings and first level dict values inside of lis...
[ "def", "format_slots", "(", "self", ",", "cdata", ")", ":", "# __slot__:salt.cmd.run(foo, bar, baz=qux)", "SLOT_TEXT", "=", "'__slot__:'", "ctx", "=", "(", "(", "'args'", ",", "enumerate", "(", "cdata", "[", "'args'", "]", ")", ")", ",", "(", "'kwargs'", ","...
Read in the arguments from the low level slot syntax to make a last minute runtime call to gather relevant data for the specific routine Will parse strings, first level of dictionary values, and strings and first level dict values inside of lists
[ "Read", "in", "the", "arguments", "from", "the", "low", "level", "slot", "syntax", "to", "make", "a", "last", "minute", "runtime", "call", "to", "gather", "relevant", "data", "for", "the", "specific", "routine" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2159-L2209
train
This function formats the low level slots in the salt master and returns the data in cdata.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.verify_retry_data
def verify_retry_data(self, retry_data): ''' verifies the specified retry data ''' retry_defaults = { 'until': True, 'attempts': 2, 'splay': 0, 'interval': 30, } expected_data = { 'until': bool, ...
python
def verify_retry_data(self, retry_data): ''' verifies the specified retry data ''' retry_defaults = { 'until': True, 'attempts': 2, 'splay': 0, 'interval': 30, } expected_data = { 'until': bool, ...
[ "def", "verify_retry_data", "(", "self", ",", "retry_data", ")", ":", "retry_defaults", "=", "{", "'until'", ":", "True", ",", "'attempts'", ":", "2", ",", "'splay'", ":", "0", ",", "'interval'", ":", "30", ",", "}", "expected_data", "=", "{", "'until'",...
verifies the specified retry data
[ "verifies", "the", "specified", "retry", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2211-L2246
train
Verify the retry data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call_chunks
def call_chunks(self, chunks): ''' Iterate over a list of chunks and call them, checking for requires. ''' # Check for any disabled states disabled = {} if 'state_runs_disabled' in self.opts['grains']: for low in chunks[:]: state_ = '{0}.{1}'.f...
python
def call_chunks(self, chunks): ''' Iterate over a list of chunks and call them, checking for requires. ''' # Check for any disabled states disabled = {} if 'state_runs_disabled' in self.opts['grains']: for low in chunks[:]: state_ = '{0}.{1}'.f...
[ "def", "call_chunks", "(", "self", ",", "chunks", ")", ":", "# Check for any disabled states", "disabled", "=", "{", "}", "if", "'state_runs_disabled'", "in", "self", ".", "opts", "[", "'grains'", "]", ":", "for", "low", "in", "chunks", "[", ":", "]", ":",...
Iterate over a list of chunks and call them, checking for requires.
[ "Iterate", "over", "a", "list", "of", "chunks", "and", "call", "them", "checking", "for", "requires", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2248-L2295
train
Iterate over a list of chunks and call them checking for requires.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.check_failhard
def check_failhard(self, low, running): ''' Check if the low data chunk should send a failhard signal ''' tag = _gen_tag(low) if self.opts.get('test', False): return False if low.get('failhard', self.opts['failhard']) and tag in running: if running...
python
def check_failhard(self, low, running): ''' Check if the low data chunk should send a failhard signal ''' tag = _gen_tag(low) if self.opts.get('test', False): return False if low.get('failhard', self.opts['failhard']) and tag in running: if running...
[ "def", "check_failhard", "(", "self", ",", "low", ",", "running", ")", ":", "tag", "=", "_gen_tag", "(", "low", ")", "if", "self", ".", "opts", ".", "get", "(", "'test'", ",", "False", ")", ":", "return", "False", "if", "low", ".", "get", "(", "'...
Check if the low data chunk should send a failhard signal
[ "Check", "if", "the", "low", "data", "chunk", "should", "send", "a", "failhard", "signal" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2297-L2308
train
Check if the low data chunk should send a failhard signal
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.check_pause
def check_pause(self, low): ''' Check to see if this low chunk has been paused ''' if not self.jid: # Can't pause on salt-ssh since we can't track continuous state return pause_path = os.path.join(self.opts['cachedir'], 'state_pause', self.jid) sta...
python
def check_pause(self, low): ''' Check to see if this low chunk has been paused ''' if not self.jid: # Can't pause on salt-ssh since we can't track continuous state return pause_path = os.path.join(self.opts['cachedir'], 'state_pause', self.jid) sta...
[ "def", "check_pause", "(", "self", ",", "low", ")", ":", "if", "not", "self", ".", "jid", ":", "# Can't pause on salt-ssh since we can't track continuous state", "return", "pause_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "opts", "[", "'cach...
Check to see if this low chunk has been paused
[ "Check", "to", "see", "if", "this", "low", "chunk", "has", "been", "paused" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2310-L2353
train
Check to see if this low chunk has been paused and return the state that was paused.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.reconcile_procs
def reconcile_procs(self, running): ''' Check the running dict for processes and resolve them ''' retset = set() for tag in running: proc = running[tag].get('proc') if proc: if not proc.is_alive(): ret_cache = os.path.jo...
python
def reconcile_procs(self, running): ''' Check the running dict for processes and resolve them ''' retset = set() for tag in running: proc = running[tag].get('proc') if proc: if not proc.is_alive(): ret_cache = os.path.jo...
[ "def", "reconcile_procs", "(", "self", ",", "running", ")", ":", "retset", "=", "set", "(", ")", "for", "tag", "in", "running", ":", "proc", "=", "running", "[", "tag", "]", ".", "get", "(", "'proc'", ")", "if", "proc", ":", "if", "not", "proc", ...
Check the running dict for processes and resolve them
[ "Check", "the", "running", "dict", "for", "processes", "and", "resolve", "them" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2355-L2385
train
Check the running dict for processes and resolve them
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.check_requisite
def check_requisite(self, low, running, chunks, pre=False): ''' Look into the running data to check the status of all requisite states ''' disabled_reqs = self.opts.get('disabled_requisites', []) if not isinstance(disabled_reqs, list): disabled_reqs = [disable...
python
def check_requisite(self, low, running, chunks, pre=False): ''' Look into the running data to check the status of all requisite states ''' disabled_reqs = self.opts.get('disabled_requisites', []) if not isinstance(disabled_reqs, list): disabled_reqs = [disable...
[ "def", "check_requisite", "(", "self", ",", "low", ",", "running", ",", "chunks", ",", "pre", "=", "False", ")", ":", "disabled_reqs", "=", "self", ".", "opts", ".", "get", "(", "'disabled_requisites'", ",", "[", "]", ")", "if", "not", "isinstance", "(...
Look into the running data to check the status of all requisite states
[ "Look", "into", "the", "running", "data", "to", "check", "the", "status", "of", "all", "requisite", "states" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2387-L2572
train
Check the status of all requisites in the given low data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.event
def event(self, chunk_ret, length, fire_event=False): ''' Fire an event on the master bus If `fire_event` is set to True an event will be sent with the chunk name in the tag and the chunk result in the event data. If `fire_event` is set to a string such as `mystate/is/finished`...
python
def event(self, chunk_ret, length, fire_event=False): ''' Fire an event on the master bus If `fire_event` is set to True an event will be sent with the chunk name in the tag and the chunk result in the event data. If `fire_event` is set to a string such as `mystate/is/finished`...
[ "def", "event", "(", "self", ",", "chunk_ret", ",", "length", ",", "fire_event", "=", "False", ")", ":", "if", "not", "self", ".", "opts", ".", "get", "(", "'local'", ")", "and", "(", "self", ".", "opts", ".", "get", "(", "'state_events'", ",", "Tr...
Fire an event on the master bus If `fire_event` is set to True an event will be sent with the chunk name in the tag and the chunk result in the event data. If `fire_event` is set to a string such as `mystate/is/finished`, an event will be sent with the string added to the tag and the c...
[ "Fire", "an", "event", "on", "the", "master", "bus" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2574-L2611
train
Fire an event on the master bus with the given chunk result.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call_chunk
def call_chunk(self, low, running, chunks): ''' Check if a chunk has any requires, execute the requires and then the chunk ''' low = self._mod_aggregate(low, running, chunks) self._mod_init(low) tag = _gen_tag(low) if not low.get('prerequired'): ...
python
def call_chunk(self, low, running, chunks): ''' Check if a chunk has any requires, execute the requires and then the chunk ''' low = self._mod_aggregate(low, running, chunks) self._mod_init(low) tag = _gen_tag(low) if not low.get('prerequired'): ...
[ "def", "call_chunk", "(", "self", ",", "low", ",", "running", ",", "chunks", ")", ":", "low", "=", "self", ".", "_mod_aggregate", "(", "low", ",", "running", ",", "chunks", ")", "self", ".", "_mod_init", "(", "low", ")", "tag", "=", "_gen_tag", "(", ...
Check if a chunk has any requires, execute the requires and then the chunk
[ "Check", "if", "a", "chunk", "has", "any", "requires", "execute", "the", "requires", "and", "then", "the", "chunk" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2613-L2841
train
Check if a chunk has any requires execute the requires and then the then the chunk
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call_listen
def call_listen(self, chunks, running): ''' Find all of the listen routines and call the associated mod_watch runs ''' listeners = [] crefs = {} for chunk in chunks: crefs[(chunk['state'], chunk['__id__'], chunk['name'])] = chunk if 'listen' in chu...
python
def call_listen(self, chunks, running): ''' Find all of the listen routines and call the associated mod_watch runs ''' listeners = [] crefs = {} for chunk in chunks: crefs[(chunk['state'], chunk['__id__'], chunk['name'])] = chunk if 'listen' in chu...
[ "def", "call_listen", "(", "self", ",", "chunks", ",", "running", ")", ":", "listeners", "=", "[", "]", "crefs", "=", "{", "}", "for", "chunk", "in", "chunks", ":", "crefs", "[", "(", "chunk", "[", "'state'", "]", ",", "chunk", "[", "'__id__'", "]"...
Find all of the listen routines and call the associated mod_watch runs
[ "Find", "all", "of", "the", "listen", "routines", "and", "call", "the", "associated", "mod_watch", "runs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2843-L2914
train
Find all of the listen routines and call the associated mod_watch runs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.inject_default_call
def inject_default_call(self, high): ''' Sets .call function to a state, if not there. :param high: :return: ''' for chunk in high: state = high[chunk] if not isinstance(state, collections.Mapping): continue for state_r...
python
def inject_default_call(self, high): ''' Sets .call function to a state, if not there. :param high: :return: ''' for chunk in high: state = high[chunk] if not isinstance(state, collections.Mapping): continue for state_r...
[ "def", "inject_default_call", "(", "self", ",", "high", ")", ":", "for", "chunk", "in", "high", ":", "state", "=", "high", "[", "chunk", "]", "if", "not", "isinstance", "(", "state", ",", "collections", ".", "Mapping", ")", ":", "continue", "for", "sta...
Sets .call function to a state, if not there. :param high: :return:
[ "Sets", ".", "call", "function", "to", "a", "state", "if", "not", "there", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2916-L2936
train
Injects a default call function to a state if not there.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call_high
def call_high(self, high, orchestration_jid=None): ''' Process a high data call and ensure the defined states. ''' self.inject_default_call(high) errors = [] # If there is extension data reconcile it high, ext_errors = self.reconcile_extend(high) errors.ex...
python
def call_high(self, high, orchestration_jid=None): ''' Process a high data call and ensure the defined states. ''' self.inject_default_call(high) errors = [] # If there is extension data reconcile it high, ext_errors = self.reconcile_extend(high) errors.ex...
[ "def", "call_high", "(", "self", ",", "high", ",", "orchestration_jid", "=", "None", ")", ":", "self", ".", "inject_default_call", "(", "high", ")", "errors", "=", "[", "]", "# If there is extension data reconcile it", "high", ",", "ext_errors", "=", "self", "...
Process a high data call and ensure the defined states.
[ "Process", "a", "high", "data", "call", "and", "ensure", "the", "defined", "states", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L2938-L2986
train
Process a high data call and ensure the defined states.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call_template
def call_template(self, template): ''' Enforce the states in a template ''' high = compile_template(template, self.rend, self.opts['renderer'], self.opts['renderer_blacklist'], ...
python
def call_template(self, template): ''' Enforce the states in a template ''' high = compile_template(template, self.rend, self.opts['renderer'], self.opts['renderer_blacklist'], ...
[ "def", "call_template", "(", "self", ",", "template", ")", ":", "high", "=", "compile_template", "(", "template", ",", "self", ".", "rend", ",", "self", ".", "opts", "[", "'renderer'", "]", ",", "self", ".", "opts", "[", "'renderer_blacklist'", "]", ",",...
Enforce the states in a template
[ "Enforce", "the", "states", "in", "a", "template" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3067-L3081
train
Call the template and return the result.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
State.call_template_str
def call_template_str(self, template): ''' Enforce the states in a template, pass the template as a string ''' high = compile_template_str(template, self.rend, self.opts['renderer'], ...
python
def call_template_str(self, template): ''' Enforce the states in a template, pass the template as a string ''' high = compile_template_str(template, self.rend, self.opts['renderer'], ...
[ "def", "call_template_str", "(", "self", ",", "template", ")", ":", "high", "=", "compile_template_str", "(", "template", ",", "self", ".", "rend", ",", "self", ".", "opts", "[", "'renderer'", "]", ",", "self", ".", "opts", "[", "'renderer_blacklist'", "]"...
Enforce the states in a template, pass the template as a string
[ "Enforce", "the", "states", "in", "a", "template", "pass", "the", "template", "as", "a", "string" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3083-L3097
train
Enforces the states in a template pass the template as a string
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.__gen_opts
def __gen_opts(self, opts): ''' The options used by the High State object are derived from options on the minion and the master, or just the minion if the high state call is entirely local. ''' # If the state is intended to be applied locally, then the local opts ...
python
def __gen_opts(self, opts): ''' The options used by the High State object are derived from options on the minion and the master, or just the minion if the high state call is entirely local. ''' # If the state is intended to be applied locally, then the local opts ...
[ "def", "__gen_opts", "(", "self", ",", "opts", ")", ":", "# If the state is intended to be applied locally, then the local opts", "# should have all of the needed data, otherwise overwrite the local", "# data items with data from the master", "if", "'local_state'", "in", "opts", ":", ...
The options used by the High State object are derived from options on the minion and the master, or just the minion if the high state call is entirely local.
[ "The", "options", "used", "by", "the", "High", "State", "object", "are", "derived", "from", "options", "on", "the", "minion", "and", "the", "master", "or", "just", "the", "minion", "if", "the", "high", "state", "call", "is", "entirely", "local", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3124-L3169
train
Generate the options used by the high state object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._get_envs
def _get_envs(self): ''' Pull the file server environments out of the master options ''' envs = ['base'] if 'file_roots' in self.opts: envs.extend([x for x in list(self.opts['file_roots']) if x not in envs]) env_order = self.opts.get('...
python
def _get_envs(self): ''' Pull the file server environments out of the master options ''' envs = ['base'] if 'file_roots' in self.opts: envs.extend([x for x in list(self.opts['file_roots']) if x not in envs]) env_order = self.opts.get('...
[ "def", "_get_envs", "(", "self", ")", ":", "envs", "=", "[", "'base'", "]", "if", "'file_roots'", "in", "self", ".", "opts", ":", "envs", ".", "extend", "(", "[", "x", "for", "x", "in", "list", "(", "self", ".", "opts", "[", "'file_roots'", "]", ...
Pull the file server environments out of the master options
[ "Pull", "the", "file", "server", "environments", "out", "of", "the", "master", "options" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3171-L3191
train
Get the file server environments out of the master options and the master client options.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.get_tops
def get_tops(self): ''' Gather the top files ''' tops = DefaultOrderedDict(list) include = DefaultOrderedDict(list) done = DefaultOrderedDict(list) found = 0 # did we find any contents in the top files? # Gather initial top files merging_strategy ...
python
def get_tops(self): ''' Gather the top files ''' tops = DefaultOrderedDict(list) include = DefaultOrderedDict(list) done = DefaultOrderedDict(list) found = 0 # did we find any contents in the top files? # Gather initial top files merging_strategy ...
[ "def", "get_tops", "(", "self", ")", ":", "tops", "=", "DefaultOrderedDict", "(", "list", ")", "include", "=", "DefaultOrderedDict", "(", "list", ")", "done", "=", "DefaultOrderedDict", "(", "list", ")", "found", "=", "0", "# did we find any contents in the top ...
Gather the top files
[ "Gather", "the", "top", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3193-L3313
train
Gather the top files and their contents
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.merge_tops
def merge_tops(self, tops): ''' Cleanly merge the top files ''' merging_strategy = self.opts['top_file_merging_strategy'] try: merge_attr = '_merge_tops_{0}'.format(merging_strategy) merge_func = getattr(self, merge_attr) if not hasattr(merge_f...
python
def merge_tops(self, tops): ''' Cleanly merge the top files ''' merging_strategy = self.opts['top_file_merging_strategy'] try: merge_attr = '_merge_tops_{0}'.format(merging_strategy) merge_func = getattr(self, merge_attr) if not hasattr(merge_f...
[ "def", "merge_tops", "(", "self", ",", "tops", ")", ":", "merging_strategy", "=", "self", ".", "opts", "[", "'top_file_merging_strategy'", "]", "try", ":", "merge_attr", "=", "'_merge_tops_{0}'", ".", "format", "(", "merging_strategy", ")", "merge_func", "=", ...
Cleanly merge the top files
[ "Cleanly", "merge", "the", "top", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3315-L3333
train
Cleanly merge the top files into a single object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._merge_tops_merge
def _merge_tops_merge(self, tops): ''' The default merging strategy. The base env is authoritative, so it is checked first, followed by the remaining environments. In top files from environments other than "base", only the section matching the environment from the top file will b...
python
def _merge_tops_merge(self, tops): ''' The default merging strategy. The base env is authoritative, so it is checked first, followed by the remaining environments. In top files from environments other than "base", only the section matching the environment from the top file will b...
[ "def", "_merge_tops_merge", "(", "self", ",", "tops", ")", ":", "top", "=", "DefaultOrderedDict", "(", "OrderedDict", ")", "# Check base env first as it is authoritative", "base_tops", "=", "tops", ".", "pop", "(", "'base'", ",", "DefaultOrderedDict", "(", "OrderedD...
The default merging strategy. The base env is authoritative, so it is checked first, followed by the remaining environments. In top files from environments other than "base", only the section matching the environment from the top file will be considered, and it too will be ignored if tha...
[ "The", "default", "merging", "strategy", ".", "The", "base", "env", "is", "authoritative", "so", "it", "is", "checked", "first", "followed", "by", "the", "remaining", "environments", ".", "In", "top", "files", "from", "environments", "other", "than", "base", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3335-L3384
train
Internal method to merge the top files into a single top file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._merge_tops_same
def _merge_tops_same(self, tops): ''' For each saltenv, only consider the top file from that saltenv. All sections matching a given saltenv, which appear in a different saltenv's top file, will be ignored. ''' top = DefaultOrderedDict(OrderedDict) for cenv, ctops ...
python
def _merge_tops_same(self, tops): ''' For each saltenv, only consider the top file from that saltenv. All sections matching a given saltenv, which appear in a different saltenv's top file, will be ignored. ''' top = DefaultOrderedDict(OrderedDict) for cenv, ctops ...
[ "def", "_merge_tops_same", "(", "self", ",", "tops", ")", ":", "top", "=", "DefaultOrderedDict", "(", "OrderedDict", ")", "for", "cenv", ",", "ctops", "in", "six", ".", "iteritems", "(", "tops", ")", ":", "if", "all", "(", "[", "x", "==", "{", "}", ...
For each saltenv, only consider the top file from that saltenv. All sections matching a given saltenv, which appear in a different saltenv's top file, will be ignored.
[ "For", "each", "saltenv", "only", "consider", "the", "top", "file", "from", "that", "saltenv", ".", "All", "sections", "matching", "a", "given", "saltenv", "which", "appear", "in", "a", "different", "saltenv", "s", "top", "file", "will", "be", "ignored", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3386-L3447
train
Merge the top files from the given tops with the same environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._merge_tops_merge_all
def _merge_tops_merge_all(self, tops): ''' Merge the top files into a single dictionary ''' def _read_tgt(tgt): match_type = None states = [] for item in tgt: if isinstance(item, dict): match_type = item ...
python
def _merge_tops_merge_all(self, tops): ''' Merge the top files into a single dictionary ''' def _read_tgt(tgt): match_type = None states = [] for item in tgt: if isinstance(item, dict): match_type = item ...
[ "def", "_merge_tops_merge_all", "(", "self", ",", "tops", ")", ":", "def", "_read_tgt", "(", "tgt", ")", ":", "match_type", "=", "None", "states", "=", "[", "]", "for", "item", "in", "tgt", ":", "if", "isinstance", "(", "item", ",", "dict", ")", ":",...
Merge the top files into a single dictionary
[ "Merge", "the", "top", "files", "into", "a", "single", "dictionary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3449-L3485
train
Merge the top files into a single dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.verify_tops
def verify_tops(self, tops): ''' Verify the contents of the top file data ''' errors = [] if not isinstance(tops, dict): errors.append('Top data was not formed as a dict') # No further checks will work, bail out return errors for salten...
python
def verify_tops(self, tops): ''' Verify the contents of the top file data ''' errors = [] if not isinstance(tops, dict): errors.append('Top data was not formed as a dict') # No further checks will work, bail out return errors for salten...
[ "def", "verify_tops", "(", "self", ",", "tops", ")", ":", "errors", "=", "[", "]", "if", "not", "isinstance", "(", "tops", ",", "dict", ")", ":", "errors", ".", "append", "(", "'Top data was not formed as a dict'", ")", "# No further checks will work, bail out",...
Verify the contents of the top file data
[ "Verify", "the", "contents", "of", "the", "top", "file", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3487-L3536
train
Verify the contents of the top file data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.get_top
def get_top(self): ''' Returns the high data derived from the top file ''' try: tops = self.get_tops() except SaltRenderError as err: log.error('Unable to render top file: %s', err.error) return {} return self.merge_tops(tops)
python
def get_top(self): ''' Returns the high data derived from the top file ''' try: tops = self.get_tops() except SaltRenderError as err: log.error('Unable to render top file: %s', err.error) return {} return self.merge_tops(tops)
[ "def", "get_top", "(", "self", ")", ":", "try", ":", "tops", "=", "self", ".", "get_tops", "(", ")", "except", "SaltRenderError", "as", "err", ":", "log", ".", "error", "(", "'Unable to render top file: %s'", ",", "err", ".", "error", ")", "return", "{",...
Returns the high data derived from the top file
[ "Returns", "the", "high", "data", "derived", "from", "the", "top", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3538-L3547
train
Returns the high data derived from the top file
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.top_matches
def top_matches(self, top): ''' Search through the top high data for matches and return the states that this minion needs to execute. Returns: {'saltenv': ['state1', 'state2', ...]} ''' matches = DefaultOrderedDict(OrderedDict) # pylint: disable=cell-var-...
python
def top_matches(self, top): ''' Search through the top high data for matches and return the states that this minion needs to execute. Returns: {'saltenv': ['state1', 'state2', ...]} ''' matches = DefaultOrderedDict(OrderedDict) # pylint: disable=cell-var-...
[ "def", "top_matches", "(", "self", ",", "top", ")", ":", "matches", "=", "DefaultOrderedDict", "(", "OrderedDict", ")", "# pylint: disable=cell-var-from-loop", "for", "saltenv", ",", "body", "in", "six", ".", "iteritems", "(", "top", ")", ":", "if", "self", ...
Search through the top high data for matches and return the states that this minion needs to execute. Returns: {'saltenv': ['state1', 'state2', ...]}
[ "Search", "through", "the", "top", "high", "data", "for", "matches", "and", "return", "the", "states", "that", "this", "minion", "needs", "to", "execute", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3549-L3601
train
Search through the top high data for matches and return the states that this minion needs to execute.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.load_dynamic
def load_dynamic(self, matches): ''' If autoload_dynamic_modules is True then automatically load the dynamic modules ''' if not self.opts['autoload_dynamic_modules']: return syncd = self.state.functions['saltutil.sync_all'](list(matches), ...
python
def load_dynamic(self, matches): ''' If autoload_dynamic_modules is True then automatically load the dynamic modules ''' if not self.opts['autoload_dynamic_modules']: return syncd = self.state.functions['saltutil.sync_all'](list(matches), ...
[ "def", "load_dynamic", "(", "self", ",", "matches", ")", ":", "if", "not", "self", ".", "opts", "[", "'autoload_dynamic_modules'", "]", ":", "return", "syncd", "=", "self", ".", "state", ".", "functions", "[", "'saltutil.sync_all'", "]", "(", "list", "(", ...
If autoload_dynamic_modules is True then automatically load the dynamic modules
[ "If", "autoload_dynamic_modules", "is", "True", "then", "automatically", "load", "the", "dynamic", "modules" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3610-L3622
train
Load the dynamic modules from the given matches.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.render_state
def render_state(self, sls, saltenv, mods, matches, local=False): ''' Render a state file and retrieve all of the include states ''' errors = [] if not local: state_data = self.client.get_state(sls, saltenv) fn_ = state_data.get('dest', False) else...
python
def render_state(self, sls, saltenv, mods, matches, local=False): ''' Render a state file and retrieve all of the include states ''' errors = [] if not local: state_data = self.client.get_state(sls, saltenv) fn_ = state_data.get('dest', False) else...
[ "def", "render_state", "(", "self", ",", "sls", ",", "saltenv", ",", "mods", ",", "matches", ",", "local", "=", "False", ")", ":", "errors", "=", "[", "]", "if", "not", "local", ":", "state_data", "=", "self", ".", "client", ".", "get_state", "(", ...
Render a state file and retrieve all of the include states
[ "Render", "a", "state", "file", "and", "retrieve", "all", "of", "the", "include", "states" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3624-L3807
train
Render a state file and retrieve all of the include states
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._handle_iorder
def _handle_iorder(self, state): ''' Take a state and apply the iorder system ''' if self.opts['state_auto_order']: for name in state: for s_dec in state[name]: if not isinstance(s_dec, six.string_types): # PyDSL Ord...
python
def _handle_iorder(self, state): ''' Take a state and apply the iorder system ''' if self.opts['state_auto_order']: for name in state: for s_dec in state[name]: if not isinstance(s_dec, six.string_types): # PyDSL Ord...
[ "def", "_handle_iorder", "(", "self", ",", "state", ")", ":", "if", "self", ".", "opts", "[", "'state_auto_order'", "]", ":", "for", "name", "in", "state", ":", "for", "s_dec", "in", "state", "[", "name", "]", ":", "if", "not", "isinstance", "(", "s_...
Take a state and apply the iorder system
[ "Take", "a", "state", "and", "apply", "the", "iorder", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3809-L3844
train
Take a state and apply the iorder system AttributeNames
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._handle_state_decls
def _handle_state_decls(self, state, sls, saltenv, errors): ''' Add sls and saltenv components to the state ''' for name in state: if not isinstance(state[name], dict): if name == '__extend__': continue if name == '__exclude...
python
def _handle_state_decls(self, state, sls, saltenv, errors): ''' Add sls and saltenv components to the state ''' for name in state: if not isinstance(state[name], dict): if name == '__extend__': continue if name == '__exclude...
[ "def", "_handle_state_decls", "(", "self", ",", "state", ",", "sls", ",", "saltenv", ",", "errors", ")", ":", "for", "name", "in", "state", ":", "if", "not", "isinstance", "(", "state", "[", "name", "]", ",", "dict", ")", ":", "if", "name", "==", "...
Add sls and saltenv components to the state
[ "Add", "sls", "and", "saltenv", "components", "to", "the", "state" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3846-L3901
train
Handle the state of the state files
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._handle_extend
def _handle_extend(self, state, sls, saltenv, errors): ''' Take the extend dec out of state and apply to the highstate global dec ''' if 'extend' in state: ext = state.pop('extend') if not isinstance(ext, dict): errors.append(('Extension va...
python
def _handle_extend(self, state, sls, saltenv, errors): ''' Take the extend dec out of state and apply to the highstate global dec ''' if 'extend' in state: ext = state.pop('extend') if not isinstance(ext, dict): errors.append(('Extension va...
[ "def", "_handle_extend", "(", "self", ",", "state", ",", "sls", ",", "saltenv", ",", "errors", ")", ":", "if", "'extend'", "in", "state", ":", "ext", "=", "state", ".", "pop", "(", "'extend'", ")", "if", "not", "isinstance", "(", "ext", ",", "dict", ...
Take the extend dec out of state and apply to the highstate global dec
[ "Take", "the", "extend", "dec", "out", "of", "state", "and", "apply", "to", "the", "highstate", "global", "dec" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3903-L3933
train
Handle the extend dec out of the state and apply to the highstate global dec
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._handle_exclude
def _handle_exclude(self, state, sls, saltenv, errors): ''' Take the exclude dec out of the state and apply it to the highstate global dec ''' if 'exclude' in state: exc = state.pop('exclude') if not isinstance(exc, list): err = ('Exclude D...
python
def _handle_exclude(self, state, sls, saltenv, errors): ''' Take the exclude dec out of the state and apply it to the highstate global dec ''' if 'exclude' in state: exc = state.pop('exclude') if not isinstance(exc, list): err = ('Exclude D...
[ "def", "_handle_exclude", "(", "self", ",", "state", ",", "sls", ",", "saltenv", ",", "errors", ")", ":", "if", "'exclude'", "in", "state", ":", "exc", "=", "state", ".", "pop", "(", "'exclude'", ")", "if", "not", "isinstance", "(", "exc", ",", "list...
Take the exclude dec out of the state and apply it to the highstate global dec
[ "Take", "the", "exclude", "dec", "out", "of", "the", "state", "and", "apply", "it", "to", "the", "highstate", "global", "dec" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3935-L3946
train
Handle the exclude declaration in the state and add it to the highstate AttributeNames global dec AttributeNames
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.render_highstate
def render_highstate(self, matches): ''' Gather the state files and render them into a single unified salt high data structure. ''' highstate = self.building_highstate all_errors = [] mods = set() statefiles = [] for saltenv, states in six.iteritem...
python
def render_highstate(self, matches): ''' Gather the state files and render them into a single unified salt high data structure. ''' highstate = self.building_highstate all_errors = [] mods = set() statefiles = [] for saltenv, states in six.iteritem...
[ "def", "render_highstate", "(", "self", ",", "matches", ")", ":", "highstate", "=", "self", ".", "building_highstate", "all_errors", "=", "[", "]", "mods", "=", "set", "(", ")", "statefiles", "=", "[", "]", "for", "saltenv", ",", "states", "in", "six", ...
Gather the state files and render them into a single unified salt high data structure.
[ "Gather", "the", "state", "files", "and", "render", "them", "into", "a", "single", "unified", "salt", "high", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L3948-L3995
train
Gather the state files and render them into a single unified salt high data structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState._check_pillar
def _check_pillar(self, force=False): ''' Check the pillar for errors, refuse to run the state if there are errors in the pillar and return the pillar errors ''' if force: return True if '_errors' in self.state.opts['pillar']: return False ...
python
def _check_pillar(self, force=False): ''' Check the pillar for errors, refuse to run the state if there are errors in the pillar and return the pillar errors ''' if force: return True if '_errors' in self.state.opts['pillar']: return False ...
[ "def", "_check_pillar", "(", "self", ",", "force", "=", "False", ")", ":", "if", "force", ":", "return", "True", "if", "'_errors'", "in", "self", ".", "state", ".", "opts", "[", "'pillar'", "]", ":", "return", "False", "return", "True" ]
Check the pillar for errors, refuse to run the state if there are errors in the pillar and return the pillar errors
[ "Check", "the", "pillar", "for", "errors", "refuse", "to", "run", "the", "state", "if", "there", "are", "errors", "in", "the", "pillar", "and", "return", "the", "pillar", "errors" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L4035-L4044
train
Check the pillar for errors and return the pillar errors
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.matches_whitelist
def matches_whitelist(self, matches, whitelist): ''' Reads over the matches and returns a matches dict with just the ones that are in the whitelist ''' if not whitelist: return matches ret_matches = {} if not isinstance(whitelist, list): wh...
python
def matches_whitelist(self, matches, whitelist): ''' Reads over the matches and returns a matches dict with just the ones that are in the whitelist ''' if not whitelist: return matches ret_matches = {} if not isinstance(whitelist, list): wh...
[ "def", "matches_whitelist", "(", "self", ",", "matches", ",", "whitelist", ")", ":", "if", "not", "whitelist", ":", "return", "matches", "ret_matches", "=", "{", "}", "if", "not", "isinstance", "(", "whitelist", ",", "list", ")", ":", "whitelist", "=", "...
Reads over the matches and returns a matches dict with just the ones that are in the whitelist
[ "Reads", "over", "the", "matches", "and", "returns", "a", "matches", "dict", "with", "just", "the", "ones", "that", "are", "in", "the", "whitelist" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L4046-L4061
train
Reads over the matches and returns a matches dict with just the ones that are in the whitelist
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.call_highstate
def call_highstate(self, exclude=None, cache=None, cache_name='highstate', force=False, whitelist=None, orchestration_jid=None): ''' Run the sequence to execute the salt highstate for this minion ''' # Check that top file exists tag_name = 'no_|-states_|-st...
python
def call_highstate(self, exclude=None, cache=None, cache_name='highstate', force=False, whitelist=None, orchestration_jid=None): ''' Run the sequence to execute the salt highstate for this minion ''' # Check that top file exists tag_name = 'no_|-states_|-st...
[ "def", "call_highstate", "(", "self", ",", "exclude", "=", "None", ",", "cache", "=", "None", ",", "cache_name", "=", "'highstate'", ",", "force", "=", "False", ",", "whitelist", "=", "None", ",", "orchestration_jid", "=", "None", ")", ":", "# Check that t...
Run the sequence to execute the salt highstate for this minion
[ "Run", "the", "sequence", "to", "execute", "the", "salt", "highstate", "for", "this", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L4063-L4142
train
Execute the salt highstate for this minion
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.compile_highstate
def compile_highstate(self): ''' Return just the highstate or the errors ''' err = [] top = self.get_top() err += self.verify_tops(top) matches = self.top_matches(top) high, errors = self.render_highstate(matches) err += errors if err: ...
python
def compile_highstate(self): ''' Return just the highstate or the errors ''' err = [] top = self.get_top() err += self.verify_tops(top) matches = self.top_matches(top) high, errors = self.render_highstate(matches) err += errors if err: ...
[ "def", "compile_highstate", "(", "self", ")", ":", "err", "=", "[", "]", "top", "=", "self", ".", "get_top", "(", ")", "err", "+=", "self", ".", "verify_tops", "(", "top", ")", "matches", "=", "self", ".", "top_matches", "(", "top", ")", "high", ",...
Return just the highstate or the errors
[ "Return", "just", "the", "highstate", "or", "the", "errors" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L4144-L4158
train
Return just the highstate or the errors
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
BaseHighState.compile_state_usage
def compile_state_usage(self): ''' Return all used and unused states for the minion based on the top match data ''' err = [] top = self.get_top() err += self.verify_tops(top) if err: return err matches = self.top_matches(top) state_us...
python
def compile_state_usage(self): ''' Return all used and unused states for the minion based on the top match data ''' err = [] top = self.get_top() err += self.verify_tops(top) if err: return err matches = self.top_matches(top) state_us...
[ "def", "compile_state_usage", "(", "self", ")", ":", "err", "=", "[", "]", "top", "=", "self", ".", "get_top", "(", ")", "err", "+=", "self", ".", "verify_tops", "(", "top", ")", "if", "err", ":", "return", "err", "matches", "=", "self", ".", "top_...
Return all used and unused states for the minion based on the top match data
[ "Return", "all", "used", "and", "unused", "states", "for", "the", "minion", "based", "on", "the", "top", "match", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L4187-L4223
train
Compile the state usage for the minion based on the top match data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
MasterState.load_modules
def load_modules(self, data=None, proxy=None): ''' Load the modules into the state ''' log.info('Loading fresh modules for state activity') # Load a modified client interface that looks like the interface used # from the minion, but uses remote execution # ...
python
def load_modules(self, data=None, proxy=None): ''' Load the modules into the state ''' log.info('Loading fresh modules for state activity') # Load a modified client interface that looks like the interface used # from the minion, but uses remote execution # ...
[ "def", "load_modules", "(", "self", ",", "data", "=", "None", ",", "proxy", "=", "None", ")", ":", "log", ".", "info", "(", "'Loading fresh modules for state activity'", ")", "# Load a modified client interface that looks like the interface used", "# from the minion, but us...
Load the modules into the state
[ "Load", "the", "modules", "into", "the", "state" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L4298-L4315
train
Load the modules into the state
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/state.py
RemoteHighState.compile_master
def compile_master(self): ''' Return the state data from the master ''' load = {'grains': self.grains, 'opts': self.opts, 'cmd': '_master_state'} try: return self.channel.send(load, tries=3, timeout=72000) except SaltReqTimeoutE...
python
def compile_master(self): ''' Return the state data from the master ''' load = {'grains': self.grains, 'opts': self.opts, 'cmd': '_master_state'} try: return self.channel.send(load, tries=3, timeout=72000) except SaltReqTimeoutE...
[ "def", "compile_master", "(", "self", ")", ":", "load", "=", "{", "'grains'", ":", "self", ".", "grains", ",", "'opts'", ":", "self", ".", "opts", ",", "'cmd'", ":", "'_master_state'", "}", "try", ":", "return", "self", ".", "channel", ".", "send", "...
Return the state data from the master
[ "Return", "the", "state", "data", "from", "the", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/state.py#L4348-L4358
train
Return the state data from the master
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/output/txt.py
output
def output(data, **kwargs): # pylint: disable=unused-argument ''' Output the data in lines, very nice for running commands ''' ret = '' if hasattr(data, 'keys'): for key in data: value = data[key] # Don't blow up on non-strings try: for li...
python
def output(data, **kwargs): # pylint: disable=unused-argument ''' Output the data in lines, very nice for running commands ''' ret = '' if hasattr(data, 'keys'): for key in data: value = data[key] # Don't blow up on non-strings try: for li...
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "ret", "=", "''", "if", "hasattr", "(", "data", ",", "'keys'", ")", ":", "for", "key", "in", "data", ":", "value", "=", "data", "[", "key", "]", "# ...
Output the data in lines, very nice for running commands
[ "Output", "the", "data", "in", "lines", "very", "nice", "for", "running", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/txt.py#L16-L37
train
Output the data in lines very nice for running commands
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/utils/configcomparer.py
compare_and_update_config
def compare_and_update_config(config, update_config, changes, namespace=''): ''' Recursively compare two configs, writing any needed changes to the update_config and capturing changes in the changes dict. ''' if isinstance(config, dict): if not update_config: if config: ...
python
def compare_and_update_config(config, update_config, changes, namespace=''): ''' Recursively compare two configs, writing any needed changes to the update_config and capturing changes in the changes dict. ''' if isinstance(config, dict): if not update_config: if config: ...
[ "def", "compare_and_update_config", "(", "config", ",", "update_config", ",", "changes", ",", "namespace", "=", "''", ")", ":", "if", "isinstance", "(", "config", ",", "dict", ")", ":", "if", "not", "update_config", ":", "if", "config", ":", "# the updated c...
Recursively compare two configs, writing any needed changes to the update_config and capturing changes in the changes dict.
[ "Recursively", "compare", "two", "configs", "writing", "any", "needed", "changes", "to", "the", "update_config", "and", "capturing", "changes", "in", "the", "changes", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/configcomparer.py#L14-L112
train
Recursively compare two configs writing any needed changes to the update_config and capturing changes in the changes dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/states/memcached.py
managed
def managed(name, value=None, host=DEFAULT_HOST, port=DEFAULT_PORT, time=DEFAULT_TIME, min_compress_len=DEFAULT_MIN_COMPRESS_LEN): ''' Manage a memcached key. name The key to manage value The value to set for that key hos...
python
def managed(name, value=None, host=DEFAULT_HOST, port=DEFAULT_PORT, time=DEFAULT_TIME, min_compress_len=DEFAULT_MIN_COMPRESS_LEN): ''' Manage a memcached key. name The key to manage value The value to set for that key hos...
[ "def", "managed", "(", "name", ",", "value", "=", "None", ",", "host", "=", "DEFAULT_HOST", ",", "port", "=", "DEFAULT_PORT", ",", "time", "=", "DEFAULT_TIME", ",", "min_compress_len", "=", "DEFAULT_MIN_COMPRESS_LEN", ")", ":", "ret", "=", "{", "'name'", "...
Manage a memcached key. name The key to manage value The value to set for that key host The memcached server IP address port The memcached server port .. code-block:: yaml foo: memcached.managed: - value: bar
[ "Manage", "a", "memcached", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/memcached.py#L34-L101
train
Manage a memcached key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
parse_hosts
def parse_hosts(hostsfile='/etc/hosts', hosts=None): ''' Parse /etc/hosts file. CLI Example: .. code-block:: bash salt '*' dnsutil.parse_hosts ''' if not hosts: try: with salt.utils.files.fopen(hostsfile, 'r') as fp_: hosts = salt.utils.stringutils....
python
def parse_hosts(hostsfile='/etc/hosts', hosts=None): ''' Parse /etc/hosts file. CLI Example: .. code-block:: bash salt '*' dnsutil.parse_hosts ''' if not hosts: try: with salt.utils.files.fopen(hostsfile, 'r') as fp_: hosts = salt.utils.stringutils....
[ "def", "parse_hosts", "(", "hostsfile", "=", "'/etc/hosts'", ",", "hosts", "=", "None", ")", ":", "if", "not", "hosts", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "hostsfile", ",", "'r'", ")", "as", "fp_", ":", ...
Parse /etc/hosts file. CLI Example: .. code-block:: bash salt '*' dnsutil.parse_hosts
[ "Parse", "/", "etc", "/", "hosts", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L32-L60
train
Parse the hosts file and return a dict of the hosts that are available in the hosts file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
hosts_append
def hosts_append(hostsfile='/etc/hosts', ip_addr=None, entries=None): ''' Append a single line to the /etc/hosts file. CLI Example: .. code-block:: bash salt '*' dnsutil.hosts_append /etc/hosts 127.0.0.1 ad1.yuk.co,ad2.yuk.co ''' host_list = entries.split(',') hosts = parse_hosts(...
python
def hosts_append(hostsfile='/etc/hosts', ip_addr=None, entries=None): ''' Append a single line to the /etc/hosts file. CLI Example: .. code-block:: bash salt '*' dnsutil.hosts_append /etc/hosts 127.0.0.1 ad1.yuk.co,ad2.yuk.co ''' host_list = entries.split(',') hosts = parse_hosts(...
[ "def", "hosts_append", "(", "hostsfile", "=", "'/etc/hosts'", ",", "ip_addr", "=", "None", ",", "entries", "=", "None", ")", ":", "host_list", "=", "entries", ".", "split", "(", "','", ")", "hosts", "=", "parse_hosts", "(", "hostsfile", "=", "hostsfile", ...
Append a single line to the /etc/hosts file. CLI Example: .. code-block:: bash salt '*' dnsutil.hosts_append /etc/hosts 127.0.0.1 ad1.yuk.co,ad2.yuk.co
[ "Append", "a", "single", "line", "to", "the", "/", "etc", "/", "hosts", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L63-L88
train
Append a single line to the hosts file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
hosts_remove
def hosts_remove(hostsfile='/etc/hosts', entries=None): ''' Remove a host from the /etc/hosts file. If doing so will leave a line containing only an IP address, then the line will be deleted. This function will leave comments and blank lines intact. CLI Examples: .. code-block:: bash ...
python
def hosts_remove(hostsfile='/etc/hosts', entries=None): ''' Remove a host from the /etc/hosts file. If doing so will leave a line containing only an IP address, then the line will be deleted. This function will leave comments and blank lines intact. CLI Examples: .. code-block:: bash ...
[ "def", "hosts_remove", "(", "hostsfile", "=", "'/etc/hosts'", ",", "entries", "=", "None", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "hostsfile", ",", "'r'", ")", "as", "fp_", ":", "hosts", "=", "salt", ".", "utils", "....
Remove a host from the /etc/hosts file. If doing so will leave a line containing only an IP address, then the line will be deleted. This function will leave comments and blank lines intact. CLI Examples: .. code-block:: bash salt '*' dnsutil.hosts_remove /etc/hosts ad1.yuk.co salt '*'...
[ "Remove", "a", "host", "from", "the", "/", "etc", "/", "hosts", "file", ".", "If", "doing", "so", "will", "leave", "a", "line", "containing", "only", "an", "IP", "address", "then", "the", "line", "will", "be", "deleted", ".", "This", "function", "will"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L91-L119
train
Remove a host from the hosts file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
parse_zone
def parse_zone(zonefile=None, zone=None): ''' Parses a zone file. Can be passed raw zone data on the API level. CLI Example: .. code-block:: bash salt ns1 dnsutil.parse_zone /var/lib/named/example.com.zone ''' if zonefile: try: with salt.utils.files.fopen(zonefile,...
python
def parse_zone(zonefile=None, zone=None): ''' Parses a zone file. Can be passed raw zone data on the API level. CLI Example: .. code-block:: bash salt ns1 dnsutil.parse_zone /var/lib/named/example.com.zone ''' if zonefile: try: with salt.utils.files.fopen(zonefile,...
[ "def", "parse_zone", "(", "zonefile", "=", "None", ",", "zone", "=", "None", ")", ":", "if", "zonefile", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "zonefile", ",", "'r'", ")", "as", "fp_", ":", "zone", "=", "...
Parses a zone file. Can be passed raw zone data on the API level. CLI Example: .. code-block:: bash salt ns1 dnsutil.parse_zone /var/lib/named/example.com.zone
[ "Parses", "a", "zone", "file", ".", "Can", "be", "passed", "raw", "zone", "data", "on", "the", "API", "level", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L122-L197
train
Parses a zone file and returns a list of dicts.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
_to_seconds
def _to_seconds(timestr): ''' Converts a time value to seconds. As per RFC1035 (page 45), max time is 1 week, so anything longer (or unreadable) will be set to one week (604800 seconds). ''' timestr = timestr.upper() if 'H' in timestr: seconds = int(timestr.replace('H', '')) * 3600 ...
python
def _to_seconds(timestr): ''' Converts a time value to seconds. As per RFC1035 (page 45), max time is 1 week, so anything longer (or unreadable) will be set to one week (604800 seconds). ''' timestr = timestr.upper() if 'H' in timestr: seconds = int(timestr.replace('H', '')) * 3600 ...
[ "def", "_to_seconds", "(", "timestr", ")", ":", "timestr", "=", "timestr", ".", "upper", "(", ")", "if", "'H'", "in", "timestr", ":", "seconds", "=", "int", "(", "timestr", ".", "replace", "(", "'H'", ",", "''", ")", ")", "*", "3600", "elif", "'D'"...
Converts a time value to seconds. As per RFC1035 (page 45), max time is 1 week, so anything longer (or unreadable) will be set to one week (604800 seconds).
[ "Converts", "a", "time", "value", "to", "seconds", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L200-L221
train
Converts a time value to seconds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
A
def A(host, nameserver=None): ''' Return the A record(s) for ``host``. Always returns a list. CLI Example: .. code-block:: bash salt ns1 dnsutil.A www.google.com ''' if _has_dig(): return __salt__['dig.A'](host, nameserver) elif nameserver is None: # fall back...
python
def A(host, nameserver=None): ''' Return the A record(s) for ``host``. Always returns a list. CLI Example: .. code-block:: bash salt ns1 dnsutil.A www.google.com ''' if _has_dig(): return __salt__['dig.A'](host, nameserver) elif nameserver is None: # fall back...
[ "def", "A", "(", "host", ",", "nameserver", "=", "None", ")", ":", "if", "_has_dig", "(", ")", ":", "return", "__salt__", "[", "'dig.A'", "]", "(", "host", ",", "nameserver", ")", "elif", "nameserver", "is", "None", ":", "# fall back to the socket interfac...
Return the A record(s) for ``host``. Always returns a list. CLI Example: .. code-block:: bash salt ns1 dnsutil.A www.google.com
[ "Return", "the", "A", "record", "(", "s", ")", "for", "host", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L249-L271
train
Return the A record(s ) for host.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
AAAA
def AAAA(host, nameserver=None): ''' Return the AAAA record(s) for ``host``. Always returns a list. .. versionadded:: 2014.7.5 CLI Example: .. code-block:: bash salt ns1 dnsutil.AAAA www.google.com ''' if _has_dig(): return __salt__['dig.AAAA'](host, nameserver) ...
python
def AAAA(host, nameserver=None): ''' Return the AAAA record(s) for ``host``. Always returns a list. .. versionadded:: 2014.7.5 CLI Example: .. code-block:: bash salt ns1 dnsutil.AAAA www.google.com ''' if _has_dig(): return __salt__['dig.AAAA'](host, nameserver) ...
[ "def", "AAAA", "(", "host", ",", "nameserver", "=", "None", ")", ":", "if", "_has_dig", "(", ")", ":", "return", "__salt__", "[", "'dig.AAAA'", "]", "(", "host", ",", "nameserver", ")", "elif", "nameserver", "is", "None", ":", "# fall back to the socket in...
Return the AAAA record(s) for ``host``. Always returns a list. .. versionadded:: 2014.7.5 CLI Example: .. code-block:: bash salt ns1 dnsutil.AAAA www.google.com
[ "Return", "the", "AAAA", "record", "(", "s", ")", "for", "host", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L274-L298
train
Return the AAAA record for host.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
NS
def NS(domain, resolve=True, nameserver=None): ''' Return a list of IPs of the nameservers for ``domain`` If 'resolve' is False, don't resolve names. CLI Example: .. code-block:: bash salt ns1 dnsutil.NS google.com ''' if _has_dig(): return __salt__['dig.NS'](domain, res...
python
def NS(domain, resolve=True, nameserver=None): ''' Return a list of IPs of the nameservers for ``domain`` If 'resolve' is False, don't resolve names. CLI Example: .. code-block:: bash salt ns1 dnsutil.NS google.com ''' if _has_dig(): return __salt__['dig.NS'](domain, res...
[ "def", "NS", "(", "domain", ",", "resolve", "=", "True", ",", "nameserver", "=", "None", ")", ":", "if", "_has_dig", "(", ")", ":", "return", "__salt__", "[", "'dig.NS'", "]", "(", "domain", ",", "resolve", ",", "nameserver", ")", "return", "'This func...
Return a list of IPs of the nameservers for ``domain`` If 'resolve' is False, don't resolve names. CLI Example: .. code-block:: bash salt ns1 dnsutil.NS google.com
[ "Return", "a", "list", "of", "IPs", "of", "the", "nameservers", "for", "domain" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L301-L317
train
Return a list of IPs of the nameserver for the given domain
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
MX
def MX(domain, resolve=False, nameserver=None): ''' Return a list of lists for the MX of ``domain``. If the 'resolve' argument is True, resolve IPs for the servers. It's limited to one IP, because although in practice it's very rarely a round robin, it is an acceptable configuration and pulling ju...
python
def MX(domain, resolve=False, nameserver=None): ''' Return a list of lists for the MX of ``domain``. If the 'resolve' argument is True, resolve IPs for the servers. It's limited to one IP, because although in practice it's very rarely a round robin, it is an acceptable configuration and pulling ju...
[ "def", "MX", "(", "domain", ",", "resolve", "=", "False", ",", "nameserver", "=", "None", ")", ":", "if", "_has_dig", "(", ")", ":", "return", "__salt__", "[", "'dig.MX'", "]", "(", "domain", ",", "resolve", ",", "nameserver", ")", "return", "'This fun...
Return a list of lists for the MX of ``domain``. If the 'resolve' argument is True, resolve IPs for the servers. It's limited to one IP, because although in practice it's very rarely a round robin, it is an acceptable configuration and pulling just one IP lets the data be similar to the non-resolved v...
[ "Return", "a", "list", "of", "lists", "for", "the", "MX", "of", "domain", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L340-L360
train
Return a list of lists for the MX of the given domain.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/modules/dnsutil.py
serial
def serial(zone='', update=False): ''' Return, store and update a dns serial for your zone files. zone: a keyword for a specific zone update: store an updated version of the serial in a grain If ``update`` is False, the function will retrieve an existing serial or return the current date if n...
python
def serial(zone='', update=False): ''' Return, store and update a dns serial for your zone files. zone: a keyword for a specific zone update: store an updated version of the serial in a grain If ``update`` is False, the function will retrieve an existing serial or return the current date if n...
[ "def", "serial", "(", "zone", "=", "''", ",", "update", "=", "False", ")", ":", "grains", "=", "{", "}", "key", "=", "'dnsserial'", "if", "zone", ":", "key", "+=", "'_{0}'", ".", "format", "(", "zone", ")", "stored", "=", "__salt__", "[", "'grains....
Return, store and update a dns serial for your zone files. zone: a keyword for a specific zone update: store an updated version of the serial in a grain If ``update`` is False, the function will retrieve an existing serial or return the current date if no serial is stored. Nothing will be stored ...
[ "Return", "store", "and", "update", "a", "dns", "serial", "for", "your", "zone", "files", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsutil.py#L363-L401
train
Return a dns serial for your zone files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
saltstack/salt
salt/master.py
Maintenance._post_fork_init
def _post_fork_init(self): ''' Some things need to be init'd after the fork has completed The easiest example is that one of these module types creates a thread in the parent process, then once the fork happens you'll start getting errors like "WARNING: Mixing fork() and threads ...
python
def _post_fork_init(self): ''' Some things need to be init'd after the fork has completed The easiest example is that one of these module types creates a thread in the parent process, then once the fork happens you'll start getting errors like "WARNING: Mixing fork() and threads ...
[ "def", "_post_fork_init", "(", "self", ")", ":", "# Load Runners", "ropts", "=", "dict", "(", "self", ".", "opts", ")", "ropts", "[", "'quiet'", "]", "=", "True", "runner_client", "=", "salt", ".", "runner", ".", "RunnerClient", "(", "ropts", ")", "# Loa...
Some things need to be init'd after the fork has completed The easiest example is that one of these module types creates a thread in the parent process, then once the fork happens you'll start getting errors like "WARNING: Mixing fork() and threads detected; memory leaked."
[ "Some", "things", "need", "to", "be", "init", "d", "after", "the", "fork", "has", "completed", "The", "easiest", "example", "is", "that", "one", "of", "these", "module", "types", "creates", "a", "thread", "in", "the", "parent", "process", "then", "once", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/master.py#L179-L212
train
This function is called after the fork has completed and is ready to initialize the object
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...