Skip to content

Commit 3d9eaf0

Browse files
author
Mike Tutkowski
committed
Fixed some spacing issues from 4d6c682
1 parent b2283d7 commit 3d9eaf0

3 files changed

Lines changed: 22 additions & 21 deletions

File tree

‎engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,10 @@ private Map<String, String> getDetails(VolumeInfo volumeInfo, DataStore dataStor
10511051
details.put(DiskTO.VOLUME_SIZE, String.valueOf(volumeInfo.getSize()));
10521052
details.put(DiskTO.IQN, volumeInfo.get_iScsiName());
10531053
details.put(DiskTO.MOUNT_POINT, volumeInfo.get_iScsiName());
1054+
10541055
VolumeVO volume = _volumeDao.findById(volumeInfo.getId());
1055-
details.put(DiskTO.PROTOCOL_TYPE, (volume.getPoolType()!=null)?volume.getPoolType().toString():null);
1056+
1057+
details.put(DiskTO.PROTOCOL_TYPE, (volume.getPoolType() != null) ? volume.getPoolType().toString() : null);
10561058

10571059
ChapInfo chapInfo = volService.getChapInfo(volumeInfo, dataStore);
10581060

‎plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java‎

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,16 +1886,14 @@ protected SR prepareManagedSr(Connection conn, Map<String, String> details) {
18861886
String mountpoint = details.get(DiskTO.MOUNT_POINT);
18871887
String protocoltype=details.get(DiskTO.PROTOCOL_TYPE);
18881888

1889-
if(StoragePoolType.NetworkFilesystem.toString().equalsIgnoreCase(protocoltype)){
1890-
String poolid = storageHost+":"+mountpoint;
1891-
String namelable = mountpoint;
1892-
String volumedesc = storageHost+":"+mountpoint;
1889+
if (StoragePoolType.NetworkFilesystem.toString().equalsIgnoreCase(protocoltype)) {
1890+
String poolid = storageHost + ":" + mountpoint;
1891+
String namelable = mountpoint;
1892+
String volumedesc = storageHost + ":" + mountpoint;
18931893

1894-
return getNfsSR(conn, poolid, namelable, storageHost, mountpoint, volumedesc);
1895-
1896-
}else{
1897-
1898-
return getIscsiSR(conn, iScsiName, storageHost, iScsiName, chapInitiatorUsername, chapInitiatorSecret, true);
1894+
return getNfsSR(conn, poolid, namelable, storageHost, mountpoint, volumedesc);
1895+
} else {
1896+
return getIscsiSR(conn, iScsiName, storageHost, iScsiName, chapInitiatorUsername, chapInitiatorSecret, true);
18991897
}
19001898
}
19011899

@@ -1908,20 +1906,21 @@ protected VDI prepareManagedStorage(Connection conn, Map<String, String> details
19081906
if (vdi == null) {
19091907

19101908
vdi = createVdi(sr, vdiNameLabel, volumeSize);
1911-
}else {
1909+
} else {
1910+
// if VDI is not null, it must have already been created, so check whether a resize of the volume was performed
1911+
// if true, resize the VDI to the volume size
19121912

1913-
// if vdi is not null, it must have been already created, check whether a resize of volume was done
1914-
// if true , resize the vdi to the volume size
19151913
s_logger.info("checking for the resize of the datadisk");
1916-
long vdiVirtualsize = vdi.getVirtualSize(conn);
19171914

1918-
if(vdiVirtualsize != volumeSize){
1919-
s_logger.info("resizing the datadisk(vdi) from vdiVirtualsize :"+ vdiVirtualsize + "to volumeSize :" + volumeSize);
1915+
long vdiVirtualSize = vdi.getVirtualSize(conn);
1916+
1917+
if (vdiVirtualSize != volumeSize) {
1918+
s_logger.info("resizing the datadisk(vdi) from vdiVirtualsize :"+ vdiVirtualSize + "to volumeSize :" + volumeSize);
19201919

19211920
try {
19221921
vdi.resize(conn, volumeSize);
19231922
} catch (Exception e) {
1924-
s_logger.warn("Unable to resize volume",e);
1923+
s_logger.warn("Unable to resize volume", e);
19251924
}
19261925
}
19271926
}
@@ -5086,7 +5085,7 @@ protected Answer execute(CreateStoragePoolCommand cmd) {
50865085
StorageFilerTO pool = cmd.getPool();
50875086
try {
50885087
if (pool.getType() == StoragePoolType.NetworkFilesystem) {
5089-
getNfsSR(conn, Long.toString(pool.getId()),pool.getUuid(),pool.getHost(),pool.getPath(),pool.toString());
5088+
getNfsSR(conn, Long.toString(pool.getId()), pool.getUuid(), pool.getHost(), pool.getPath(), pool.toString());
50905089
} else if (pool.getType() == StoragePoolType.IscsiLUN) {
50915090
getIscsiSR(conn, pool.getUuid(), pool.getHost(), pool.getPath(), null, null, false);
50925091
} else if (pool.getType() == StoragePoolType.PreSetup) {
@@ -6096,7 +6095,7 @@ protected SR getIscsiSR(Connection conn, String srNameLabel, String target, Stri
60966095
}
60976096
}
60986097

6099-
protected SR getNfsSR(Connection conn,String poolid,String uuid, String server,String serverpath,String pooldesc) {
6098+
protected SR getNfsSR(Connection conn, String poolid, String uuid, String server, String serverpath, String pooldesc) {
61006099
Map<String, String> deviceConfig = new HashMap<String, String>();
61016100
try {
61026101
serverpath = serverpath.replace("//", "/");
@@ -6129,7 +6128,7 @@ protected SR getNfsSR(Connection conn,String poolid,String uuid, String server,S
61296128

61306129
if (server.equals(dc.get("server")) && serverpath.equals(dc.get("serverpath"))) {
61316130
throw new CloudRuntimeException("There is a SR using the same configuration server:" + dc.get("server") + ", serverpath:" + dc.get("serverpath") +
6132-
" for pool " + uuid + "on host:" + _host.uuid);
6131+
" for pool " + uuid + " on host:" + _host.uuid);
61336132
}
61346133

61356134
}

‎server/src/com/cloud/storage/VolumeApiServiceImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2094,7 +2094,7 @@ private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volumeToAttach, L
20942094
details.put(DiskTO.VOLUME_SIZE, String.valueOf(volumeToAttach.getSize()));
20952095
details.put(DiskTO.IQN, volumeToAttach.get_iScsiName());
20962096
details.put(DiskTO.MOUNT_POINT, volumeToAttach.get_iScsiName());
2097-
details.put(DiskTO.PROTOCOL_TYPE, (volumeToAttach.getPoolType()!=null) ? volumeToAttach.getPoolType().toString() : null);
2097+
details.put(DiskTO.PROTOCOL_TYPE, (volumeToAttach.getPoolType() != null) ? volumeToAttach.getPoolType().toString() : null);
20982098

20992099
if (chapInfo != null) {
21002100
details.put(DiskTO.CHAP_INITIATOR_USERNAME, chapInfo.getInitiatorUsername());

0 commit comments

Comments
 (0)