#NEWLINE# def _disk_dev( self , ks_disk ) : #NEWLINE# #INDENT# matched = [ hu_disk [ 'device' ] for hu_disk in self . hu_disks if match_device ( hu_disk , ks_disk ) ] #NEWLINE# fallback = [ hu_disk [ 'device' ] for hu_disk in self . hu_disks if ( ( '/dev/%s' % ks_disk [ 'name' ] ) == hu_disk [ 'device' ] ) ] #NEWLINE# if ( ( len ( matched ) > 1 ) and ( len ( fallback ) == 1 ) ) : #NEWLINE# #INDENT# found = fallback #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# found = ( matched or fallback ) #NEWLINE# #UNINDENT# if ( ( not found ) or ( len ( found ) > 1 ) ) : #NEWLINE# #INDENT# raise errors . DiskNotFoundError ( ( 'Disk not found: %s' % ks_disk [ 'name' ] ) ) #NEWLINE# #UNINDENT# return found [ 0 ]