mirror of https://github.com/apache/cloudstack.git
bug 9961: use 'firewall_rules'.'is_static_nat' field to make a decision about what version to return - 221 or 222
status 9961: resolved fixed
This commit is contained in:
parent
afc9982f5f
commit
cd99334d4f
|
|
@ -102,10 +102,19 @@ public class VersionDaoImpl extends GenericDaoBase<VersionVO, Long> implements V
|
|||
pstmt.close();
|
||||
}
|
||||
} else {
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
s_logger.debug("No version table but has nics table, returning 2.2.1");
|
||||
return "2.2.1";
|
||||
try {
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
pstmt = conn.prepareStatement("SELECT is_static_nat from firewall_rules");
|
||||
pstmt.executeQuery();
|
||||
return "2.2.1";
|
||||
} catch (SQLException e) {
|
||||
s_logger.debug("Assuming the exception means static_nat field doesn't exist in firewall_rules table, returning version 2.2.2");
|
||||
return "2.2.2";
|
||||
} finally {
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue