Fixed few coverity issues

(cherry picked from commit 45597766a5)
This commit is contained in:
Santhosh Edukulla 2014-10-07 12:19:39 +05:30 committed by David Nalley
parent c90db15ade
commit 0df43197d9
2 changed files with 6 additions and 8 deletions

View File

@ -4440,16 +4440,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
cmd.setCluster(_cluster);
cmd.setPoolSync(false);
Pool pool;
try {
pool = Pool.getByUuid(conn, _host.pool);
Pool pool = Pool.getByUuid(conn, _host.pool);
Pool.Record poolr = pool.getRecord(conn);
Host.Record hostr = poolr.master.getRecord(conn);
poolr.master.getRecord(conn);
} catch (Throwable e) {
s_logger.warn("Check for master failed, failing the FULL Cluster sync command");
}
StartupStorageCommand sscmd = initializeLocalSR(conn);
if (sscmd != null) {
return new StartupCommand[] {cmd, sscmd};

View File

@ -3964,8 +3964,9 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
+ " capabilities can be sepcified for source nat service");
}
for (Capability capability : sourceNatServiceCapabilityMap.keySet()) {
String value = sourceNatServiceCapabilityMap.get(capability);
for (Map.Entry<Capability ,String> srcNatPair : sourceNatServiceCapabilityMap.entrySet()) {
Capability capability = srcNatPair.getKey();
String value = srcNatPair.getValue();
if (capability == Capability.SupportedSourceNatTypes) {
boolean perAccount = value.contains("peraccount");
boolean perZone = value.contains("perzone");
@ -4284,7 +4285,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
@Override
public Pair<List<? extends NetworkOffering>, Integer> searchForNetworkOfferings(ListNetworkOfferingsCmd cmd) {
Boolean isAscending = Boolean.parseBoolean(_configDao.getValue("sortkey.algorithm"));
isAscending = (isAscending == null ? true : isAscending);
isAscending = (isAscending == null ? Boolean.TRUE : isAscending);
Filter searchFilter = new Filter(NetworkOfferingVO.class, "sortKey", isAscending, null, null);
Account caller = CallContext.current().getCallingAccount();
SearchCriteria<NetworkOfferingVO> sc = _networkOfferingDao.createSearchCriteria();