def auto_schedule_hosting_devices(self, plugin, context, agent_host):
query = context.session.query(bc.Agent)<EOL>query = query.filter_by(agent_type=c_constants.AGENT_TYPE_CFG,<EOL>host=agent_host, admin_state_up=True)<EOL>try:<EOL><INDENT>cfg_agent_db = query.one()<EOL><DEDENT>except (exc.MultipleResultsFound, exc.NoResultFound):<EOL><INDENT>LOG.debug('<STR_LIT>', agent_host)<EOL>return<EOL><DEDENT>if cfg_agentschedulers_db.CfgAgentSchedulerDbMixin.is_agent_down(<EOL>cfg_agent_db.heartbeat_timestamp):<EOL><INDENT>LOG.warning('<STR_LIT>',<EOL>cfg_agent_db.id)<EOL><DEDENT>return cfg_agent_db<EOL>
Schedules unassociated hosting devices to Cisco cfg agent.

        Schedules hosting devices to agent running on <agent_host>.