Skip to content

Commit c52c0b1

Browse files
author
Shakeel Mohamed
committed
encode slashes when deleting storage passwords
1 parent 70a6a2b commit c52c0b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

splunklib/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ def delete(self, username, realm=None):
18121812
name = username
18131813
else:
18141814
# Encode each component separately
1815-
name = UrlEncoded(realm) + ":" + UrlEncoded(username)
1815+
name = UrlEncoded(realm, encode_slash=True) + ":" + UrlEncoded(username, encode_slash=True)
18161816

18171817
# Append the : expected at the end of the name
18181818
if name[-1] is not ":":

tests/test_storage_passwords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ def test_delete(self):
214214
self.storage_passwords.delete(username, "myrealm")
215215
self.assertEqual(start_count, len(self.storage_passwords))
216216

217-
p = self.storage_passwords.create(password="changeme", username=username + "/foo",
217+
self.storage_passwords.create(password="changeme", username=username + "/foo",
218218
realm="/myrealm")
219219
self.assertEqual(start_count + 1, len(self.storage_passwords))
220-
print p.name
220+
221221
self.storage_passwords.delete(username + "/foo", "/myrealm")
222222
self.assertEqual(start_count, len(self.storage_passwords))
223223

0 commit comments

Comments
 (0)