X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=qaapi%2Fqa%2Ftests%2Fslice%2Fnmapitest.py;fp=qaapi%2Fqa%2Ftests%2Fslice%2Fnmapitest.py;h=023629b7c990ce28098ae64a4f145760fb08c308;hb=d551ff8e28e3d55302256a0c962829d1addd4dee;hp=3c5df41d053b0d8ce84e24451a8fcd4f6e8730fa;hpb=5ea146eb2a3f267f390b46433d9ee4e36b199254;p=tests.git diff --git a/qaapi/qa/tests/slice/nmapitest.py b/qaapi/qa/tests/slice/nmapitest.py index 3c5df41..023629b 100755 --- a/qaapi/qa/tests/slice/nmapitest.py +++ b/qaapi/qa/tests/slice/nmapitest.py @@ -5,14 +5,15 @@ # Author: acb@cs.princeton.edu/sapanb@cs.princeton.edu import sys +import os from xmlrpclib import ServerProxy -if (len(sys.argv)!=2): - print "[FAILED] Please pass the name of the slice this script runs in as the first argument.\n"; -else: - nodemanager = ServerProxy('http://127.0.0.1:812/') - try: - nodemanager.SetLoans(sys.argv[1], []) - except: - print "[FAILED] SetLoans didn't work, probably because the packets of this connection are not getting tagged.\n"; +homedir=os.environ['HOME'] +slice_name = homedir.rsplit('/')[0] + +nodemanager = ServerProxy('http://127.0.0.1:812/') +try: + nodemanager.SetLoans(slice_name, []) +except: + print "[FAILED] SetLoans didn't work, probably because the packets of this connection are not getting tagged.\n";