Revision f43329c2
Correction du code de Statename et renommage de la classe en StateName.
Répercution des modifications dans Vigiboard, Vigimap et le reste du modèle.
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@1129 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/controllers/root.py | ||
---|---|---|
14 | 14 |
from vigiboard.model import DBSession |
15 | 15 |
from vigiboard.model import Event, EventHistory, EventsAggregate, \ |
16 | 16 |
Host, HostGroup, \ |
17 |
State, Statename, User
|
|
17 |
State, StateName, User
|
|
18 | 18 |
from repoze.what.predicates import Any, not_anonymous |
19 | 19 |
from vigiboard.widgets.edit_event import edit_event_status_options |
20 | 20 |
from vigiboard.controllers.vigiboardrequest import VigiboardRequest |
... | ... | |
182 | 182 |
} |
183 | 183 |
|
184 | 184 |
return dict( |
185 |
current_state = Statename.value_to_statename(
|
|
185 |
current_state = StateName.value_to_statename(
|
|
186 | 186 |
event[1].current_state), |
187 |
initial_state = Statename.value_to_statename(
|
|
187 |
initial_state = StateName.value_to_statename(
|
|
188 | 188 |
event[1].initial_state), |
189 |
peak_state = Statename.value_to_statename(
|
|
189 |
peak_state = StateName.value_to_statename(
|
|
190 | 190 |
event[1].peak_state), |
191 | 191 |
idaggregate = idaggregate, |
192 | 192 |
host = event[1].hostname, |
vigiboard/controllers/vigiboardrequest.py | ||
---|---|---|
4 | 4 |
|
5 | 5 |
from vigiboard.model import Event, EventsAggregate, EventHistory, State, \ |
6 | 6 |
Host, HostGroup, ServiceLowLevel, ServiceGroup, \ |
7 |
Statename
|
|
7 |
StateName
|
|
8 | 8 |
from tg import tmpl_context, url, config |
9 | 9 |
from vigiboard.model import DBSession |
10 | 10 |
from sqlalchemy import not_, and_, asc, desc, sql |
... | ... | |
48 | 48 |
(ServiceLowLevel, Event.servicename == ServiceLowLevel.name), |
49 | 49 |
(HostGroup, Host.name == HostGroup.hostname), |
50 | 50 |
(ServiceGroup, ServiceLowLevel.name == ServiceGroup.servicename), |
51 |
(Statename, Statename.idstatename == Event.current_state),
|
|
51 |
(StateName, StateName.idstatename == Event.current_state),
|
|
52 | 52 |
] |
53 | 53 |
|
54 | 54 |
self.outerjoin = [] |
... | ... | |
60 | 60 |
# On masque les événements avec l'état OK |
61 | 61 |
# et traités (status == u'AAClosed'). |
62 | 62 |
not_(and_( |
63 |
Statename.statename == u'OK',
|
|
63 |
StateName.statename == u'OK',
|
|
64 | 64 |
EventsAggregate.status == u'AAClosed' |
65 | 65 |
)), |
66 | 66 |
EventsAggregate.timestamp_active != None, |
... | ... | |
75 | 75 |
self.orderby = [ |
76 | 76 |
desc(EventsAggregate.status), # None, Acknowledged, AAClosed |
77 | 77 |
priority_order, # Priorité ITIL (entier). |
78 |
desc(Statename.order), # Etat courant (entier).
|
|
78 |
desc(StateName.order), # Etat courant (entier).
|
|
79 | 79 |
desc(Event.timestamp), |
80 | 80 |
asc(Event.hostname), |
81 | 81 |
] |
... | ... | |
84 | 84 |
EventsAggregate.idaggregate, |
85 | 85 |
EventsAggregate, |
86 | 86 |
Event.hostname, |
87 |
Statename.order,
|
|
87 |
StateName.order,
|
|
88 | 88 |
Event.timestamp, |
89 | 89 |
] |
90 | 90 |
|
... | ... | |
350 | 350 |
events.append([ |
351 | 351 |
event, |
352 | 352 |
{'class': class_tr[i % 2]}, |
353 |
{'class': Statename.value_to_statename(
|
|
353 |
{'class': StateName.value_to_statename(
|
|
354 | 354 |
cause.initial_state) + |
355 | 355 |
self.class_ack[event.status]}, |
356 |
{'class': Statename.value_to_statename(
|
|
356 |
{'class': StateName.value_to_statename(
|
|
357 | 357 |
cause.current_state) + |
358 | 358 |
self.class_ack[event.status]}, |
359 | 359 |
{'src': '/images/%s2.png' % |
360 |
Statename.value_to_statename(
|
|
360 |
StateName.value_to_statename(
|
|
361 | 361 |
cause.current_state)}, |
362 | 362 |
self.format_events_img_status(event), |
363 | 363 |
[[j.__show__(event), j.style] for j in self.plugin] |
vigiboard/model/__init__.py | ||
---|---|---|
10 | 10 |
from vigilo.models import User, UserGroup, Permission |
11 | 11 |
from vigilo.models import Event, EventHistory, EventsAggregate |
12 | 12 |
from vigilo.models import Graph, GraphGroup, GraphToGroups |
13 |
from vigilo.models import Version, State, Statename, Group
|
|
13 |
from vigilo.models import Version, State, StateName, Group
|
|
14 | 14 |
from vigilo.models import Host, HostGroup |
15 | 15 |
from vigilo.models import ServiceLowLevel, ServiceHighLevel, ServiceGroup |
16 | 16 |
from vigilo.models import Access |
Also available in: Unified diff