Commit ac440be5 authored by Roland Haas's avatar Roland Haas
Browse files

use BW Duo endpoint

parent 7c19a1e5
......@@ -41,14 +41,14 @@ import globustransferhelper as globushl
helper = globushl.GlobusTransferHelper()
# activate endpoints
success = helper.endpoint_autoactivate(globushl.EP_BLUEWATERS)
success = helper.endpoint_autoactivate(globushl.EP_BLUEWATERS_DUO)
print("Activated BlueWaters: {0}".format(success))
success = helper.endpoint_autoactivate(globushl.EP_NEARLINE)
print("Activated Nearline: {0}".format(success))
# show the content of your $HOME on BlueWaters
print("Your $HOME contains (down to 2 levels):")
files = helper.ls(globushl.EP_BLUEWATERS, "~", depth=2)
files = helper.ls(globushl.EP_BLUEWATERS_DUO, "~", depth=2)
for file in files:
print("%s (%s) [%d bytes]" % \
(file, files[file]['type'], files[file]['size']))
......@@ -61,7 +61,7 @@ with open(foxfile, "w") as fh:
# copy to Nearline
nearline_foxfile = "~/foxfile"
print("Copying %s to Nearline %s" % (foxfile, nearline_foxfile))
transfer = helper.transfer(globushl.EP_BLUEWATERS, globushl.EP_NEARLINE,
transfer = helper.transfer(globushl.EP_BLUEWATERS_DUO, globushl.EP_NEARLINE,
[(foxfile, nearline_foxfile)], synchronous=True)
print("done")
......@@ -69,7 +69,7 @@ print("done")
houndfile = "%s/%s-houndfile" % (os.getcwd(), os.environ["USER"])
harefile = "%s/%s-harefile" % (os.getcwd(), os.environ["USER"])
print("Copying %s to BlueWaters %s and %s" % (foxfile, houndfile, harefile))
transfer = helper.transfer(globushl.EP_BLUEWATERS, globushl.EP_BLUEWATERS,
transfer = helper.transfer(globushl.EP_BLUEWATERS_DUO, globushl.EP_BLUEWATERS_DUO,
[(foxfile, houndfile), (foxfile, harefile)])
helper.task_wait(transfer)
with open(houndfile, "r") as fh:
......@@ -82,15 +82,15 @@ kennel_houndfile = os.path.join(kenneldir, os.path.split(houndfile)[-1])
kennel_foxfile = os.path.join(kenneldir, os.path.split(foxfile)[-1])
print("Moving %s, and %s into %s" % (foxfile,houndfile,kenneldir))
os.mkdir(kenneldir)
helper.rename(globushl.EP_BLUEWATERS, houndfile, kennel_houndfile)
helper.rename(globushl.EP_BLUEWATERS, foxfile, kennel_foxfile)
files = helper.ls(globushl.EP_BLUEWATERS, kenneldir)
helper.rename(globushl.EP_BLUEWATERS_DUO, houndfile, kennel_houndfile)
helper.rename(globushl.EP_BLUEWATERS_DUO, foxfile, kennel_foxfile)
files = helper.ls(globushl.EP_BLUEWATERS_DUO, kenneldir)
print(list(files.keys()))
# get rid of files
print("Removing files")
delete1 = helper.delete(globushl.EP_NEARLINE, nearline_foxfile)
delete2 = helper.delete(globushl.EP_BLUEWATERS, [harefile, kenneldir], recursive=True)
delete2 = helper.delete(globushl.EP_BLUEWATERS_DUO, [harefile, kenneldir], recursive=True)
print("Success: %s, %s" % (delete1['status'], delete2['status']))
print("All done")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment