diff options
author | fengyuanxing <feng.yuanxing@zte.com.cn> | 2018-03-08 10:45:41 +0800 |
---|---|---|
committer | fengyuanxing <feng.yuanxing@zte.com.cn> | 2018-03-08 11:26:58 +0800 |
commit | 70b029f5667ca98148569cf73d9d8a6afdf69b13 (patch) | |
tree | a9aa795ae10b3ea1654e33d99ad2ca5d776dc8ec | |
parent | 8dce5d50cab3ebde178a21b044b3b5f668f9bbca (diff) |
Add error logs for null scaling info
Change-Id: I89e59a41a6d2d939beef5ae1719c1242f29294f3
Issue-ID: VFC-784
Signed-off-by: fengyuanxing <feng.yuanxing@zte.com.cn>
-rw-r--r-- | lcm/pub/utils/scaleaspect.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lcm/pub/utils/scaleaspect.py b/lcm/pub/utils/scaleaspect.py index 94c349e9..ff65f702 100644 --- a/lcm/pub/utils/scaleaspect.py +++ b/lcm/pub/utils/scaleaspect.py @@ -85,8 +85,12 @@ def get_vnf_instance_id_list(vnfd_id): nf_model_list = NfInstModel.objects.filter(**kwargs) vnf_instance_id_list = list() - for i in range(nf_model_list.__len__()): - vnf_instance_id_list.append(nf_model_list[i].nfinstid) + nf_model_len = nf_model_list.__len__() + if nf_model_len == 0: + logger.error("No VNF instances found(vnfd_id=%s)" % vnfd_id) + else: + for i in range(nf_model_len): + vnf_instance_id_list.append(nf_model_list[i].nfinstid) return vnf_instance_id_list @@ -202,6 +206,7 @@ def get_scale_vnf_data_from_json(scalingmap_json, nsd_id, aspect, step): return vnf_scale_info_list + logger.error("get_scale_vnf_data_from_json method retuan null") return None |