diff options
5 files changed, 11 insertions, 8 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java index 110d170b..24d6ed11 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java @@ -212,6 +212,7 @@ public class DownloadCsarManager { zipFile.close(); } catch(IOException e) { LOG.error("IOException: " + e); + ; } } } diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java index 45e1c753..cc80b5ed 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Huawei Technologies Co., Ltd. + * Copyright 2016-2017 Huawei Technologies Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import org.eclipse.jetty.client.Address; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpExchange; import org.eclipse.jetty.http.HttpMethods; +import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.constant.Constant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,11 +50,9 @@ public abstract class HttpBaseRest implements Restful { protected HttpClient client = null; - private static final String LOCAL_HOST = "127.0.0.1"; - static final String HTTP_PATCH = "PATCH"; - String defaultIP = LOCAL_HOST; + String defaultIP = Constant.LOCAL_HOST; int defaultPort = -10000; diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java index 64e852e4..420d8eb0 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java @@ -395,7 +395,7 @@ public class AdapterResourceManager implements IResourceManager { JSONArray resArray = new JSONArray(); if(url == null || url.equals("")) { - url = "http://127.0.0.1:31943"; + url = "http://" + Constant.LOCAL_HOST + ":31943"; } // get vim_id diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java index 936be09c..3b1036e2 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java @@ -156,6 +156,8 @@ public class Constant { public static final String USERNAME = "userName"; + public static final String LOCAL_HOST = "127.0.0.1"; + private Constant() { // private constructor } diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java index be7134ea..6dc49af6 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/rest/VnfResourceRoa.java @@ -71,7 +71,7 @@ public class VnfResourceRoa { JSONObject dataObject = VnfmJsonUtil.getJsonFromContexts(context); LOG.info("function=grantVnfRes, dataObject: {}", dataObject); - /*if(null == dataObject) { + if(null == dataObject) { LOG.error("function=grantVnfRes, msg=param error"); restJson.put("data", "Params error"); return restJson.toString(); @@ -87,9 +87,10 @@ public class VnfResourceRoa { String vnfmId = grantObj.getString("project_id"); - JSONObject resultObj = vnfResourceMgr.grantVnfResource(grantObj, vnfId, vnfmId);*/ + JSONObject resultObj = vnfResourceMgr.grantVnfResource(grantObj, vnfId, vnfmId); + LOG.info("grantVnfResource resultObj:", resultObj); JSONObject res = new JSONObject(); - res.put("msg","grant success"); + res.put("msg", "grant success"); return res.toString(); } |