jeronimo
2013-02-05 17:54:45 UTC
jeronimo [http://community.zenoss.org/people/jeronimo] created the discussion
"TALES expressions and conditions"
To view the discussion, visit: http://community.zenoss.org/message/71386#71386
--------------------------------------------------------------
I've been experimenting with learning TALES in my notifications and am confused as to why some stuff isn't working. There doesn't seem to be any good in-dept documentation of TALES in the context of zenoss beyond just the "here are the attributes you can use".
Here are a couple of my examples. They're mainly academic at this point. These examples are put in the notification for an event trigger:
<b tal:condition="python: int(evt.eventState) == 0">State is hopefully 0 = ${evt/eventState}</b><br>
<b tal:condition="python: int(evt.eventState) == 3">State is hopefully 3 = ${evt/eventState}</b>
It doesn't seem to do anything I expect. It always outputs both lines, no matter of the eventState. For example:
State is hopefully 0 = 0
State is hopefully 3 = 0
Another example I tried:
<b tal:condition="evt/eventState == '0'">State is hopefully 0 = ${evt/eventState}</b><br>
<b tal:condition="evt/eventState == '3'">State is hopefully 3 = ${evt/eventState}</b>
Same result as above, but I never could find any confirmation that you could use a comparison operator like that directly on the TALES attribute without using python:, so I'm not as surprised by this one.
So the question is basically how to do what I'm trying to do here with comparisons.
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/71386#71386]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"TALES expressions and conditions"
To view the discussion, visit: http://community.zenoss.org/message/71386#71386
--------------------------------------------------------------
I've been experimenting with learning TALES in my notifications and am confused as to why some stuff isn't working. There doesn't seem to be any good in-dept documentation of TALES in the context of zenoss beyond just the "here are the attributes you can use".
Here are a couple of my examples. They're mainly academic at this point. These examples are put in the notification for an event trigger:
<b tal:condition="python: int(evt.eventState) == 0">State is hopefully 0 = ${evt/eventState}</b><br>
<b tal:condition="python: int(evt.eventState) == 3">State is hopefully 3 = ${evt/eventState}</b>
It doesn't seem to do anything I expect. It always outputs both lines, no matter of the eventState. For example:
State is hopefully 0 = 0
State is hopefully 3 = 0
Another example I tried:
<b tal:condition="evt/eventState == '0'">State is hopefully 0 = ${evt/eventState}</b><br>
<b tal:condition="evt/eventState == '3'">State is hopefully 3 = ${evt/eventState}</b>
Same result as above, but I never could find any confirmation that you could use a comparison operator like that directly on the TALES attribute without using python:, so I'm not as surprised by this one.
So the question is basically how to do what I'm trying to do here with comparisons.
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/71386#71386]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]