make invalid hosts viewable in the AFE view host tab
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3729 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index 601e432..40f9639 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -127,8 +127,12 @@
def get_host_query(multiple_labels, exclude_only_if_needed_labels,
- exclude_atomic_group_hosts, filter_data):
- query = models.Host.valid_objects.all()
+ exclude_atomic_group_hosts, valid_only, filter_data):
+ if valid_only:
+ query = models.Host.valid_objects.all()
+ else:
+ query = models.Host.objects.all()
+
if exclude_only_if_needed_labels:
only_if_needed_labels = models.Label.valid_objects.filter(
only_if_needed=True)
@@ -141,6 +145,7 @@
join_condition=('hosts_labels_exclude_OIN.label_id IN (%s)'
% only_if_needed_ids),
suffix='_exclude_OIN', exclude=True)
+
if exclude_atomic_group_hosts:
atomic_group_labels = models.Label.valid_objects.filter(
atomic_group__isnull=False)
@@ -153,7 +158,9 @@
join_condition=('hosts_labels_exclude_AG.label_id IN (%s)'
% atomic_group_label_ids),
suffix='_exclude_AG', exclude=True)
- filter_data['extra_args'] = (extra_host_filters(multiple_labels))
+
+ assert 'extra_args' not in filter_data
+ filter_data['extra_args'] = extra_host_filters(multiple_labels)
return models.Host.query_objects(filter_data, initial_query=query)