mirror of https://github.com/ARMmbed/mbed-os.git
Added in safety check if details_txt is None
parent
aafe61414e
commit
7b4959125f
|
@ -103,10 +103,10 @@ def main():
|
||||||
def get_interface_version(mount_point):
|
def get_interface_version(mount_point):
|
||||||
""" Function returns interface version from the target mounted on the specified mount point
|
""" Function returns interface version from the target mounted on the specified mount point
|
||||||
|
|
||||||
mount_point can be acquired via the following:
|
mount_point can be acquired via the following:
|
||||||
muts = get_autodetected_MUTS_list()
|
muts = get_autodetected_MUTS_list()
|
||||||
for mut in muts.values():
|
for mut in muts.values():
|
||||||
mount_point = mut['disk']
|
mount_point = mut['disk']
|
||||||
|
|
||||||
@param mount_point Name of disk where platform is connected to host machine.
|
@param mount_point Name of disk where platform is connected to host machine.
|
||||||
"""
|
"""
|
||||||
|
@ -114,6 +114,10 @@ def get_interface_version(mount_point):
|
||||||
mbeds = mbed_lstools.create()
|
mbeds = mbed_lstools.create()
|
||||||
details_txt = mbeds.get_details_txt(mount_point)
|
details_txt = mbeds.get_details_txt(mount_point)
|
||||||
|
|
||||||
|
if (details_txt is None):
|
||||||
|
details_txt = {}
|
||||||
|
|
||||||
|
|
||||||
if 'Interface Version' in details_txt:
|
if 'Interface Version' in details_txt:
|
||||||
return details_txt['Interface Version']
|
return details_txt['Interface Version']
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue