Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions splunklib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2432,15 +2432,12 @@ def kindpath(self, kind):
:return: The relative endpoint path.
:rtype: ``string``
"""
if kind in self.kinds:
return UrlEncoded(kind, skip_encode=True)
# Special cases
elif kind == 'tcp':
if kind == 'tcp':
return UrlEncoded('tcp/raw', skip_encode=True)
elif kind == 'splunktcp':
return UrlEncoded('tcp/cooked', skip_encode=True)
else:
raise ValueError("No such kind on server: %s" % kind)
return UrlEncoded(kind, skip_encode=True)

def list(self, *kinds, **kwargs):
"""Returns a list of inputs that are in the :class:`Inputs` collection.
Expand Down
8 changes: 8 additions & 0 deletions tests/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ def test_read_kind(self):
def test_inputs_list_on_one_kind(self):
self.service.inputs.list('monitor')

def test_read_invalid_input(self):
name = testlib.tmpname()
try:
self.service.inputs.get(name)
self.fail("Expected a 404 HTTPError")
except HTTPError as he:
self.assertTrue("HTTP 404 Not Found" in str(he))

def test_inputs_list_on_one_kind_with_count(self):
N = 10
expected = [x.name for x in self.service.inputs.list('monitor')[:10]]
Expand Down