def get_dev_prefix_for_disk_bus(disk_bus):
 if CONF.libvirt_disk_prefix:
  return CONF.libvirt_disk_prefix
 if (disk_bus == 'ide'):
  return 'hd'
 elif (disk_bus == 'virtio'):
  return 'vd'
 elif (disk_bus == 'xen'):
  return 'sd'
 elif (disk_bus == 'scsi'):
  return 'sd'
 elif (disk_bus == 'usb'):
  return 'sd'
 elif (disk_bus == 'uml'):
  return 'ubd'
 elif (disk_bus == 'lxc'):
  return None
 else:
  raise exception.NovaException((_('Unable to determine disk prefix for %s') % disk_bus))

def get_dev_prefix_for_disk_bus ( disk_bus ) : if CONF . libvirt_disk_prefix : return CONF . libvirt_disk_prefix if ( disk_bus == 'ide' ) : return 'hd' elif ( disk_bus == 'virtio' ) : return 'vd' elif ( disk_bus == 'xen' ) : return 'sd' elif ( disk_bus == 'scsi' ) : return 'sd' elif ( disk_bus == 'usb' ) : return 'sd' elif ( disk_bus == 'uml' ) : return 'ubd' elif ( disk_bus == 'lxc' ) : return None else : raise exception . NovaException ( ( _ ( 'Unable to determine disk prefix for %s' ) % disk_bus ) )
determine the dev prefix for a disk bus .