Skip to content

Commit f533dad

Browse files
author
Fred Ross
committed
Merge pull request #56 from splunk/fross/service_refactor
Insertion of a new base class above Service as we discussed.
2 parents ba21078 + cf0227b commit f533dad

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ build/
1111
proxypid
1212
proxy.log
1313
MANIFEST
14+
coverage_report

splunklib/client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,16 @@ def connect(**kwargs):
285285
"""
286286
return Service(**kwargs).login()
287287

288-
class Service(Context):
288+
# In preparation for adding Storm support, we added an
289+
# intermediary class between Service and Context. Storm's
290+
# API is not going to be the same as enterprise Splunk's
291+
# API, so we will derive both Service (for enterprise Splunk)
292+
# and StormService for (Splunk Storm) from _BaseService, and
293+
# put any shared behavior on it.
294+
class _BaseService(Context):
295+
pass
296+
297+
class Service(_BaseService):
289298
"""A Pythonic binding to Splunk instances.
290299
291300
A :class:`Service` represents a binding to a Splunk instane on an
@@ -334,7 +343,7 @@ class Service(Context):
334343
s = client.Service(token="atg232342aa34324a")
335344
"""
336345
def __init__(self, **kwargs):
337-
Context.__init__(self, **kwargs)
346+
super(Service, self).__init__(self, **kwargs)
338347
self._splunk_version = None
339348

340349
@property

0 commit comments

Comments
 (0)