def check_stage_and_role(): stage = env.get('stage') role = env.get('role') # raise error when env/role not set both if not stage or not role: abort('stage or role not set!')