def process(mod_name, oid_list, opts={}, force=False): proxy_list = [] for server_ip in server_list: proxy_list.append((server_ip, server_port)) oid_list = unpack(oid_list) mod_name = unpack(mod_name) opts = unpack(opts) return pack(mp.multi_map_distrib(proxy_list, mod_name, oid_list, opts, True, force))
def retrieve(mod_name, oid_list, opts={}): proxy_list = [] oid_list = unpack(oid_list) mod_name = unpack(mod_name) opts = unpack(opts) for server_ip in server_list: proxy_list.append((server_ip, server_port)) if not isinstance(oid_list, list): oid_list = [oid_list] new_oid_list = [] for oid in oid_list: if not oxide.exists(mod_name, oid, opts): new_oid_list.append(oid) if new_oid_list: mp.multi_map_distrib(proxy_list, mod_name, new_oid_list, opts) proxy = get_proxy(server_ip, server_port, wrapped=True) return pack(proxy.retrieve(mod_name, oid_list, opts))