summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-09-05 16:30:56 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-09-05 16:30:56 +0800
commitb19cd10e7172bce9e9cded9b62aa9ef8655a2efb (patch)
treeaac7d44478b2aaed1c5e56ed32992893402fb3bf
parent583408b26920a38ed189a3bc0a8df7c7ad5028be (diff)
Fix vfc-catalog microservice port
Fix the port of vfc catalog and code indentation is not canonical. Change-Id: I88371420d49b1c2427179be854548db654b51d9c Issue-ID: VFC-279 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--assembly.xml2
-rw-r--r--catalog/packages/nf_package.py25
-rw-r--r--catalog/packages/ns_package.py17
-rw-r--r--catalog/packages/tests.py2
-rw-r--r--catalog/packages/urls.py1
-rw-r--r--catalog/packages/views.py2
-rwxr-xr-xdocker/Dockerfile2
-rw-r--r--requirements.txt1
8 files changed, 17 insertions, 35 deletions
diff --git a/assembly.xml b/assembly.xml
index 54cda217..a062bc06 100644
--- a/assembly.xml
+++ b/assembly.xml
@@ -44,7 +44,7 @@
<include>*.sh</include>
<include>Dockerfile</include>
</includes>
- </fileSet>
+ </fileSet>
<fileSet>
<directory>static</directory>
<outputDirectory>/static</outputDirectory>
diff --git a/catalog/packages/nf_package.py b/catalog/packages/nf_package.py
index 448572bb..fe7c49f5 100644
--- a/catalog/packages/nf_package.py
+++ b/catalog/packages/nf_package.py
@@ -14,23 +14,19 @@
import json
import logging
-import uuid
import os
-import time
+import sys
import threading
import traceback
-import sys
+from catalog.pub.config.config import CATALOG_ROOT_PATH
from catalog.pub.database.models import NfPackageModel
-from catalog.pub.utils.values import ignore_case_get
-from catalog.pub.utils import fileutil
from catalog.pub.exceptions import CatalogException
-from catalog.pub.config.config import CATALOG_ROOT_PATH
-from catalog.pub.msapi.extsys import get_vims
-from catalog.pub.utils.jobutil import JobUtil
-from catalog.pub.utils import toscaparser
-from catalog.pub.msapi import sdc
from catalog.pub.msapi import nfvolcm
+from catalog.pub.msapi import sdc
+from catalog.pub.utils import fileutil
+from catalog.pub.utils import toscaparser
+from catalog.pub.utils.jobutil import JobUtil
logger = logging.getLogger(__name__)
@@ -71,7 +67,7 @@ def parser_vnfdmodel(csar_id,inputs):
logger.error(traceback.format_exc())
return [1, str(sys.exc_info())]
return [0,ret]
-#####################################################################################
+
class NfDistributeThread(threading.Thread):
"""
@@ -151,8 +147,6 @@ class NfDistributeThread(threading.Thread):
logger.error(traceback.format_exc())
logger.error(str(sys.exc_info()))
-######################################################################################################################
-
class NfPkgDeleteThread(threading.Thread):
"""
@@ -207,8 +201,6 @@ class NfPkgDeleteThread(threading.Thread):
JobUtil.add_job_status(self.job_id, 100, "Delete CSAR(%s) successfully." % self.csar_id)
-######################################################################################################################
-
class NfPackage(object):
"""
Actions for sdc nf package.
@@ -246,6 +238,3 @@ class NfPackage(object):
"packageInfo": pkg_info,
"imageInfo": [],
"vnfInstanceInfo": vnf_inst_info}]
-
-
-
diff --git a/catalog/packages/ns_package.py b/catalog/packages/ns_package.py
index 451e9f20..1d062b47 100644
--- a/catalog/packages/ns_package.py
+++ b/catalog/packages/ns_package.py
@@ -14,19 +14,17 @@
import json
import logging
-
-import traceback
-import sys
import os
+import sys
+import traceback
+from catalog.pub.config.config import CATALOG_ROOT_PATH
from catalog.pub.database.models import NSDModel, NfPackageModel
-from catalog.pub.utils.values import ignore_case_get
from catalog.pub.exceptions import CatalogException
+from catalog.pub.msapi import nfvolcm
from catalog.pub.msapi import sdc
-from catalog.pub.config.config import CATALOG_ROOT_PATH
-from catalog.pub.utils import toscaparser
from catalog.pub.utils import fileutil
-from catalog.pub.msapi import nfvolcm
+from catalog.pub.utils import toscaparser
logger = logging.getLogger(__name__)
@@ -101,7 +99,6 @@ def parser_nsdmodel(csar_id,inputs):
return [1, str(sys.exc_info())]
return [0,ret]
-###############################################################################################################
class NsPackage(object):
"""
@@ -193,7 +190,3 @@ class NsPackage(object):
def delete_catalog(self, csar_id):
local_path = os.path.join(CATALOG_ROOT_PATH, csar_id)
fileutil.delete_dirs(local_path)
-
-
-
- \ No newline at end of file
diff --git a/catalog/packages/tests.py b/catalog/packages/tests.py
index 5c4f4ab0..97d4dc34 100644
--- a/catalog/packages/tests.py
+++ b/catalog/packages/tests.py
@@ -607,4 +607,4 @@ class PackageTest(unittest.TestCase):
reqdata = {"csarId": "123", "inputs":""}
response = self.client.post("/api/catalog/v1/parsernsd",reqdata)
- #self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content) \ No newline at end of file
+ #self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content)
diff --git a/catalog/packages/urls.py b/catalog/packages/urls.py
index ace66491..4ddf6883 100644
--- a/catalog/packages/urls.py
+++ b/catalog/packages/urls.py
@@ -22,7 +22,6 @@ urlpatterns = [
url(r'^api/catalog/v1/vnfpackages/(?P<csarId>[0-9a-zA-Z\-\_]+)$', views.nf_rd_csar, name='nfpackage_rd'),
url(r'^api/catalog/v1/parsernsd$', views.ns_model_parser, name='nsmodelparser_rc'),
url(r'^api/catalog/v1/parservnfd$', views.vnf_model_parser, name='vnfmodelparser_rc'),
-
]
diff --git a/catalog/packages/views.py b/catalog/packages/views.py
index f0097505..cd366760 100644
--- a/catalog/packages/views.py
+++ b/catalog/packages/views.py
@@ -32,7 +32,7 @@ def nspackages_rc(request, *args, **kwargs):
if request.method == 'GET':
# Gets ns package list
- ret = ns_package.ns_get_csars();
+ ret = ns_package.ns_get_csars()
normal_status = status.HTTP_200_OK
elif request.method == 'POST':
# Distributes the package accroding to the given csarId
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 768906e6..ad89e7be 100755
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -35,7 +35,7 @@ RUN wget -q -O vfc-nfvo-catalog.zip 'https://nexus.onap.org/service/local/artifa
unzip vfc-nfvo-catalog.zip && \
rm -rf vfc-nfvo-catalog.zip
-EXPOSE 8403
+EXPOSE 8806
EXPOSE 3306
EXPOSE 6379
diff --git a/requirements.txt b/requirements.txt
index e0114780..36d5a354 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -21,4 +21,5 @@ mock==2.0.0
unittest_xml_reporting==1.12.0
# for parser
+paramiko==2.0.2
nfv-toscaparser==0.5.0.dev95 \ No newline at end of file