~fo0bar/turku/bionic

« back to all changes in this revision

Viewing changes to scripts/turku_health

  • Committer: Ryan Finnie
  • Date: 2015-03-27 07:22:30 UTC
  • Revision ID: ryan.finnie@canonical.com-20150327072230-0jflqg0a9sz6gbqr
Add machine/storage published options

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
sources_sick = 0
33
33
sick_objects = []
34
34
 
35
 
for storage in Storage.objects.filter(active=True):
 
35
for storage in Storage.objects.filter(active=True, published=True):
36
36
    storages_total += 1
37
37
    if not storage.healthy():
38
38
        storages_sick += 1
39
39
        sick_objects.append(repr(storage))
40
40
 
41
 
for machine in Machine.objects.filter(active=True):
 
41
for machine in Machine.objects.filter(active=True, published=True):
42
42
    machines_total += 1
43
43
    if not machine.healthy():
44
44
        machines_sick += 1
45
45
        sick_objects.append(repr(machine))
46
46
 
47
 
for source in Source.objects.filter(active=True, published=True):
 
47
for source in Source.objects.filter(machine__active=True, machine__published=True, active=True, published=True):
48
48
    sources_total += 1
49
49
    if not source.healthy():
50
50
        sources_sick += 1