Skip to content

Commit 089841a

Browse files
author
Shakeel Mohamed
committed
Fix Index.submit() paths for namespaced services
1 parent d762195 commit 089841a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

splunklib/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
PATH_SAVED_SEARCHES = "saved/searches/"
101101
PATH_STANZA = "configs/conf-%s/%s" # (file, stanza)
102102
PATH_USERS = "authentication/users/"
103-
PATH_RECEIVERS_STREAM = "receivers/stream"
104-
PATH_RECEIVERS_SIMPLE = "receivers/simple"
103+
PATH_RECEIVERS_STREAM = "/services/receivers/stream"
104+
PATH_RECEIVERS_SIMPLE = "/services/receivers/simple"
105105
PATH_STORAGE_PASSWORDS = "storage/passwords"
106106

107107
XNAMEF_ATOM = "{http://www.w3.org/2005/Atom}%s"

tests/test_index.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ def test_submit(self):
9494
self.index.submit("Hello again!", sourcetype="Boris", host="meep")
9595
self.assertEventuallyTrue(lambda: self.totalEventCount() == event_count+1, timeout=50)
9696

97+
def test_submit_namespaced(self):
98+
s = client.connect(**{
99+
"username": self.service.username,
100+
"password": self.service.password,
101+
"owner": "nobody",
102+
"app": "search"
103+
})
104+
i = s.indexes[self.index_name]
105+
106+
event_count = int(i['totalEventCount'])
107+
self.assertEqual(i['sync'], '0')
108+
self.assertEqual(i['disabled'], '0')
109+
i.submit("Hello again namespaced!", sourcetype="Boris", host="meep")
110+
self.assertEventuallyTrue(lambda: self.totalEventCount() == event_count+1, timeout=50)
111+
97112
def test_submit_via_attach(self):
98113
event_count = int(self.index['totalEventCount'])
99114
cn = self.index.attach()

0 commit comments

Comments
 (0)