def unassign_hosting_device_from_cfg_agent(self, context, cfg_agent_id,<EOL>hosting_device_id):
hd_db = self._get_hosting_device(context, hosting_device_id)<EOL>if hd_db.cfg_agent_id is None and cfg_agent_id is None:<EOL><INDENT>return<EOL><DEDENT>elif hd_db.cfg_agent_id != cfg_agent_id:<EOL><INDENT>LOG.debug('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>{'<STR_LIT>': hosting_device_id,<EOL>'<STR_LIT>': cfg_agent_id})<EOL>raise ciscocfgagentscheduler.HostingDeviceNotAssignedToCfgAgent(<EOL>hosting_device_id=hosting_device_id, agent_id=cfg_agent_id)<EOL><DEDENT>cfg_agent_db = get_agent_db_obj(self._get_agent(context, cfg_agent_id))<EOL>cfg_notifier = self.agent_notifiers.get(c_constants.AGENT_TYPE_CFG)<EOL>if cfg_notifier:<EOL><INDENT>cfg_notifier.hosting_devices_unassigned_from_cfg_agent(<EOL>context, [hosting_device_id], cfg_agent_db.host)<EOL><DEDENT>self._bind_hosting_device_to_cfg_agent(context, hd_db, None)<EOL>
Make config agent handle an (unassigned) hosting device.