java/code
Tomas Lestach
tlestach at fedoraproject.org
Fri Jun 15 14:27:19 UTC 2012
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 2 -
java/code/src/com/redhat/rhn/manager/system/VirtualizationEntitlementsManager.java | 15 ++++------
2 files changed, 7 insertions(+), 10 deletions(-)
New commits:
commit 601d654c90a312bcd1a8c599924f22b7026212ab
Author: Tomas Lestach <tlestach at redhat.com>
Date: Wed Jun 13 19:15:04 2012 +0200
822918 - impossible to get error code from PG exceptions
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
index 2ab6889..3c15485 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
@@ -997,7 +997,7 @@ GROUP BY C.id, C.name
</mode>
<callable-mode name="convert_to_flex">
- <query params="sid, cfid, uid">
+ <query params="sid, cfid">
{ call rhn_channel.convert_to_fve(:sid, :cfid) }
</query>
</callable-mode>
diff --git a/java/code/src/com/redhat/rhn/manager/system/VirtualizationEntitlementsManager.java b/java/code/src/com/redhat/rhn/manager/system/VirtualizationEntitlementsManager.java
index e902c0b..00b67a3 100644
--- a/java/code/src/com/redhat/rhn/manager/system/VirtualizationEntitlementsManager.java
+++ b/java/code/src/com/redhat/rhn/manager/system/VirtualizationEntitlementsManager.java
@@ -17,14 +17,12 @@ package com.redhat.rhn.manager.system;
import com.redhat.rhn.common.db.WrappedSQLException;
import com.redhat.rhn.common.db.datasource.CallableMode;
import com.redhat.rhn.common.db.datasource.ModeFactory;
-import com.redhat.rhn.domain.common.ExceptionMessage;
import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.domain.server.ServerFactory;
import com.redhat.rhn.domain.server.VirtualInstanceFactory;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.dto.ChannelFamilySystemGroup;
-import java.sql.SQLException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
@@ -160,14 +158,13 @@ public class VirtualizationEntitlementsManager {
toRet.add(sid);
}
catch (WrappedSQLException sq) {
- SQLException ex = (SQLException) sq.getCause();
- if (ex != null) {
- ExceptionMessage m = ExceptionMessage.lookup(ex.getErrorCode());
- if (m != null && "not_enough_flex_entitlements".equals(m.getLabel())) {
- break;
+ String msg = sq.getMessage();
+ if (msg != null) {
+ if (msg.contains("not_enough_flex_entitlements")) {
+ continue;
}
- if (m != null && "server_cannot_convert_to_flex".equals(m.getLabel())) {
- break;
+ if (msg.contains("server_cannot_convert_to_flex")) {
+ continue;
}
}
throw sq;
More information about the spacewalk-commits
mailing list