Skip to content

Commit

Permalink
Fix issue #555
Browse files Browse the repository at this point in the history
  • Loading branch information
lausser committed Aug 29, 2012
1 parent 32807d5 commit ac3ee6c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ def categorize(self):
try:
num_hosts = 0
for i, _ in enumerate(self.structured_data):
if self.structured_data[i][0] == 'Filter' and self.structured_data[i][1] == 'host_name':
if self.structured_data[i+1][0] == 'Filter' and self.structured_data[i+1][1] == 'host_name':
if self.structured_data[i][0] == 'Filter' and self.structured_data[i][1] == 'name':
if self.structured_data[i+1][0] == 'Filter' and self.structured_data[i+1][1] == 'name':
num_hosts += 1
hosts.append(self.structured_data[i][3])
elif self.structured_data[i+1][0] == 'Or' and self.structured_data[i+1][1] == num_hosts + 1:
Expand All @@ -394,7 +394,7 @@ def categorize(self):
except Exception, exp:
only_hosts = False
if only_hosts:
if len(hosts) == len(filter(lambda x: x[0] == 'Filter' and x[1] == 'host_name', self.structured_data)):
if len(hosts) == len(filter(lambda x: x[0] == 'Filter' and x[1] == 'name', self.structured_data)):
hosts = list(set(hosts))
hosts.sort()
self.query_hints['target'] = HINT_HOSTS
Expand Down

0 comments on commit ac3ee6c

Please sign in to comment.