Fix pep8 error for vfc-nfvo-lcm/ns/sfcs 05/14805/2
authorfujinhua <fu.jinhua@zte.com.cn>
Sat, 23 Sep 2017 06:15:47 +0000 (14:15 +0800)
committerFu Jinhua <fu.jinhua@zte.com.cn>
Sat, 23 Sep 2017 07:14:05 +0000 (07:14 +0000)
Change-Id: I97965a3a3f1dde33356d229b6b884c67e4f9d3b5
Issue-Id: VFC-444
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/ns/sfcs/__init__.py
lcm/ns/sfcs/create_portpairgp.py
lcm/ns/sfcs/create_sfc_worker.py
lcm/ns/sfcs/sfc_instance.py
lcm/ns/sfcs/utils.py
lcm/ns/sfcs/views.py

index b847fa8..5580cc3 100644 (file)
@@ -10,4 +10,4 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
-# limitations under the License.
\ No newline at end of file
+# limitations under the License.
index 701adab..b42cd90 100644 (file)
@@ -109,7 +109,7 @@ class CreatePortPairGroup(object):
         vnf_inst_database_info = NfInstModel.objects.filter(vnf_id=self.vnf_model_in_ns_info["vnf_id"],
                                                             ns_inst_id=self.ns_inst_id).get()
         self.vnf_inst_database_info = vnf_inst_database_info
-        logger.info("VNFD MODEL : %s" %vnf_inst_database_info.vnfd_model)
+        logger.info("VNFD MODEL : %s" % vnf_inst_database_info.vnfd_model)
         vnfd_model_info = json.loads(vnf_inst_database_info.vnfd_model)
         # vnfd_model_info = json.dumps(vnf_inst_database_info.vnfd_model)
         # vnfd_model_info = json.dumps(self.vnf_inst_database_info.vnfd_model)
index 380fd59..e0c65d6 100644 (file)
@@ -20,7 +20,6 @@ from threading import Thread
 from lcm.ns.sfcs.create_flowcla import CreateFlowClassifier
 from lcm.ns.sfcs.create_port_chain import CreatePortChain
 from lcm.ns.sfcs.create_portpairgp import CreatePortPairGroup
-from lcm.ns.sfcs.sfc_instance import SfcInstance
 from lcm.ns.sfcs.utils import update_fp_status
 from lcm.pub.exceptions import NSLCMException
 from lcm.pub.utils.jobutil import JobUtil
index cb68f8c..b63b13c 100644 (file)
@@ -86,7 +86,6 @@ class SfcInstance(object):
             "fpinstid": self.fp_inst_id
         }
 
-
     def update_vnfffg_info(self):
         vnffg_database_info = VNFFGInstModel.objects.filter(vnffginstid=self.vnffg_inst_id).get()
         fp_inst_list = vnffg_database_info.fplist
index b6d68cd..04dd317 100644 (file)
@@ -33,19 +33,23 @@ def ignorcase_get(args, key):
             return args[oldkey]
     return ""
 
+
 def ignor_dot(str):
     index = str.find('.')
     if index == -1:
-        return str;
+        return str
     return str[0:index]
 
+
 def get_fp_id(fpindex,ns_model):
-    index = int(int(float(fpindex))-1)
+    index = int(int(float(fpindex)) - 1)
     return ns_model['fps'][index].get("fp_id")
 
+
 def update_fp_status(fp_inst_id,status_info):
     FPInstModel.objects.filter(fpinstid=fp_inst_id).update(status=status_info)
 
+
 def get_fp_model_by_fp_inst_id(ns_model_data, fp_inst_id):
     fp_databas_info = FPInstModel.objects.filter(fpinstid=fp_inst_id).get()
     fps_model = ns_model_data["fps"]
index 1e3f98f..644dc95 100644 (file)
@@ -85,6 +85,7 @@ class SfcView(APIView):
             logger.info("service_function_chain_fpindex : %s" % ignorcase_get(request.data, 'fpindex'))
             ns_model_data = request.data['context']
         except Exception as e:
+            logger.error("Exception occurs: %s", e.message)
             logger.error(traceback.format_exc())
         data = {
             'nsinstid': ignorcase_get(request.data, 'nsinstanceid'),
@@ -99,7 +100,7 @@ class SfcView(APIView):
         worker = CreateSfcWorker(data)
         job_id = worker.init_data()
         worker.start()
-        logger.info("Service Function Chain Thread Sleep start : %s" %time.ctime())
+        logger.info("Service Function Chain Thread Sleep start : %s" % time.ctime())
         time.sleep(2)
         logger.info("Service Function Chain Thread Sleep end: %s" % time.ctime())
         logger.info("Create Service Function Chain end")