Skip to content

Commit bccd01a

Browse files
committed
Reformatted the code logic to set Path based on Splunk Version
1 parent cd54110 commit bccd01a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

splunklib/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,10 +2721,11 @@ class Job(Entity):
27212721
def __init__(self, service, sid, **kwargs):
27222722
# Default to v2 in Splunk Version 9+
27232723
path = "{path}{sid}"
2724-
path = path.format(path=PATH_JOBS_V2, sid=sid)
2725-
# Fallback to v1 if Splunk Version < 9
2724+
# Formatting path based on the Splunk Version
27262725
if service.splunk_version < (9,):
27272726
path = path.format(path=PATH_JOBS, sid=sid)
2727+
else:
2728+
path = path.format(path=PATH_JOBS_V2, sid=sid)
27282729

27292730
Entity.__init__(self, service, path, skip_refresh=True, **kwargs)
27302731
self.sid = sid

0 commit comments

Comments
 (0)