Skip to content

Commit

Permalink
Release 1.6.3
Browse files Browse the repository at this point in the history
* release/1.6.3: (41 commits)
  Update changelog
  Update version number
  Using string_types for python3 compatibility.
  Using basestring instead of str so that unicode values are also accepted.
  Remove Python 2.6 from CI
  removed comments
  drop support for python 2.6
  fix test_service authentication tests
  fix test_service authentication tests
  fix test_service tests
  update server cert file
  fix test failures
  update splunk version to 6.6 and 7.0
  update travis.yml
  update travis splunk version to 6.6 and 7.0
  Added carry returns back to sum.map.output
  One more fix
  Fix last two unit tests
  distrubuted commands are streaming
  Strip new line chars to normalize different line separators
  ...
  • Loading branch information
fantavlik committed Mar 12, 2018
2 parents f32374a + 0608952 commit 6899980
Show file tree
Hide file tree
Showing 130 changed files with 3,130 additions and 1,928 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ before_install:
- mkdir -p $SPLUNK_HOME/var/log/splunk

env:
- SPLUNK_VERSION=6.2.6-sdk
- SPLUNK_VERSION=6.3.1-sdk
- SPLUNK_VERSION=6.6-sdk
- SPLUNK_VERSION=7.0-sdk

language: python

python:
- "2.7"
- "2.6"
- "3.5"

install: "pip install unittest2"

Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Splunk SDK for Python Changelog

## Version 1.6.3

### New features and APIs

* Support for Python 3.x has been added for external integrations with the Splunk platform. However, because Splunk Enterprise 7+ still includes Python 2.7.x, any apps or scripts that run on the Splunk platform must continue to be written for Python 2.7.x.

### Bug fixes

The following bugs have been fixed:

* Search commands error - `ERROR ChunkedExternProcessor - Invalid custom search command type: eventing`.

* Search commands running more than once for certain cases.

* Search command protocol v2 inverting the `distributed` configuration flag.

## Version 1.6.2

### Minor changes
Expand Down Expand Up @@ -558,3 +574,4 @@ API reference under the section on accessing Splunk resources at:
## 0.1.0 (preview)

* Initial Python SDK release

12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://travis-ci.org/splunk/splunk-sdk-python.svg?branch=master)](https://travis-ci.org/splunk/splunk-sdk-python)
# The Splunk Software Development Kit for Python

#### Version 1.6.2
#### Version 1.6.3

The Splunk Software Development Kit (SDK) for Python contains library code and
examples designed to enable developers to build applications using Splunk.
Expand Down Expand Up @@ -36,7 +36,7 @@ Here's what you need to get going with the Splunk SDK for Python.

#### Python

The Splunk SDK for Python requires Python 2.6+.
The Splunk SDK for Python requires Python 2.7+.

#### Splunk

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

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

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

For compatibility with Python 2.6, The Splunk Software Development Kit
for Python ships with ordereddict.py from the ordereddict package on
[PyPI](http://pypi.python.org/pypi/ordereddict/1.1), which is licensed
under the MIT license (see the top of splunklib/ordereddict.py).
14 changes: 8 additions & 6 deletions examples/abc/a.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"""Retrieves a list of installed apps from Splunk by making REST API calls
using Python's httplib module."""

import httplib
from __future__ import absolute_import
from __future__ import print_function
import splunklib.six.moves.http_client
import urllib
from xml.etree import ElementTree

Expand All @@ -25,7 +27,7 @@
PASSWORD = "changeme"

# Present credentials to Splunk and retrieve the session key
connection = httplib.HTTPSConnection(HOST, PORT)
connection = six.moves.http_client.HTTPSConnection(HOST, PORT)
body = urllib.urlencode({'username': USERNAME, 'password': PASSWORD})
headers = {
'Content-Type': "application/x-www-form-urlencoded",
Expand All @@ -40,12 +42,12 @@
finally:
connection.close()
if response.status != 200:
raise Exception, "%d (%s)" % (response.status, response.reason)
raise Exception("%d (%s)" % (response.status, response.reason))
body = response.read()
sessionKey = ElementTree.XML(body).findtext("./sessionKey")

# Now make the request to Splunk for list of installed apps
connection = httplib.HTTPSConnection(HOST, PORT)
connection = six.moves.http_client.HTTPSConnection(HOST, PORT)
headers = {
'Content-Length': "0",
'Host': HOST,
Expand All @@ -59,10 +61,10 @@
finally:
connection.close()
if response.status != 200:
raise Exception, "%d (%s)" % (response.status, response.reason)
raise Exception("%d (%s)" % (response.status, response.reason))

body = response.read()
data = ElementTree.XML(body)
apps = data.findall("{http://www.w3.org/2005/Atom}entry/{http://www.w3.org/2005/Atom}title")
for app in apps:
print app.text
print(app.text)
6 changes: 4 additions & 2 deletions examples/abc/b.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

"""Retrieves a list of installed apps from Splunk using the binding module."""

from __future__ import absolute_import
from __future__ import print_function
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))

Expand All @@ -34,11 +36,11 @@

response = context.get('apps/local')
if response.status != 200:
raise Exception, "%d (%s)" % (response.status, response.reason)
raise Exception("%d (%s)" % (response.status, response.reason))

body = response.body.read()
data = ElementTree.XML(body)
apps = data.findall("{http://www.w3.org/2005/Atom}entry/{http://www.w3.org/2005/Atom}title")
for app in apps:
print app.text
print(app.text)

4 changes: 3 additions & 1 deletion examples/abc/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# under the License.

"""Retrieves a list of installed apps from Splunk using the client module."""
from __future__ import absolute_import
from __future__ import print_function
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))

Expand All @@ -30,4 +32,4 @@
password=PASSWORD)

for app in service.apps:
print app.name
print(app.name)
5 changes: 3 additions & 2 deletions examples/analytics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.

import input
import output
from __future__ import absolute_import
from . import input
from . import output
Loading

0 comments on commit 6899980

Please sign in to comment.