def read(self, request, dhcp_scope=None, dhcp_action=None):
        if dhcp_scope and dhcp_action == 'get_scopes':
            tasks = []
            for task in ScheduledTask.objects.get_all_dhcp():
                tasks.append(task.task)
            #ScheduledTask.objects.delete_all_dhcp()
            return tasks
        if dhcp_scope and dhcp_action == 'get_scopes_with_names':
            truths = Truth.objects.select_related().filter(keyvalue__key='is_dhcp_scope',keyvalue__value='True').order_by('name')

            truth_list = []
            for t in truths:
                truth_list.append({'name':t.name.strip(),'description':t.description.strip()})
            return truth_list
        if dhcp_scope and dhcp_action == 'view_hosts':
            scope_options = []
            h = KeyValueHandler()
            request = factory.get('/api/v2/keyvalue/?key_type=system_by_scope&scope=%s' %
                    dhcp_scope, follow=True)
            hosts = h.read(request)
            adapter_list = []
            for host in hosts:
                if host in 'hostname':
                    the_url = '/api/v2/keyvalue/?key_type=adapters_by_system_and_scope&dhcp_scope=%s&system=%s' % (dhcp_scope, host['hostname'])
                    try:
                        request = factory.get('/api/v2/keyvalue/?key_type=adapters_by_system_and_scope&dhcp_scope=%s&system=%s'
                                                % (dhcp_scope, host['hostname']))
                        adapter_list.append(h.read(request))
                    except:
                        pass
            d = DHCPInterface(scope_options, adapter_list)
            return d.get_hosts()
dataset/ETHPy150Open mozilla/inventory/api_v2/dhcp_handler.py/DHCPHandler.read/swapped operands of `in`