Beispiel #1
0
 def __init__(self, server_ip, server_port):
     try:
         self.proxy = client.get_proxy(server_ip, server_port)
         self.oxide = oxide_proxy(self)
         oshell.OxideShell.__init__(self)
         self.scratch_dir = loc_oxide.api.scratch_dir
         
     except socket.error:
         print "ERROR: Unable to connect!"
         exit()
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))