From e9ced0b16edce341fde2cf0021fce5edcb418928 Mon Sep 17 00:00:00 2001 From: Wayne Date: Fri, 29 May 2015 09:39:58 +0800 Subject: [PATCH] Omit setAttr() for user and password when parameter is not given. --- pyhs2/connections.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyhs2/connections.py b/pyhs2/connections.py index 2291479..d0c0859 100644 --- a/pyhs2/connections.py +++ b/pyhs2/connections.py @@ -31,8 +31,10 @@ def __init__(self, host=None, port=10000, authMechanism=None, user=None, passwor else: sasl_mech = 'PLAIN' saslc = sasl.Client() - saslc.setAttr("username", user) - saslc.setAttr("password", password) + if user: + saslc.setAttr("username", user) + if password: + saslc.setAttr("password", password) if authMechanism == 'KERBEROS': krb_host,krb_service = self._get_krb_settings(host, configuration) sasl_mech = 'GSSAPI'