mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #12944 from rajkan01/usb_msd_greentea_py3
Fix the USB MSD greentea host side pyusb_msd.py scriptpull/12917/head
commit
44b98761e0
|
|
@ -186,10 +186,9 @@ class MSDUtils(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _disk_path_windows(serial):
|
def _disk_path_windows(serial):
|
||||||
serial_decoded = serial.encode("ascii")
|
|
||||||
c = wmi.WMI()
|
c = wmi.WMI()
|
||||||
for physical_disk in c.Win32_DiskDrive():
|
for physical_disk in c.Win32_DiskDrive():
|
||||||
if serial_decoded == physical_disk.SerialNumber:
|
if serial == physical_disk.SerialNumber:
|
||||||
for partition in physical_disk.associators("Win32_DiskDriveToDiskPartition"):
|
for partition in physical_disk.associators("Win32_DiskDriveToDiskPartition"):
|
||||||
for logical_disk in partition.associators("Win32_LogicalDiskToPartition"):
|
for logical_disk in partition.associators("Win32_LogicalDiskToPartition"):
|
||||||
return logical_disk.Caption
|
return logical_disk.Caption
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue