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