Fix vfc-lcm/pub/activiti pep8 issue 89/15789/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Wed, 27 Sep 2017 05:38:28 +0000 (13:38 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Wed, 27 Sep 2017 05:38:28 +0000 (13:38 +0800)
Change-Id: I3d0a9a7fb38643646f5f60840307fdd6b61b9a9b
Issue-ID: VFC-456
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
lcm/pub/msapi/activiti.py
lcm/pub/msapi/catalog.py
lcm/pub/msapi/extsys.py
lcm/pub/msapi/nslcm.py
lcm/pub/msapi/sdc_run_catalog.py
lcm/pub/msapi/vnfmdriver.py

index b3a1220..5044bd4 100644 (file)
@@ -23,32 +23,37 @@ filename:formdata
 =================================
 Output:
 {
-    "status": "int", 
-    "message": "string", 
-    "deployedId": "string", 
-    "processId": "string" 
+    "status": "int",
+    "message": "string",
+    "deployedId": "string",
+    "processId": "string"
 }
 """
+
+
 def deploy_workflow(file_path):
     file_name = file_path.split("/")[-1]
     file_data = {
-        'file': open(file_path, 'rb'), 
+        'file': open(file_path, 'rb'),
         'filename': file_name}
     ret = restcall.upload_by_msb("api/workflow/v1/package", "POST", file_data)
     if ret[0] != 0:
         raise NSLCMException("Status code is %s, detail is %s.", ret[2], ret[1])
     return json.JSONDecoder().decode(ret[1])
 
+
 """
 Input:
 None
 =================================
 Output:
 {
-    "status": "int", 
-    "message": "string", 
+    "status": "int",
+    "message": "string",
 }
 """
+
+
 def undeploy_workflow(deploy_id):
     uri = "api/workflow/v1/package/{deployId}".format(deployId=deploy_id)
     ret = restcall.req_by_msb(uri, "DELETE")
@@ -60,21 +65,21 @@ def undeploy_workflow(deploy_id):
 """
 Input:
 {
-    "processId": "string", 
-    "params": "Map<String, String>" 
+    "processId": "string",
+    "params": "Map<String, String>"
 }
 =================================
 Output:
 {
-    "status": "int", 
-    "message": "string", 
+    "status": "int",
+    "message": "string",
 }
 """
+
+
 def exec_workflow(content):
     content_str = json.JSONEncoder().encode(content)
     ret = restcall.req_by_msb("api/workflow/v1/process/instance", "POST", content_str)
     if ret[0] != 0:
         raise NSLCMException("Status code is %s, detail is %s.", ret[2], ret[1])
     return json.JSONDecoder().decode(ret[1])
-
-
index db54a78..ebefcab 100644 (file)
@@ -83,6 +83,7 @@ def get_process_id(name, srv_template_id):
             return item['processId']
     raise NSLCMException('service[%s,%s] process id not exist' % (name, srv_template_id))
 
+
 def get_servicetemplate_id(nsd_id):
     ret = req_by_msb('/api/catalog/v1/servicetemplates', 'GET')
     if ret[0] != 0:
@@ -92,7 +93,8 @@ def get_servicetemplate_id(nsd_id):
         if stpl.get("id", "") == nsd_id:
             return stpl["serviceTemplateId"]
     raise NSLCMException('servicetemplate(%s) does not exist.' % nsd_id)
-    
+
+
 def get_servicetemplate(nsd_id):
     ret = req_by_msb('/api/catalog/v1/servicetemplates', 'GET')
     if ret[0] != 0:
index 0214406..0d423b6 100644 (file)
@@ -49,12 +49,14 @@ def get_vim_by_id(vim_id):
     vim_info = convert_vim_info(vim_info_aai)
     return vim_info
 
+
 def split_vim_to_owner_region(vim_id):
     split_vim = vim_id.split('_')
     cloud_owner = split_vim[0]
     cloud_region = "".join(split_vim[1:])
     return cloud_owner, cloud_region
 
+
 def convert_vim_info(vim_info_aai):
     vim_id = vim_info_aai["cloud-owner"] + "_" + vim_info_aai["cloud-region-id"]
     esr_system_info = ignore_case_get(ignore_case_get(vim_info_aai, "esr-system-info-list"), "esr-system-info")
index 70cb708..44d8f84 100644 (file)
@@ -19,6 +19,7 @@ from lcm.pub.utils.restcall import req_by_msb
 
 logger = logging.getLogger(__name__)
 
+
 def call_from_ns_cancel_resource(res_type, instid):
     method = "DELETE"
     if res_type == 'vl':
@@ -33,4 +34,4 @@ def call_from_ns_cancel_resource(res_type, instid):
     req_param = {}
     ret = req_by_msb(uri, method, json.dumps(req_param))
     logger.info("[NS terminate] call vnfm [%s] result:%s" % (res_type, ret))
-    return ret
\ No newline at end of file
+    return ret
index cf84dff..45383c2 100644 (file)
@@ -29,6 +29,7 @@ def parse_nsd(csar_id, input_parameters=[]):
         raise NSLCMException("Failed to parsernsd of CSAR(%s) from catalog." % csar_id)
     return json.JSONDecoder().decode(ret[1])
 
+
 def parse_vnfd(csar_id, input_parameters=[]):
     req_param = json.JSONEncoder().encode({"csarId": csar_id, "inputs": input_parameters})
     ret = req_by_msb("/api/catalog/v1/parservnfd", "POST", req_param)
index 9e88e2d..096462b 100644 (file)
@@ -15,9 +15,8 @@ import json
 import logging
 
 from lcm.pub.exceptions import NSLCMException
-from lcm.pub.utils.restcall import req_by_msb
-from lcm.pub.utils.values import ignore_case_get
 from lcm.pub.msapi.extsys import get_vnfm_by_id
+from lcm.pub.utils.restcall import req_by_msb
 
 logger = logging.getLogger(__name__)
 
@@ -31,6 +30,7 @@ def send_nf_init_request(vnfm_inst_id, req_param):
         raise NSLCMException('Failed to send nf init request to VNFM(%s)' % vnfm_inst_id)
     return json.JSONDecoder().decode(ret[1])
 
+
 def send_nf_terminate_request(vnfm_inst_id, vnf_inst_id, req_param):
     vnfm = get_vnfm_by_id(vnfm_inst_id)
     uri = '/api/%s/v1/%s/vnfs/%s/terminate' % (vnfm["type"], vnfm_inst_id, vnf_inst_id)
@@ -40,11 +40,11 @@ def send_nf_terminate_request(vnfm_inst_id, vnf_inst_id, req_param):
         raise NSLCMException('Failed to send nf terminate request to VNFM(%s)' % vnfm_inst_id)
     return json.JSONDecoder().decode(ret[1]) if ret[1] else {}
 
+
 def query_vnfm_job(vnfm_inst_id, job_id, response_id=0):
     vnfm = get_vnfm_by_id(vnfm_inst_id)
     retry_time = 3
-    uri = '/api/%s/v1/%s/jobs/%s?responseId=%s' % (vnfm["type"], 
-        vnfm_inst_id, job_id, response_id)
+    uri = '/api/%s/v1/%s/jobs/%s?responseId=%s' % (vnfm["type"], vnfm_inst_id, job_id, response_id)
     while retry_time > 0:
         rsp = req_by_msb(uri, "GET")
         if str(rsp[2]) == '404':
@@ -59,6 +59,7 @@ def query_vnfm_job(vnfm_inst_id, job_id, response_id=0):
         raise NSLCMException('Failed to query job from VNFM!')
     return True, json.JSONDecoder().decode(rsp[1])
 
+
 def send_nf_scaling_request(vnfm_inst_id, vnf_inst_id, req_param):
     vnfm = get_vnfm_by_id(vnfm_inst_id)
     uri = '/api/%s/v1/%s/vnfs/%s/scale' % (vnfm["type"], vnfm_inst_id, vnf_inst_id)