diff options
author | 2017-03-09 18:22:20 +0800 | |
---|---|---|
committer | 2017-03-09 18:22:20 +0800 | |
commit | d5cf1ebde715bd1ee802deded28afecb01c496b3 (patch) | |
tree | 4779470e1a8e1f04dc5a8b4bee352b79c08fa980 /holmes-actions | |
parent | 64b3168e1993689c9003ee43b3ae5811b626c866 (diff) |
Fix micro service status code
Issue-ID:HOLMES-50
Change-Id: Ibdee9acf13c85d554a50e9c758941c9025776a04
Signed-off-by: youbowu <wu.youbo@zte.com.cn>
Diffstat (limited to 'holmes-actions')
-rw-r--r-- | holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java | 2 | ||||
-rw-r--r-- | holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java | 5 |
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 {
|