Source:
<code>public static void buildCinderDisk(CinderDisk cinderDisk, Map<String, Object> struct) { CinderConnectionInfo connectionInfo = cinderDisk.getCinderConnectionInfo(); CinderVolumeDriver cinderVolumeDriver = CinderVolumeDriver.forValue(connectionInfo.getDriverVolumeType()); if (cinderVolumeDriver == null) { log.error("Unsupported Cinder volume driver: '{}' (disk: '{}')", connectionInfo.getDriverVolumeType(), cinderDisk.getDiskAlias()); return; } switch (cinderVolumeDriver) { case RBD: <START> String path = (String) cinderDisk.getCinderConnectionInfo().getData().get("name"); <END> struct.put(VdsProperties.Path, path); struct.put(VdsProperties.Format, VolumeFormat.RAW.toString().toLowerCase()); struct.put(VdsProperties.PropagateErrors, PropagateErrors.Off.toString().toLowerCase()); struct.put(VdsProperties.Protocol, cinderDisk.getCinderConnectionInfo().getDriverVolumeType()); struct.put(VdsProperties.DiskType, VdsProperties.NETWORK); List<String> hostAddresses = (ArrayList<String>) cinderDisk.getCinderConnectionInfo().getData().get("hosts"); List<String> hostPorts = (ArrayList<String>) cinderDisk.getCinderConnectionInfo().getData().get("ports"); List<Map<String, Object>> hosts = new ArrayList<>(); for (int i = 0; i < hostAddresses.size(); i++) { Map<String, Object> hostMap = new HashMap<>(); hostMap.put(VdsProperties.NetworkDiskName, hostAddresses.get(i)); hostMap.put(VdsProperties.NetworkDiskPort, hostPorts.get(i)); hostMap.put(VdsProperties.NetworkDiskTransport, VdsProperties.Tcp); hosts.add(hostMap); } struct.put(VdsProperties.NetworkDiskHosts, hosts); break; } }</code><technical_language>Please cinderDisk.getCinderConnectionInfo().getData() a predefined attribute</technical_language>

Target:
public static void buildCinderDisk(CinderDisk cinderDisk, Map<String, Object> struct) { CinderConnectionInfo connectionInfo = cinderDisk.getCinderConnectionInfo(); CinderVolumeDriver cinderVolumeDriver = CinderVolumeDriver.forValue(connectionInfo.getDriverVolumeType()); if (cinderVolumeDriver == null) { log.error("Unsupported Cinder volume driver: '{}' (disk: '{}')", connectionInfo.getDriverVolumeType(), cinderDisk.getDiskAlias()); return; } switch (cinderVolumeDriver) { case RBD: Map<String, Object> connectionInfoData = cinderDisk.getCinderConnectionInfo().getData(); struct.put(VdsProperties.Path, connectionInfoData.get("name")); struct.put(VdsProperties.Format, VolumeFormat.RAW.toString().toLowerCase()); struct.put(VdsProperties.PropagateErrors, PropagateErrors.Off.toString().toLowerCase()); struct.put(VdsProperties.Protocol, cinderDisk.getCinderConnectionInfo().getDriverVolumeType()); struct.put(VdsProperties.DiskType, VdsProperties.NETWORK); List<String> hostAddresses = (ArrayList<String>) connectionInfoData.get("hosts"); List<String> hostPorts = (ArrayList<String>) connectionInfoData.get("ports"); List<Map<String, Object>> hosts = new ArrayList<>(); for (int i = 0; i < hostAddresses.size(); i++) { Map<String, Object> hostMap = new HashMap<>(); hostMap.put(VdsProperties.NetworkDiskName, hostAddresses.get(i)); hostMap.put(VdsProperties.NetworkDiskPort, hostPorts.get(i)); hostMap.put(VdsProperties.NetworkDiskTransport, VdsProperties.Tcp); hosts.add(hostMap); } struct.put(VdsProperties.NetworkDiskHosts, hosts); break; } }