Define constant instead of localhost 45/15845/1
authorluxin <luxin7@huawei.com>
Wed, 27 Sep 2017 08:28:28 +0000 (16:28 +0800)
committerluxin <luxin7@huawei.com>
Wed, 27 Sep 2017 08:28:28 +0000 (16:28 +0800)
Change-Id: Idcf4f03cf564a1a454502f9b4382cb603239fc51
Issue-Id:VFC-391
Signed-off-by: luxin <luxin7@huawei.com>
huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java
huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java
huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java
huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java

index 110d170..24d6ed1 100644 (file)
@@ -212,6 +212,7 @@ public class DownloadCsarManager {
                     zipFile.close();
                 } catch(IOException e) {
                     LOG.error("IOException: " + e);
+                    ;
                 }
             }
         }
index 45e1c75..cc80b5e 100644 (file)
@@ -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;
 
index 64e852e..420d8eb 100644 (file)
@@ -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