def calculate_mantl_vars(func):
 @wraps(func)
 def inner(*args, **kwargs):
  (name, attrs, groups) = func(*args, **kwargs)
  if (attrs.get(u'role', u'') == u'control'):
   attrs[u'consul_is_server'] = True
  else:
   attrs[u'consul_is_server'] = False
  if attrs.get(u'publicly_routable', False):
   groups.append(u'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 ) if ( attrs . get ( u'role' , u'' ) == u'control' ) : attrs [ u'consul_is_server' ] = True else : attrs [ u'consul_is_server' ] = False if attrs . get ( u'publicly_routable' , False ) : groups . append ( u'publicly_routable' ) return ( name , attrs , groups ) return inner
calculate mantl vars .