Strip extra characters from uuid
The VM uuid is sent with some extra characters like dash and spaces. Strip those characters so log file names will have well defined format. Change-Id: Ia41b6276851b363cd3b0aaa87d220c4e4425f8e9
This commit is contained in:
parent
3d19555e7a
commit
7ce7ead127
@ -110,6 +110,7 @@ class VspcServer(object):
|
|||||||
uuid = data.decode('ascii')
|
uuid = data.decode('ascii')
|
||||||
LOG.debug("<< %s VM-VC-UUID %s", peer, uuid)
|
LOG.debug("<< %s VM-VC-UUID %s", peer, uuid)
|
||||||
uuid = uuid.replace(' ', '')
|
uuid = uuid.replace(' ', '')
|
||||||
|
uuid = uuid.replace('-', '')
|
||||||
self.sock_to_uuid[socket] = uuid
|
self.sock_to_uuid[socket] = uuid
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
@ -23,7 +23,7 @@ class VspcServerTest(testtools.TestCase):
|
|||||||
def test_handle_vm_vc_uuid(self):
|
def test_handle_vm_vc_uuid(self):
|
||||||
mock_socket = mock.Mock()
|
mock_socket = mock.Mock()
|
||||||
srv = server.VspcServer()
|
srv = server.VspcServer()
|
||||||
data = b'11 22 33 44 55'
|
data = b'68 4c 91 6c 5f 6c 4c 2f-aa 50 df d6 61 a2 2e 0d'
|
||||||
srv.handle_vm_vc_uuid(mock_socket, data)
|
srv.handle_vm_vc_uuid(mock_socket, data)
|
||||||
actual_uuid = srv.sock_to_uuid[mock_socket]
|
actual_uuid = srv.sock_to_uuid[mock_socket]
|
||||||
self.assertEqual('1122334455', actual_uuid)
|
self.assertEqual('684c916c5f6c4c2faa50dfd661a22e0d', actual_uuid)
|
||||||
|
Loading…
Reference in New Issue
Block a user