sceptre/helpers.py
def recurse_into_sub_environments(func):
    """
    Two types of Environments exist, non-leaf and leaf. Non-leaf environments
    contain sub-environments, while leaf environments contain stacks. If a
    command is executed by a leaf environment, it should execute that command
    on the stacks it contains. If a command is executed by a non-leaf
    environment, it should invoke that command on each of its sub-environments.
    recurse is a decorator used by sceptre.environment.Environment to do this.
    The function passed, ``func``, must return a dictionary.
    """
    @wraps(func)
    def decorated(self, *args, **kwargs):
        if self.is_leaf:
            return func(self, *args, **kwargs)
        else:
            function_name = func.__name__
            responses = {}
            num_environments = len(self.environments)

            # As commands carried out by sub-environments may be blocking,
            # execute them on separate threads.
            with ThreadPoolExecutor(max_workers=num_environments) as executor:
                futures = [
                    executor.submit(
                        getattr(environment, function_name), *args, **kwargs
                    )
                    for environment in self.environments.values()
                ]
                for future in as_completed(futures):
                    response = future.result()
                    if response:
                        responses.update(response)
            return responses

    return decorated

    Two types of Environments exist, non-leaf and leaf. Non-leaf environments
    contain sub-environments, while leaf environments contain stacks. If a
    command is executed by a leaf environment, it should execute that command
    on the stacks it contains. If a command is executed by a non-leaf
    environment, it should invoke that command on each of its sub-environments.
    recurse is a decorator used by sceptre.environment.Environment to do this.
    The function passed, ``func``, must return a dictionary.
    
Two types of Environments exist, non-leaf and leaf. Non-leaf environments
contain sub-environments, while leaf environments contain stacks. If a
command is executed by a leaf environment, it should execute that command
on the stacks it contains. If a command is executed by a non-leaf
environment, it should invoke that command on each of its sub-environments.
recurse is a decorator used by sceptre.environment.Environment to do this.
The function passed, ``func``, must return a dictionary.
Two types of Environments exist non - leaf and leaf . Non - leaf environments contain sub - environments while leaf environments contain stacks . If a command is executed by a leaf environment it should execute that command on the stacks it contains . If a command is executed by a non - leaf environment it should invoke that command on each of its sub - environments . recurse is a decorator used by sceptre . environment . Environment to do this . The function passed ` ` func ` ` must return a dictionary .
def recurse_into_sub_environments(func):
    @wraps(func)
    def decorated(self, *args, **kwargs):
        if self.is_leaf:
            return func(self, *args, **kwargs)
        else:
            function_name = func.__name__
            responses = {}
            num_environments = len(self.environments)
            with ThreadPoolExecutor(max_workers=num_environments) as executor:
                futures = [
                    executor.submit(
                        getattr(environment, function_name), *args, **kwargs
                    )
                    for environment in self.environments.values()
                ]
                for future in as_completed(futures):
                    response = future.result()
                    if response:
                        responses.update(response)
            return responses
    return decorated
def recurse_into_sub_environments ( func ) : @ wraps ( func ) def decorated ( self , * args , ** kwargs ) : if self . is_leaf : return func ( self , * args , ** kwargs ) else : function_name = func . __name__ responses = { } num_environments = len ( self . environments ) with ThreadPoolExecutor ( max_workers = num_environments ) as executor : futures = [ executor . submit ( getattr ( environment , function_name ) , * args , ** kwargs ) for environment in self . environments . values ( ) ] for future in as_completed ( futures ) : response = future . result ( ) if response : responses . update ( response ) return responses return decorated
Two types of Environments exist, non-leaf and leaf.
Two types of Environments exist non - leaf and leaf .
"""
    Two types of Environments exist, non-leaf and leaf. Non-leaf environments
    contain sub-environments, while leaf environments contain stacks. If a
    command is executed by a leaf environment, it should execute that command
    on the stacks it contains. If a command is executed by a non-leaf
    environment, it should invoke that command on each of its sub-environments.
    recurse is a decorator used by sceptre.environment.Environment to do this.
    The function passed, ``func``, must return a dictionary.
    """ # As commands carried out by sub-environments may be blocking, # execute them on separate threads.
func