mirror of
https://github.com/apache/cloudstack
synced 2026-08-16 09:23:35 +00:00
Fix other stupid string comparsions
This commit is contained in:
parent
cbe368ef69
commit
4e2935dc37
@ -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.");
|
||||
}
|
||||
|
||||
@ -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 ");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user