mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-07-23 05:54:23 +02:00
fix session: 'expected str instance, NoneType found'
When KmipSession instantiated without session name there is error: File ".../PyKMIP/kmip/services/server/session.py", line 57, in __init__ self._logger = logging.getLogger('.'.join((__name__, name))) TypeError: sequence item 1: expected str instance, NoneType found
This commit is contained in:
parent
840aed7107
commit
d996c268df
@ -51,6 +51,9 @@ class KmipSession(threading.Thread):
|
|||||||
kwargs={}
|
kwargs={}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if name is None:
|
||||||
|
name = self.name
|
||||||
|
|
||||||
self._logger = logging.getLogger('.'.join((__name__, name)))
|
self._logger = logging.getLogger('.'.join((__name__, name)))
|
||||||
|
|
||||||
self._engine = engine
|
self._engine = engine
|
||||||
|
@ -38,6 +38,12 @@ class TestKmipSession(testtools.TestCase):
|
|||||||
"""
|
"""
|
||||||
session.KmipSession(None, None, 'name')
|
session.KmipSession(None, None, 'name')
|
||||||
|
|
||||||
|
def test_init_without_name(self):
|
||||||
|
"""
|
||||||
|
Test that a KmipSession without 'name' can be created without errors.
|
||||||
|
"""
|
||||||
|
session.KmipSession(None, None, None)
|
||||||
|
|
||||||
def test_run(self):
|
def test_run(self):
|
||||||
"""
|
"""
|
||||||
Test that the message handling loop is handled properly on normal
|
Test that the message handling loop is handled properly on normal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user