Skip to content

Commit b2d7bde

Browse files
committed
Update client.py
1 parent 07f04fc commit b2d7bde

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

splunklib/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ def get(self, path_segment="", owner=None, app=None, sharing=None, **query):
782782
if path_segment.startswith('/'):
783783
path = path_segment
784784
else:
785-
if not self.path.endswith('/'):
786-
self.path = self.path if self.path != "" and path_segment.startswith('/') else self.path + '/'
785+
if not self.path.endswith('/') and path_segment != "":
786+
self.path = self.path if path_segment.startswith('/') else self.path + '/'
787787
path = self.service._abspath(self.path + path_segment, owner=owner,
788788
app=app, sharing=sharing)
789789
# ^-- This was "%s%s" % (self.path, path_segment).
@@ -844,9 +844,10 @@ def post(self, path_segment="", owner=None, app=None, sharing=None, **query):
844844
if path_segment.startswith('/'):
845845
path = path_segment
846846
else:
847-
if not self.path.endswith('/'):
848-
self.path = self.path if self.path != "" and path_segment.startswith('/') else self.path + '/'
847+
if not self.path.endswith('/') and path_segment != "":
848+
self.path = self.path if path_segment.startswith('/') else self.path + '/'
849849
path = self.service._abspath(self.path + path_segment, owner=owner, app=app, sharing=sharing)
850+
print(path)
850851
return self.service.post(path, owner=owner, app=app, sharing=sharing, **query)
851852

852853

0 commit comments

Comments
 (0)