From 4e2935dc37dff6156290805a4223f330f67b1bf2 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 6 May 2011 10:21:05 -0700 Subject: [PATCH] Fix other stupid string comparsions --- server/src/com/cloud/server/ConfigurationServerImpl.java | 2 +- server/src/com/cloud/vm/UserVmManagerImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 0519b3ea952..1e48c800300 100644 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -513,7 +513,7 @@ public class ConfigurationServerImpl implements ConfigurationServer { String already = _configDao.getValue("ssh.privatekey"); String homeDir = Script.runSimpleBashScript("echo ~"); String userid = System.getProperty("user.name"); - if (homeDir == "~") { + if (homeDir != null && homeDir.equalsIgnoreCase("~")) { s_logger.error("No home directory was detected. Set the HOME environment variable to point to your user profile or home directory."); throw new CloudRuntimeException("No home directory was detected. Set the HOME environment variable to point to your user profile or home directory."); } diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 9d681228870..e2162b5d701 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -1450,7 +1450,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager throw new CloudRuntimeException("Unable to find storage pools in zone " + zoneId); } pool = storagePools.get(0); - if (snapshot.getVersion() == "2.1") { + if (snapshot.getVersion() != null && snapshot.getVersion().equalsIgnoreCase("2.1")) { VolumeVO volume = _volsDao.findByIdIncludingRemoved(volumeId); if (volume == null) { throw new CloudRuntimeException("failed to upgrade snapshot " + snapshotId + " due to unable to find orignal volume:" + volumeId + ", try it later ");