'Removes an agent from its (backend-specific) unique
identifier.'

def del_agent(self, agentid, wait_results=True):

    agent = self.get_agent(agentid)
    master = self.get_master(agent['master'])
    self.unassign_agent(agentid, dont_reuse=True)
    path = self.get_local_path(agent, 'input')
    dstdir = os.path.join(master['path'], 'onhold')
    for fname in os.listdir(path):
        shutil.move(os.path.join(path, fname), dstdir)
    if wait_results:
        self.sync(agentid)
