def _update_hosting_device_exclusivity(self, context, hosting_device,<EOL>tenant_id):
with context.session.begin(subtransactions=True):<EOL><INDENT>hosting_device['<STR_LIT>'] = tenant_id<EOL>context.session.add(hosting_device)<EOL>for item in (context.session.query(hd_models.SlotAllocation).<EOL>filter_by(hosting_device_id=hosting_device['<STR_LIT:id>'])):<EOL><INDENT>item['<STR_LIT>'] = tenant_id<EOL>context.session.add(item)<EOL><DEDENT><DEDENT>
Make <hosting device> bound or unbound to <tenant_id>.

        If <tenant_id> is None the device is unbound, otherwise it gets bound
        to that <tenant_id>