When using a list in the source, from my tests it looks like no matter what I have in the 2nd index (and on) that the source will evaluate true. For example,
state = ["ActiveUnacked", "ActiveAcked"]
source = '*MyFolder*', '*Does not matter what goes here*'
alarms = system.alarm.queryStatus(source=source, path=path, state=state)
print alarms
Can anyone explain how multiple items in a list for the source is supposed to evaluate? If I use source and path separately it works, but if I ever want to use 3 items in a list I don't think that would be an option.
The way it's defined currently, I believe source is actually a tuple not a list. Could you try wrapping the value of source in square brackets? So it would then be source = ['*MyFolder*', '*Does not matter what goes here*']
The results should be a list of alarm events that match any of the source paths. What are the results you're expecting? Are you looking for the resulting alarm events to match both source paths?
Do you mean you get the same list independently of the order, or that the second source, no matter which one it is, always returns something that looks wrong ?
What's the output of
state = ["ActiveUnacked", "ActiveAcked"]
source = '*source1*', '*source2*'
alarms1 = set(al.source for al in system.alarm.queryStatus(source=source, state=state))
source = '*source2*', '*source1*'
alarms2 = set(al.source for al in system.alarm.queryStatus(source=source, state=state))
print alarms1 ^ alarms2
It should be an empty set.
PS: Don't use source AND path. They do the same thing, so just pick one. Maybe using both at the same time somehow messes things up ?