SeattleTestbed / nodemanager

Remote control server for SeattleTestbed nodes
MIT License
0 stars 10 forks source link

nmclient_createhandle has a bug with trying to access a non-existent file. #50

Closed choksi81 closed 10 years ago

choksi81 commented 10 years ago

While doing some testing, I found that the function nmclient_handle() in nmclient.repy tries to open a file called 'advertised_name', which does not exist. This is causing problem and causing repy files to fail when accessing nodemanagers on local machine.

The lines in nmclient_createhandle thats causing grief are:

def nmclient_createhandle(nmIP, nmport, sequenceid = None, timestamp=True, identity = True, expirationtime = 60*60, publickey = None, privatekey = None, vesselid = None, timeout=15):

  # If nmIP is the same as the current IP, we know that we're testing
  # nmclient. First, we don't run the node manager and the nmclient on the same
  # machine under normal operations. Second, all the components communicate
  # using shim's naming system, rather than IP. During testing, we need to
  # translate the IP into the advertised name of the node manager, which is
  # stored in a file called 'advertised_name'. Added by Danny Yuxing Huang to
  # facilitate the evaluation and deployment of shims.
  if nmIP == getmyip():
    fileobj = open('advertised_name', 'r')
    (nmIP, nmport) = fileobj.read().strip().split(':')
    nmport = int(nmport)
    fileobj.close()

It looks like this was the modified nmclient.repy from the Shim implementation. In the comment it says that the file stores the ip of the machine, but the file doesn't seem to be created.