splunk-sdk-python icon indicating copy to clipboard operation
splunk-sdk-python copied to clipboard

Confs cannot handle the cases when each stanza is not unique

Open ansman opened this issue 15 years ago • 2 comments

I tried doing this:

service.confs['web']['settings']['httpport']

But I get a

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ngiertz/helmut/helmut/contrib/splunk-sdk-python-2011-09-15.zip/splunk-sdk-python/splunk/client.py", line 288, in __getitem__
  File "/Users/ngiertz/helmut/helmut/contrib/splunk-sdk-python-2011-09-15.zip/splunk-sdk-python/splunk/client.py", line 298, in read
  File "/Users/ngiertz/helmut/helmut/contrib/splunk-sdk-python-2011-09-15.zip/splunk-sdk-python/splunk/client.py", line 267, in _filter_content
AttributeError: 'list' object has no attribute 'has_key'

The same goes for just calling read on the stanza

ansman avatar Nov 04 '11 17:11 ansman

The reason for this is that the -/- does not merge stanzas from different namespaces.

This is apparently expected behavior when using the -/- namespace.

The suggestion is to use the nobody/system namespace instead.

ansman avatar Nov 08 '11 19:11 ansman

I think this got fixed in our develop branch by another change.

madhadron avatar Aug 14 '12 17:08 madhadron