better coding style
This commit is contained in:
parent
d44c30373f
commit
e6f6f65746
|
@ -213,9 +213,12 @@ class SASL(PlugIn):
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
if "EXTERNAL" in self.mecs:
|
if "EXTERNAL" in self.mecs:
|
||||||
self.mecs.remove('EXTERNAL')
|
self.mecs.remove('EXTERNAL')
|
||||||
node = Node('auth', attrs={'xmlns': NS_SASL, 'mechanism': 'EXTERNAL'},
|
sasl_data = u'%s@%s' % (self.username, self._owner.Server)
|
||||||
payload=[base64.encodestring('%s@%s' % (self.username,
|
sasl_data = sasl_data.encode('utf-8').encode('base64').replace(
|
||||||
self._owner.Server)).replace('\n', '')])
|
'\n', '')
|
||||||
|
node = Node('auth', attrs={'xmlns': NS_SASL,
|
||||||
|
'mechanism': 'EXTERNAL'}, payload=[sasl_data])
|
||||||
|
self.mechanism = 'EXTERNAL'
|
||||||
self.startsasl = SASL_IN_PROCESS
|
self.startsasl = SASL_IN_PROCESS
|
||||||
self._owner.send(str(node))
|
self._owner.send(str(node))
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
|
|
Loading…
Reference in New Issue