diff options
author | Gao Weitao <victor.gao@huawei.com> | 2017-09-12 13:53:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-12 13:53:21 +0000 |
commit | efafa658f181671c71355a3e9a82003a648baa88 (patch) | |
tree | c4ea6d36c5273190adfcfb1a3a3ce014b81b5ca7 /huawei | |
parent | 5f884a05bc067dbacd303fffd2f7cd27af6473f6 (diff) | |
parent | a13f8d6eb2c9c7fe996abc0cfc0aa12403933d18 (diff) |
Merge "Resolve healing VNF problem"
Diffstat (limited to 'huawei')
3 files changed, 12 insertions, 10 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/ResultRequestUtil.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/ResultRequestUtil.java index 73502130..8890412f 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/ResultRequestUtil.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/ResultRequestUtil.java @@ -245,11 +245,12 @@ public final class ResultRequestUtil { String result = null; String vnfPath = path.contains("%s") ? String.format(path, mgrVcmm.getRoaRand()) : path; - LOG.info("function=call, msg=url is {}, session is {}", vnfmObject.getString("url") + vnfPath, - mgrVcmm.getAccessSession()); + String oldUrl = vnfmObject.getString("url").trim(); + String newUrl = oldUrl.replaceAll("30001", "30000"); + LOG.info("function=call, msg=url is {}, session is {}", newUrl + vnfPath, mgrVcmm.getAccessSession()); HttpRequests.Builder builder = - new HttpRequests.Builder(authModel).addHeader(Constant.ACCESSSESSION, mgrVcmm.getAccessSession()) - .setUrl(vnfmObject.getString("url"), vnfPath).setParams(paramsJson); + new HttpRequests.Builder(authModel).addHeader("X-Auth-Token", mgrVcmm.getAccessSession()) + .setUrl(newUrl, vnfPath).setParams(paramsJson); MethodType methodType = MethodType.methodType(HttpRequests.Builder.class, new Class[0]); MethodHandle mt = MethodHandles.lookup().findVirtual(builder.getClass(), methodName, methodType).bindTo(builder); @@ -263,8 +264,6 @@ public final class ResultRequestUtil { // logout delete tokens String token = mgrVcmm.getAccessSession(); - String oldUrl = vnfmObject.getString("url").trim(); - String newUrl = oldUrl.replaceAll("30001", "30000"); String user = vnfmObject.getString("userName"); removeV3Tokens(newUrl, token, user); } catch(IOException e) { diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/connect/ConnectMgrVnfm.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/connect/ConnectMgrVnfm.java index e71ba27e..4c2383a5 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/connect/ConnectMgrVnfm.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/connect/ConnectMgrVnfm.java @@ -135,14 +135,17 @@ public class ConnectMgrVnfm { try { httpMethod = new HttpRequests.Builder(info.getAuthenticateMode()) .setUrl(info.getUrl(), ParamConstants.CSM_AUTH_CONNECT_SOUTH) - .setParams(String.format(ParamConstants.GET_TOKENS_V3, info.getUserName(), info.getUserPwd())) + .setParams(String.format(ParamConstants.GET_TOKENS_V3, info.getUserName(), info.getUserPwd(), + info.getUserName())) .post().execute(); statusCode = httpMethod.getStatusCode(); String result = httpMethod.getResponseBodyAsString(); - LOG.info("connect result:" + result); + LOG.info("connect statusCode={}, result={}:", statusCode, result); if(statusCode == HttpStatus.SC_CREATED) { - Header header = httpMethod.getResponseHeader("accessSession"); + LOG.info("function=connectSouth, header={}.", httpMethod.getResponseHeaders()); + Header header = httpMethod.getResponseHeader("X-Subject-Token"); + LOG.info("function=connectSouth, header={}.", header.getValue()); setAccessSession(header.getValue()); statusCode = HttpStatus.SC_OK; } else { diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java index f8aedede..9fa4260c 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/vnf/VnfMgrVnfm.java @@ -260,7 +260,7 @@ public class VnfMgrVnfm implements InterfaceVnfMgr { restJson.put(Constant.RETCODE, Constant.REST_SUCCESS); } else { - LOG.error("function=getJob, msg=send get vnf msg to csm get wrong status: {}", statusCode); + LOG.error("function=healVnf, msg=send heal vnf msg to csm get wrong status: {}", statusCode); } return restJson; |