Пример #1
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
Пример #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
 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