summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2017-09-23 14:15:47 +0800
committerFu Jinhua <fu.jinhua@zte.com.cn>2017-09-23 07:14:05 +0000
commit6201aa651f798b4d805c6456220b132c82834d5c (patch)
treef535694fe55b3570271c9cf9632fa7d6c934a382
parente7f5f002d1227e4261c164b75df6f43dcb09bee0 (diff)
Fix pep8 error for vfc-nfvo-lcm/ns/sfcs
Change-Id: I97965a3a3f1dde33356d229b6b884c67e4f9d3b5 Issue-Id: VFC-444 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/ns/sfcs/__init__.py2
-rw-r--r--lcm/ns/sfcs/create_portpairgp.py2
-rw-r--r--lcm/ns/sfcs/create_sfc_worker.py1
-rw-r--r--lcm/ns/sfcs/sfc_instance.py1
-rw-r--r--lcm/ns/sfcs/utils.py8
-rw-r--r--lcm/ns/sfcs/views.py3
6 files changed, 10 insertions, 7 deletions
diff --git a/lcm/ns/sfcs/__init__.py b/lcm/ns/sfcs/__init__.py
index b847fa86..5580cc3d 100644
--- a/lcm/ns/sfcs/__init__.py
+++ b/lcm/ns/sfcs/__init__.py
@@ -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.
diff --git a/lcm/ns/sfcs/create_portpairgp.py b/lcm/ns/sfcs/create_portpairgp.py
index 701adab9..b42cd900 100644
--- a/lcm/ns/sfcs/create_portpairgp.py
+++ b/lcm/ns/sfcs/create_portpairgp.py
@@ -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)
diff --git a/lcm/ns/sfcs/create_sfc_worker.py b/lcm/ns/sfcs/create_sfc_worker.py
index 380fd593..e0c65d61 100644
--- a/lcm/ns/sfcs/create_sfc_worker.py
+++ b/lcm/ns/sfcs/create_sfc_worker.py
@@ -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
diff --git a/lcm/ns/sfcs/sfc_instance.py b/lcm/ns/sfcs/sfc_instance.py
index cb68f8c5..b63b13cb 100644
--- a/lcm/ns/sfcs/sfc_instance.py
+++ b/lcm/ns/sfcs/sfc_instance.py
@@ -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
diff --git a/lcm/ns/sfcs/utils.py b/lcm/ns/sfcs/utils.py
index b6d68cd2..04dd3179 100644
--- a/lcm/ns/sfcs/utils.py
+++ b/lcm/ns/sfcs/utils.py
@@ -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"]
diff --git a/lcm/ns/sfcs/views.py b/lcm/ns/sfcs/views.py
index 1e3f98ff..644dc95a 100644
--- a/lcm/ns/sfcs/views.py
+++ b/lcm/ns/sfcs/views.py
@@ -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")