def _mountpoint_to_number(mountpoint):
 if mountpoint.startswith('/dev/'):
  mountpoint = mountpoint[5:]
 if re.match('^[hs]d[a-p]$', mountpoint):
  return (ord(mountpoint[2:3]) - ord('a'))
 elif re.match('^x?vd[a-p]$', mountpoint):
  return (ord(mountpoint[(-1)]) - ord('a'))
 elif re.match('^[0-9]+$', mountpoint):
  return int(mountpoint, 10)
 else:
  LOG.warning(_LW('Mountpoint cannot be translated: %s'), mountpoint)
  return (-1)

def _mountpoint_to_number ( mountpoint ) : if mountpoint . startswith ( '/dev/' ) : mountpoint = mountpoint [ 5 : ] if re . match ( '^[hs]d[a-p]$' , mountpoint ) : return ( ord ( mountpoint [ 2 : 3 ] ) - ord ( 'a' ) ) elif re . match ( '^x?vd[a-p]$' , mountpoint ) : return ( ord ( mountpoint [ ( - 1 ) ] ) - ord ( 'a' ) ) elif re . match ( '^[0-9]+$' , mountpoint ) : return int ( mountpoint , 10 ) else : LOG . warning ( _LW ( 'Mountpoint cannot be translated: %s' ) , mountpoint ) return ( - 1 )
translate a mountpoint like /dev/sdc into a numeric .