File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,18 @@ def list_mbeds(self):
3535
3636 # {volume_id: {serial:, vendor_id:, product_id:, tty:}}
3737 volumes = self .get_mbed_volumes ()
38- #print 'volumes:', volumes
3938
4039 # {volume_id: mount_point}
4140 mounts = self .get_mount_points ()
42- #print "mounts:", mounts
41+
42+ volumes_keys = set (volumes .keys ())
43+ mounts_keys = set (mounts .keys ())
44+ intersection = volumes_keys & mounts_keys
45+
46+ valid_volumes = {}
47+
48+ for key in intersection :
49+ valid_volumes [key ] = volumes [key ]
4350
4451 # put together all of that info into the expected format:
4552 result = [
@@ -48,7 +55,7 @@ def list_mbeds(self):
4855 'serial_port' : volumes [v ]['tty' ],
4956 'target_id' : self .target_id (volumes [v ]),
5057 'platform_name' : self .platform_name (self .target_id (volumes [v ]))
51- } for v in volumes
58+ } for v in valid_volumes
5259 ]
5360
5461 self .ERRORLEVEL_FLAG = 0
You can’t perform that action at this time.
0 commit comments