Skip to content

Commit f221b9a

Browse files
committed
CLOUDSTACK-8656: 30x legacy upgrade code exception messages
1 parent 8e3b99d commit f221b9a

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

‎engine/schema/src/com/cloud/upgrade/dao/Upgrade306to307.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import com.cloud.utils.exception.CloudRuntimeException;
2929
import com.cloud.utils.script.Script;
3030

31-
public class Upgrade306to307 extends Upgrade30xBase implements DbUpgrade {
31+
public class Upgrade306to307 extends Upgrade30xBase {
3232
final static Logger s_logger = Logger.getLogger(Upgrade306to307.class);
3333

3434
@Override
@@ -97,6 +97,7 @@ protected void updateConcurrentConnectionsInNetworkOfferings(Connection conn) {
9797
pstmt = conn.prepareStatement("drop table `cloud`.`network_details`");
9898
pstmt.executeUpdate();
9999
} catch (SQLException e) {
100+
s_logger.info("[ignored] error during network offering update:" + e.getLocalizedMessage(), e);
100101
} finally {
101102
closeAutoCloseable(rs);
102103
closeAutoCloseable(rs1);

‎engine/schema/src/com/cloud/upgrade/dao/Upgrade30to301.java‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import com.cloud.utils.exception.CloudRuntimeException;
2929
import com.cloud.utils.script.Script;
3030

31-
public class Upgrade30to301 implements DbUpgrade {
31+
public class Upgrade30to301 extends LegacyDbUpgrade {
3232
final static Logger s_logger = Logger.getLogger(Upgrade30to301.class);
3333

3434
@Override
@@ -100,20 +100,9 @@ protected void udpateAccountNetworkResourceCount(Connection conn) {
100100
} catch (SQLException e) {
101101
throw new CloudRuntimeException("Unable to update network resource count for account id=" + accountId, e);
102102
} finally {
103-
try {
104-
if (rs != null) {
105-
rs.close();
106-
}
107-
108-
if (rs1 != null) {
109-
rs1.close();
110-
}
111-
112-
if (pstmt != null) {
113-
pstmt.close();
114-
}
115-
} catch (SQLException e) {
116-
}
103+
closeAutoCloseable(rs);
104+
closeAutoCloseable(rs1);
105+
closeAutoCloseable(pstmt);
117106
}
118107
}
119108

0 commit comments

Comments
 (0)