Skip to content

Commit ed2f001

Browse files
author
Leon Zhang
committed
resolve conficts
2 parents 4503db9 + f878496 commit ed2f001

File tree

16 files changed

+1065
-1058
lines changed

16 files changed

+1065
-1058
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ before_install:
3030
- mkdir -p $SPLUNK_HOME/var/log/splunk
3131

3232
env:
33-
- SPLUNK_VERSION=6.4-sdk
34-
- SPLUNK_VERSION=6.5-sdk
33+
- SPLUNK_VERSION=6.6-sdk
34+
- SPLUNK_VERSION=7.0-sdk
3535

3636
language: python
3737

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Here's what you need to get going with the Splunk SDK for Python.
3636

3737
#### Python
3838

39-
The Splunk SDK for Python requires Python 2.6+.
39+
The Splunk SDK for Python requires Python 2.7+.
4040

4141
#### Splunk
4242

@@ -168,9 +168,7 @@ prompt in the **/splunk-sdk-python/tests** subdirectory and enter:
168168
python test_app.py
169169

170170
The test suite uses Python's standard library and the built-in `unittest`
171-
library. If you're using Python 2.7, you're all set. However, if you are using
172-
Python 2.6, you'll also need to install the `unittest2` library to
173-
get the additional features that were added to Python 2.7.
171+
library.
174172

175173
You can read more about our testing framework on
176174
[GitHub](https://github.com/splunk/splunk-sdk-python/tree/master/tests).
@@ -315,7 +313,3 @@ You can reach the Developer Platform team at _devinfo@splunk.com_.
315313
The Splunk Software Development Kit for Python is licensed under the Apache
316314
License 2.0. Details can be found in the file LICENSE.
317315

318-
For compatibility with Python 2.6, The Splunk Software Development Kit
319-
for Python ships with ordereddict.py from the ordereddict package on
320-
[PyPI](http://pypi.python.org/pypi/ordereddict/1.1), which is licensed
321-
under the MIT license (see the top of splunklib/ordereddict.py).

examples/handlers/cacert.pem

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
-----BEGIN CERTIFICATE-----
2-
MIICdTCCAd4CCQD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WUwLA1koE8I
15-
/0XFEwxWbEbt
8+
QTEhMB8GCSqGSIb3DQEJARYSc3VwcG9ydEBzcGx1bmsuY29tMIIBIjANBgkqhkiG
9+
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzB9ltVEGk73QvPlxXtA0qMW/SLDQlQMFJ/C/
10+
tXRVJdQsmcW4WsaETteeWZh8AgozO1LqOa3I6UmrWLcv4LmUAh/T3iZWXzHLIqFN
11+
WLSVU+2g0Xkn43xSgQEPSvEK1NqZRZv1SWvx3+oGHgu03AZrqTj0HyLujqUDARFX
12+
sRvBPW/VfDkomHj9b8IuK3qOUwQtIOUr+oKx1tM1J7VNN5NflLw9NdHtlfblw0Ys
13+
5xI5Qxu3rcCxkKQuwz9KRe4iijOIRMAKX28pbakxU9Nk38Ac3PNadgIk0s7R829k
14+
980sqGWkd06+C17OxgjpQbvLOR20FtmQybttUsXGR7Bp07YStwIDAQABMA0GCSqG
15+
SIb3DQEBCwUAA4IBAQCxhQd6KXP2VzK2cwAqdK74bGwl5WnvsyqdPWkdANiKksr4
16+
ZybJZNfdfRso3fA2oK1R8i5Ca8LK3V/UuAsXvG6/ikJtWsJ9jf+eYLou8lS6NVJO
17+
xDN/gxPcHrhToGqi1wfPwDQrNVofZcuQNklcdgZ1+XVuotfTCOXHrRoNmZX+HgkY
18+
gEtPG+r1VwSFowfYqyFXQ5CUeRa3JB7/ObF15WfGUYplbd3wQz/M3PLNKLvz5a1z
19+
LMNXDwN5Pvyb2epyO8LPJu4dGTB4jOGpYLUjG1UUqJo9Oa6D99rv6sId+8qjERtl
20+
ZZc1oaC0PKSzBmq+TpbR27B8Zra3gpoA+gavdRZj
1621
-----END CERTIFICATE-----

splunklib/searchcommands/generating_command.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,18 @@ def _execute(self, ifile, process):
193193
:return: `None`.
194194
195195
"""
196+
if self._protocol_version == 2:
197+
result = self._read_chunk(ifile)
198+
199+
if not result:
200+
return
201+
202+
metadata, body = result
203+
action = getattr(metadata, 'action', None)
204+
205+
if action != 'execute':
206+
raise RuntimeError('Expected execute action, not {}'.format(action))
207+
196208
self._record_writer.write_records(self.generate())
197209
self.finish()
198210

@@ -308,7 +320,7 @@ def iteritems(self):
308320
version = self.command.protocol_version
309321
if version == 2:
310322
iteritems = ifilter(lambda name_value1: name_value1[0] != 'distributed', iteritems)
311-
if self.distributed and self.type == 'streaming':
323+
if not self.distributed and self.type == 'streaming':
312324
iteritems = imap(
313325
lambda name_value: (name_value[0], 'stateful') if name_value[0] == 'type' else (name_value[0], name_value[1]), iteritems)
314326
return iteritems

splunklib/searchcommands/search_command.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
# Relative imports
5757

58-
from . internals import (
58+
from .internals import (
5959
CommandLineParser,
6060
CsvDialect,
6161
InputHeader,
@@ -71,6 +71,7 @@
7171
from . import Boolean, Option, environment
7272
from ..client import Service
7373

74+
7475
# ----------------------------------------------------------------------------------------------------------------------
7576

7677
# P1 [ ] TODO: Log these issues against ChunkedExternProcessor
@@ -97,6 +98,7 @@ class SearchCommand(object):
9798
""" Represents a custom search command.
9899
99100
"""
101+
100102
def __init__(self):
101103

102104
# Variables that may be used, but not altered by derived classes
@@ -882,8 +884,10 @@ def _read_chunk(ifile):
882884
# if body_length <= 0:
883885
# return metadata, ''
884886

887+
body = ""
885888
try:
886-
body = ifile.read(body_length)
889+
if body_length > 0:
890+
body = ifile.read(body_length)
887891
except Exception as error:
888892
raise RuntimeError('Failed to read body of length {}: {}'.format(body_length, error))
889893

splunklib/searchcommands/streaming_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def iteritems(self):
180180
iteritems = ifilter(lambda name_value: name_value[0] != 'clear_required_fields', iteritems)
181181
else:
182182
iteritems = ifilter(lambda name_value2: name_value2[0] != 'distributed', iteritems)
183-
if self.distributed:
183+
if not self.distributed:
184184
iteritems = imap(
185185
lambda name_value1: (name_value1[0], 'stateful') if name_value1[0] == 'type' else (name_value1[0], name_value1[1]), iteritems)
186186
return iteritems

tests/searchcommands/recordings/scpv2/Splunk-6.3/countmatches.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
chunked 1.0,19,0
2-
{"type":"stateful"}
1+
chunked 1.0,20,0
2+
{"type":"streaming"}
33
chunked 1.0,17,49651
44
{"finished":true}_serial,__mv__serial,_time,__mv__time,text,__mv_text,word_count,__mv_word_count
55
0,,1380899494,,excellent review my friend loved it yours always guppyman @GGreeny62... http://t.co/fcvq7NDHxl,,14,
Binary file not shown.

0 commit comments

Comments
 (0)