Revision 71f6f653
Corrections dans VigiBoard pour supporter le nouveau modèle.
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@1353 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/controllers/vigiboardrequest.py | ||
---|---|---|
47 | 47 |
|
48 | 48 |
self.join = [ |
49 | 49 |
(Event, CorrEvent.idcause == Event.idevent), |
50 |
(ServiceLowLevel, Event._idservice == ServiceLowLevel.idservice),
|
|
51 |
(Host, Host.name == ServiceLowLevel.hostname),
|
|
50 |
(ServiceLowLevel, Event.idsupitem == ServiceLowLevel.idservice),
|
|
51 |
(Host, Host.idhost == ServiceLowLevel.idhost),
|
|
52 | 52 |
(StateName, StateName.idstatename == Event.current_state), |
53 |
(HOST_GROUP_TABLE, HOST_GROUP_TABLE.c.hostname == Host.name),
|
|
53 |
(HOST_GROUP_TABLE, HOST_GROUP_TABLE.c.idhost == Host.idhost),
|
|
54 | 54 |
(SERVICE_GROUP_TABLE, SERVICE_GROUP_TABLE.c.idservice == \ |
55 | 55 |
ServiceLowLevel.idservice), |
56 | 56 |
] |
... | ... | |
82 | 82 |
priority_order, # Priorité ITIL (entier). |
83 | 83 |
desc(StateName.order), # Etat courant (entier). |
84 | 84 |
desc(Event.timestamp), |
85 |
asc(ServiceLowLevel.hostname),
|
|
85 |
asc(Host.name),
|
|
86 | 86 |
] |
87 | 87 |
|
88 | 88 |
self.groupby = [ |
89 | 89 |
CorrEvent.idcorrevent, |
90 | 90 |
CorrEvent, |
91 |
ServiceLowLevel.hostname,
|
|
91 |
Host.name,
|
|
92 | 92 |
StateName.order, |
93 | 93 |
Event.timestamp, |
94 | 94 |
] |
vigiboard/model/__init__.py | ||
---|---|---|
9 | 9 |
|
10 | 10 |
from vigilo.models import User, UserGroup, Permission |
11 | 11 |
from vigilo.models import Event, EventHistory, CorrEvent |
12 |
from vigilo.models import Version, HostState, ServiceState, StateName
|
|
12 |
from vigilo.models import Version, StateName |
|
13 | 13 |
from vigilo.models import Host, HostGroup |
14 | 14 |
from vigilo.models import ServiceLowLevel, ServiceHighLevel, ServiceGroup |
15 | 15 |
from vigilo.models import Access |
vigiboard/tests/functional/test_vigiboardrequest.py | ||
---|---|---|
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
service1 = ServiceLowLevel( |
77 |
hostname=managerhost.name,
|
|
77 |
host=managerhost,
|
|
78 | 78 |
servicename=u'managerservice', |
79 | 79 |
**service_template |
80 | 80 |
) |
81 | 81 |
|
82 | 82 |
service2 = ServiceLowLevel( |
83 |
hostname=editorhost.name,
|
|
83 |
host=editorhost,
|
|
84 | 84 |
servicename=u'managerservice', |
85 | 85 |
**service_template |
86 | 86 |
) |
87 | 87 |
|
88 | 88 |
service3 = ServiceLowLevel( |
89 |
hostname=managerhost.name,
|
|
89 |
host=managerhost,
|
|
90 | 90 |
servicename=u'editorservice', |
91 | 91 |
**service_template |
92 | 92 |
) |
93 | 93 |
|
94 | 94 |
service4 = ServiceLowLevel( |
95 |
hostname=editorhost.name,
|
|
95 |
host=editorhost,
|
|
96 | 96 |
servicename=u'editorservice', |
97 | 97 |
**service_template |
98 | 98 |
) |
... | ... | |
118 | 118 |
'current_state': StateName.statename_to_value(u'WARNING'), |
119 | 119 |
} |
120 | 120 |
|
121 |
event1 = Event(service=service1, **event_template)
|
|
122 |
event2 = Event(service=service2, **event_template)
|
|
123 |
event3 = Event(service=service3, **event_template)
|
|
124 |
event4 = Event(service=service4, **event_template)
|
|
121 |
event1 = Event(supitem=service1, **event_template)
|
|
122 |
event2 = Event(supitem=service2, **event_template)
|
|
123 |
event3 = Event(supitem=service3, **event_template)
|
|
124 |
event4 = Event(supitem=service4, **event_template)
|
|
125 | 125 |
|
126 | 126 |
DBSession.add(event1) |
127 | 127 |
DBSession.add(event2) |
Also available in: Unified diff