2
0
mirror of https://opendev.org/x/pyghmi synced 2025-07-25 05:31:11 +00:00

Fix UUID padding problem

Correct the format width since it is the width of the characters vs
bytes.

Change-Id: Ie01036584ebeba674475e07d2786ea02f6db2f98
This commit is contained in:
wangbo28
2016-02-05 15:37:38 +08:00
committed by Jarrod Johnson
parent 09367b3f0a
commit 14b3bb5d0c

View File

@@ -28,7 +28,7 @@ def decode_wireformat_uuid(rawguid):
rawguid = bytearray(rawguid)
lebytes = struct.unpack_from('<IHH', buffer(rawguid[:8]))
bebytes = struct.unpack_from('>HHI', buffer(rawguid[8:]))
return '{0:04X}-{1:02X}-{2:02X}-{3:02X}-{4:02X}{5:04X}'.format(
return '{0:08X}-{1:04X}-{2:04X}-{3:04X}-{4:04X}{5:08X}'.format(
lebytes[0], lebytes[1], lebytes[2], bebytes[0], bebytes[1], bebytes[2])