def mountpoint_to_number(mountpoint):
 if mountpoint.startswith('/dev/'):
  mountpoint = mountpoint[5:]
 if re.match('^[hsv]d[a-p]$', mountpoint):
  return (ord(mountpoint[2:3]) - ord('a'))
 elif re.match('^[0-9]+$', mountpoint):
  return string.atoi(mountpoint, 10)
 else:
  LOG.warn((_('Mountpoint cannot be translated: %s') % mountpoint))
  return (-1)

def mountpoint_to_number ( mountpoint ) : if mountpoint . startswith ( '/dev/' ) : mountpoint = mountpoint [ 5 : ] if re . match ( '^[hsv]d[a-p]$' , mountpoint ) : return ( ord ( mountpoint [ 2 : 3 ] ) - ord ( 'a' ) ) elif re . match ( '^[0-9]+$' , mountpoint ) : return string . atoi ( mountpoint , 10 ) else : LOG . warn ( ( _ ( 'Mountpoint cannot be translated: %s' ) % mountpoint ) ) return ( - 1 )
translate a mountpoint like /dev/sdc into a numeric .