Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #170 from spotify/kerberos_optional
Browse files Browse the repository at this point in the history
Make kerberos optional
  • Loading branch information
Wouter de Bie committed Sep 24, 2015
2 parents 30d84ce + 6c61271 commit 41fd330
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ To install snakebite 2.x run:

pip install snakebite



To install snakebite 2.x with Kerberos/SASL support, make sure you can install python-krbV (https://fedorahosted.org/python-krbV/) and then run:

pip install "snakebite[kerberos]"



Documentation
*************
More information and documentation can be found at http://spotify.github.io/snakebite/
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
snakebite (2.7.0) unstable; urgency=low

* Make kerberos/sasl optional in python packaging

-- Wouter de Bie <wouter@spotify.com> Tue, 24 Sep 2015 13:12:25 -0000

snakebite (2.6.1) unstable; urgency=low

* Wraps use of the Python 'pwd' module in a utility procedure for Windows compatibility
Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
argparse
protobuf>2.4.1
sasl
python-krbV
protobuf>2.4.1
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ def run_tests(self):

install_requires = [
'protobuf>2.4.1',
'argparse',
'sasl',
'python-krbV']
'argparse']

extras_require = {
'kerberos': [
'python-krbV',
'sasl']
}

tests_require = [
'tox',
Expand Down Expand Up @@ -74,6 +78,7 @@ def run_tests(self):
('', ['LICENSE'])
],
install_requires=install_requires,
extras_require=extras_require,
tests_require=tests_require,
cmdclass={'test': Tox}
)
11 changes: 7 additions & 4 deletions snakebite/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@
import google.protobuf.internal.encoder as encoder
import google.protobuf.internal.decoder as decoder

# SASL
from snakebite.rpc_sasl import SaslRpcClient
from snakebite.kerberos import Kerberos

# Module imports

import logger
Expand Down Expand Up @@ -178,6 +174,13 @@ def __init__(self, host, port, version, effective_user=None, use_sasl=False):
self.client_id = str(uuid.uuid4())
self.use_sasl = use_sasl
if self.use_sasl:
try:
# Only import if SASL is enabled
from snakebite.rpc_sasl import SaslRpcClient
from snakebite.kerberos import Kerberos
except ImportError:
raise Exception("Kerberos libs not found. Please install snakebite using 'pip install snakebite[kerberos]'")

kerberos = Kerberos()
self.effective_user = effective_user or kerberos.user_principal().name
else:
Expand Down
2 changes: 1 addition & 1 deletion snakebite/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "2.6.1"
VERSION = "2.7.0"


def version():
Expand Down

0 comments on commit 41fd330

Please sign in to comment.