def rtask(*roles):
"role task. this task is only available for certain roles specified in the BLDR_ROLE env var"
def wrapper(func):
role_env = os.getenv('BLDR_ROLE')
if role_env in roles:
# a role has been set
return task(func)
return func
return wrapper
# pylint: disable=invalid-name
评论列表
文章目录