def get_disk_type_from_path(path):
 if path.startswith('/dev'):
  return 'lvm'
 elif path.startswith('rbd:'):
  return 'rbd'
 elif (os.path.isdir(path) and os.path.exists(os.path.join(path, 'DiskDescriptor.xml'))):
  return 'ploop'
 return None

def get_disk_type_from_path ( path ) : if path . startswith ( '/dev' ) : return 'lvm' elif path . startswith ( 'rbd:' ) : return 'rbd' elif ( os . path . isdir ( path ) and os . path . exists ( os . path . join ( path , 'DiskDescriptor.xml' ) ) ) : return 'ploop' return None
retrieve disk type for given file .