Skip to content

Commit 189ac88

Browse files
committed
bug CS-14785: String equality should be through equals function....what was i thinking !!!.
1 parent 1d105da commit 189ac88

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

server/src/com/cloud/storage/download/DownloadListener.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ public void setDisconnected() {
214214
}
215215

216216
public void logDisconnect() {
217-
s_logger.warn("Unable to monitor download progress of " + template.getName() + " at host " + sserver.getName());
217+
if (template != null){
218+
s_logger.warn("Unable to monitor download progress of " + template.getName() + " at host " + sserver.getName());
219+
}else {
220+
s_logger.warn("Unable to monitor download progress of " + volume.getName() + " at host " + sserver.getName());
221+
}
218222
}
219223

220224
public synchronized void updateDatabase(Status state, String errorString) {

server/src/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ public Volume attachVolumeToVM(AttachVolumeCmd command) {
591591
}else {
592592
try {
593593
// Format of data disk should be the same as root disk
594-
if(_storageMgr.getSupportedImageFormatForCluster(rootDiskPool.getClusterId()) != volHostVO.getFormat().getFileExtension()){
594+
if( ! volHostVO.getFormat().getFileExtension().equals(_storageMgr.getSupportedImageFormatForCluster(rootDiskPool.getClusterId())) ){
595595
throw new InvalidParameterValueException("Failed to attach volume to VM since volumes format " +volHostVO.getFormat().getFileExtension()+
596596
" is not compatible with the vm hypervisor type" );
597597
}

0 commit comments

Comments
 (0)