Skip to content

Commit e8c5841

Browse files
author
Philippe Tang
committed
[DVPL-10898] Remove unnecessary else
1 parent d6d0f81 commit e8c5841

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

splunklib/client.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,8 +2720,7 @@ def events(self, **kwargs):
27202720
# Splunk version doesn't support v2 (pre-9.0) or the 'search' arg is included (which is v1 specific)
27212721
if self.splunk_version < (9,) or 'search' in kwargs:
27222722
return self.get(path.format(PATH_JOBS, self.sid), **kwargs).body
2723-
else:
2724-
return self.get(path.format(PATH_JOBS_V2, self.sid), **kwargs).body
2723+
return self.get(path.format(PATH_JOBS_V2, self.sid), **kwargs).body
27252724

27262725
def finalize(self):
27272726
"""Stops the job and provides intermediate results for retrieval.
@@ -2814,8 +2813,7 @@ def results(self, **query_params):
28142813
# Splunk version doesn't support v2 (pre-9.0) or the 'search' arg is included (which is v1 specific)
28152814
if self.splunk_version < (9,) or 'search' in query_params:
28162815
return self.get(path.format(PATH_JOBS, self.sid), **query_params).body
2817-
else:
2818-
return self.get(path.format(PATH_JOBS_V2, self.sid), **query_params).body
2816+
return self.get(path.format(PATH_JOBS_V2, self.sid), **query_params).body
28192817

28202818
def preview(self, **query_params):
28212819
"""Returns a streaming handle to this job's preview search results.
@@ -2861,8 +2859,7 @@ def preview(self, **query_params):
28612859
# Splunk version doesn't support v2 (pre-9.0) or the 'search' arg is included (which is v1 specific)
28622860
if self.splunk_version < (9,) or 'search' in query_params:
28632861
return self.get(path.format(PATH_JOBS, self.sid), **query_params).body
2864-
else:
2865-
return self.get(path.format(PATH_JOBS_V2, self.sid), **query_params).body
2862+
return self.get(path.format(PATH_JOBS_V2, self.sid), **query_params).body
28662863

28672864
def searchlog(self, **kwargs):
28682865
"""Returns a streaming handle to this job's search log.

0 commit comments

Comments
 (0)