コード例 #1
0
ファイル: nas_qos_wred.py プロジェクト: GarrickHe/opx-nas-qos
 def get_npu_list(self):
     cps_obj = utl.extract_cps_obj(self.data())
     path = utl.name_to_path(self.yang_name, 'npu-id-list')
     if path not in cps_obj:
         return None
     cps_id_list = cps_obj[path]
     npu_id_list = []
     for npu_id in cps_id_list:
         val = ba_utils.from_ba(npu_id, 'uint32_t')
         npu_id_list.append(val)
     return npu_id_list
コード例 #2
0
 def get_npu_list(self):
     cps_obj = utl.extract_cps_obj(self.data())
     path = utl.name_to_path(self.yang_name, 'npu-id-list')
     if path not in cps_obj:
         return None
     cps_id_list = cps_obj[path]
     npu_id_list = []
     for npu_id in cps_id_list:
         val = ba_utils.from_ba(npu_id, 'uint32_t')
         npu_id_list.append(val)
     return npu_id_list
コード例 #3
0
 def add_npu_to_list(self, npu_id):
     cps_obj = utl.extract_cps_obj(self.data())
     ba = ba_utils.to_ba(npu_id, 'uint32_t')
     if ba is None:
         print 'Failed to convert npu_id to bytearray'
         return False
     path = utl.name_to_path(self.yang_name, 'npu-id-list')
     if path not in cps_obj:
         cps_obj[path] = [ba]
     else:
         cps_obj[path].append(ba)
     return True
コード例 #4
0
ファイル: nas_qos_wred.py プロジェクト: GarrickHe/opx-nas-qos
 def add_npu_to_list(self, npu_id):
     cps_obj = utl.extract_cps_obj(self.data())
     ba = ba_utils.to_ba(npu_id, 'uint32_t')
     if ba is None:
         print 'Failed to convert npu_id to bytearray'
         return False
     path = utl.name_to_path(self.yang_name, 'npu-id-list')
     if path not in cps_obj:
         cps_obj[path] = [ba]
     else:
         cps_obj[path].append(ba)
     return True