예제 #1
0
def copy_vessel(longname, newvesselname):

    newhandle = fastnmclient.nmclient_duplicatehandle(
        seash_global_variables.vesselinfo[longname]['handle'])
    newlongname = seash_global_variables.vesselinfo[longname][
        'IP'] + ":" + str(seash_global_variables.vesselinfo[longname]
                          ['port']) + ":" + newvesselname
    add_vessel(newlongname,
               seash_global_variables.vesselinfo[longname]['keyname'],
               newhandle)
    return newlongname
예제 #2
0
def copy_vessel(longname, newvesselname):

    newhandle = fastnmclient.nmclient_duplicatehandle(seash_global_variables.vesselinfo[longname]["handle"])
    newlongname = (
        seash_global_variables.vesselinfo[longname]["IP"]
        + ":"
        + str(seash_global_variables.vesselinfo[longname]["port"])
        + ":"
        + newvesselname
    )
    add_vessel(newlongname, seash_global_variables.vesselinfo[longname]["keyname"], newhandle)
    return newlongname
예제 #3
0
def copy_vessel(longname, newvesselname):

  newhandle = fastnmclient.nmclient_duplicatehandle(seash_global_variables.vesselinfo[longname]['handle'])
  newlongname = seash_global_variables.vesselinfo[longname]['IP']+":"+str(seash_global_variables.vesselinfo[longname]['port'])+":"+newvesselname
  add_vessel(newlongname,seash_global_variables.vesselinfo[longname]['keyname'],newhandle)
  return newlongname
예제 #4
0
  try:
    # need to contact the node to get the list of vessels we can perform
    # actions on...
    ownervessels, uservessels = fastnmclient.nmclient_listaccessiblevessels(nodehandle,seash_global_variables.keys[currentkeyname]['publickey'])

    retlist = []

    # we should add anything we can access (whether a user or owner vessel)
    for vesselname in ownervessels + uservessels:
      longname = host+":"+str(port)+":"+vesselname

      # if we haven't discovered the vessel previously...
      if longname not in seash_global_variables.targets:
        # set the vesselname in the handle
        newhandle = fastnmclient.nmclient_duplicatehandle(nodehandle)
        handleinfo = fastnmclient.nmclient_get_handle_info(newhandle)
        handleinfo['vesselname'] = vesselname
        fastnmclient.nmclient_set_handle_info(newhandle, handleinfo)

        # then add the vessel to the target list, etc.
        # add_vessel has no race conditions as long as longname is unique
        # (and it should be unique)
        id = add_vessel(longname,currentkeyname,newhandle)
        seash_global_variables.targets[targetgroup].append(longname)

        # and append some information to be printed...
        retlist.append('%'+str(id)+"("+longname+")")


예제 #5
0
        # need to contact the node to get the list of vessels we can perform
        # actions on...
        ownervessels, uservessels = fastnmclient.nmclient_listaccessiblevessels(
            nodehandle,
            seash_global_variables.keys[currentkeyname]['publickey'])

        retlist = []

        # we should add anything we can access (whether a user or owner vessel)
        for vesselname in ownervessels + uservessels:
            longname = host + ":" + str(port) + ":" + vesselname

            # if we haven't discovered the vessel previously...
            if longname not in seash_global_variables.targets:
                # set the vesselname in the handle
                newhandle = fastnmclient.nmclient_duplicatehandle(nodehandle)
                handleinfo = fastnmclient.nmclient_get_handle_info(newhandle)
                handleinfo['vesselname'] = vesselname
                fastnmclient.nmclient_set_handle_info(newhandle, handleinfo)

                # then add the vessel to the target list, etc.
                # add_vessel has no race conditions as long as longname is unique
                # (and it should be unique)
                id = add_vessel(longname, currentkeyname, newhandle)
                seash_global_variables.targets[targetgroup].append(longname)

                # and append some information to be printed...
                retlist.append('%' + str(id) + "(" + longname + ")")

    finally:
        fastnmclient.nmclient_destroyhandle(nodehandle)