Skip to content
Snippets Groups Projects
Commit 80e0b332 authored by Yan Grange's avatar Yan Grange :wave:
Browse files

Fixed pathlist to only show needed bits

parent e2c8099a
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ def data_parser(filedata, scope='lofar'): ...@@ -10,7 +10,7 @@ def data_parser(filedata, scope='lofar'):
meta = {} meta = {}
if not len(filedata[-1].strip()): if not len(filedata[-1].strip()):
filedata.pop() filedata.pop()
for idx in range(0,len(filedata),18): for idx in range(lsblocklength,len(filedata),lsblocklength): # skip first because that is the dir itself
fileprops = filedata[idx].strip().split() fileprops = filedata[idx].strip().split()
nbytes = int(fileprops[0].strip()) nbytes = int(fileprops[0].strip())
pth = fileprops[1] pth = fileprops[1]
...@@ -40,8 +40,8 @@ for frompath in filepaths: ...@@ -40,8 +40,8 @@ for frompath in filepaths:
tosubpath = rdt.path(scope,fname) tosubpath = rdt.path(scope,fname)
from_address = "/".join([srm_root_host, frompath]) from_address = "/".join([srm_root_host, frompath])
to_address = "/".join([rucio_rse_rootdir, tosubpath]) to_address = "/".join([rucio_rse_rootdir, tosubpath])
topaths.append(to_address) topaths.append(tosubpath[len(scope)+1:]) # strip off scope and slash
move_commands.append("srmmv {src} {tgt}".format(src=from_address, tgt=to_address)) move_commands.append("srmmv {src} {tgt}\n".format(src=from_address, tgt=to_address))
with open("data_movescript.sh", 'w') as dms: with open("data_movescript.sh", 'w') as dms:
dms.writelines(move_commands) dms.writelines(move_commands)
......
...@@ -5,7 +5,7 @@ import cPickle as pickle ...@@ -5,7 +5,7 @@ import cPickle as pickle
# step 4: Add replicas for files using rucio.client.replicaclient the ReplicaClient class (add_replicas) # step 4: Add replicas for files using rucio.client.replicaclient the ReplicaClient class (add_replicas)
with open("datapaths.pck", "rb") as pathfile: with open("datapaths.pck", "rb") as pathfile:
data_paths = pickle.load(pathfile) data_paths = pickle.load(pathfile)
print(data_paths[2])
# step 4: Add dataset for each observation, add the files to the dataset # step 4: Add dataset for each observation, add the files to the dataset
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment