예제 #1
0
def set_group(agent_id, group_id, quiet=False):
    ans = 'n'
    if not quiet:
         ans = get_stdin("Do you want to set the group '{0}' to the agent '{1}'? [y/N]: ".format(group_id, agent_id))
    else:
        ans = 'y'

    if ans.lower() == 'y':
        msg = Agent.set_group(agent_id, group_id)
    else:
        msg = "Cancelled."

    print(msg)
예제 #2
0
def set_group(agent_id, group_id, quiet=False, replace=False):
    ans = 'n'
    agent_id = "{}".format(int(agent_id)).zfill(3)
    if not quiet:
        ans = get_stdin(
            "Do you want to add the group '{0}' to the agent '{1}'? [y/N]: ".
            format(group_id, agent_id))
    else:
        ans = 'y'

    if ans.lower() == 'y':
        msg = Agent.set_group(agent_id=agent_id,
                              group_id=group_id,
                              replace=replace)
    else:
        msg = "Cancelled."

    print(msg)