Skip to content

Commit 9fb692d

Browse files
author
Frederick Ross
committed
Submit.stanza encodes its argument locally instead of passing kwargs on.
This avoids name collisions with names like 'app'.
1 parent 8b6caac commit 9fb692d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

splunklib/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
import socket
6868
import contextlib
6969

70-
from binding import Context, HTTPError, AuthenticationError, namespace, UrlEncoded
70+
from binding import Context, HTTPError, AuthenticationError, namespace, UrlEncoded, _encode
7171
from data import record
7272
import data
7373

@@ -1678,13 +1678,14 @@ def _entity_path(self, state):
16781678
class Stanza(Entity):
16791679
"""This class contains a single configuration stanza."""
16801680
def submit(self, stanza):
1681-
"""Populates a stanza in a given configuration file. #FRED? Thought KV pairs would be what you provide, not a single name.
1681+
"""Sets the keys in *stanza* this Stanza.
16821682
16831683
:param stanza: A dictionary of key/value pairs to set in this stanza.
16841684
:type stanza: ``dict``
16851685
:return: The :class:`Stanza` object this method is called on.
16861686
"""
1687-
self.service.post(self.path, **stanza)
1687+
body = _encode(**stanza)
1688+
self.service.post(self.path, body=body)
16881689
return self
16891690

16901691
def __len__(self):

0 commit comments

Comments
 (0)