Skip to content

Commit 130c5c9

Browse files
llisplunkShakeel Mohamed
authored andcommitted
remove Inputs.kind check to reduce performance impact on each rest call
1 parent bfa6a52 commit 130c5c9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

splunklib/client.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,15 +2432,12 @@ def kindpath(self, kind):
24322432
:return: The relative endpoint path.
24332433
:rtype: ``string``
24342434
"""
2435-
if kind in self.kinds:
2436-
return UrlEncoded(kind, skip_encode=True)
2437-
# Special cases
2438-
elif kind == 'tcp':
2435+
if kind == 'tcp':
24392436
return UrlEncoded('tcp/raw', skip_encode=True)
24402437
elif kind == 'splunktcp':
24412438
return UrlEncoded('tcp/cooked', skip_encode=True)
24422439
else:
2443-
raise ValueError("No such kind on server: %s" % kind)
2440+
return UrlEncoded(kind, skip_encode=True)
24442441

24452442
def list(self, *kinds, **kwargs):
24462443
"""Returns a list of inputs that are in the :class:`Inputs` collection.

0 commit comments

Comments
 (0)