(func)
return inner
calculate Mantl vars
calculate Mantl vars
calculate Mantl vars
def calculate_mantl_vars(func):
    """calculate Mantl vars"""

    @wraps(func)
    def inner(*args, **kwargs):
        name, attrs, groups = func(*args, **kwargs)

        # attrs
        if attrs.get('role', '') == 'control':
            attrs['consul_is_server'] = True
        else:
            attrs['consul_is_server'] = False

        # groups
        if attrs.get('publicly_routable', False):
            groups.append('publicly_routable')

        return name, attrs, groups

    return inner
def calculate_mantl_vars ( func ) : @ wraps ( func ) def inner ( * args , * * kwargs ) : name , attrs , groups = func ( * args , * * kwargs ) # attrs if attrs . get ( 'role' , '' ) == 'control' : attrs [ 'consul_is_server' ] = True else : attrs [ 'consul_is_server' ] = False # groups if attrs . get ( 'publicly_routable' , False ) : groups . append ( 'publicly_routable' ) return name , attrs , groups return inner