summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-03-09 10:27:41 +0000
committerGerrit Code Review <gerrit@open-o.org>2017-03-09 10:27:41 +0000
commitb67a0ef5ee0ef5a6d84529b6c52d5072807cc36e (patch)
tree3e6d96ddc677ca3cbe953c7329b52fc2fc58b06f
parent46c009200583a0e5551e5de1cfc91c8b0b3e42cb (diff)
parentd5cf1ebde715bd1ee802deded28afecb01c496b3 (diff)
Merge "Fix micro service status code"
-rw-r--r--holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java2
-rw-r--r--holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java5
2 files changed, 3 insertions, 4 deletions
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java b/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java
index 2ddf78f..3894bf3 100644
--- a/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java
+++ b/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java
@@ -33,5 +33,5 @@ public interface AlarmConst {
String ADMIN = "admin";
- int RESPONSE_STATUS_OK = 200;
+ int MICRO_SERVICE_STATUS_SUCCESS = 201;
}
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java b/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java
index 30e411f..826fbd0 100644
--- a/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java
+++ b/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java
@@ -53,14 +53,13 @@ public class MSBRegisterUtil {
log.warn("Registering the service to the bus failure", e);
return false;
}
- if (response.getStatusLine().getStatusCode() == AlarmConst.RESPONSE_STATUS_OK) {
+ if (response.getStatusLine().getStatusCode() == AlarmConst.MICRO_SERVICE_STATUS_SUCCESS) {
log.info("Registration successful service to the bus :" + response.getEntity());
return true;
} else {
log.warn(
"Registering the service to the bus failure:" + response.getStatusLine().getStatusCode() + " " +
- response.getStatusLine().getReasonPhrase() + response.getStatusLine()
- .getProtocolVersion());
+ response.getStatusLine().getReasonPhrase());
return false;
}
} finally {