def get_device_name(bdm):
 if isinstance(bdm, obj_base.NovaObject):
  return bdm.device_name
 else:
  return (bdm.get('device_name') or bdm.get('mount_device'))

def get_device_name ( bdm ) : if isinstance ( bdm , obj_base . NovaObject ) : return bdm . device_name else : return ( bdm . get ( 'device_name' ) or bdm . get ( 'mount_device' ) )
get the device name if present regardless of the bdm format .