DIRACGrid/DIRAC — Issue #505: FC CLI: 'meta get ' crashes CLI when called from root directory on a lower-level subdirectory
Author: caitriana
Created: 2012-02-14 01:29:08+00:00
State: open

A strange bug I've noticed in the CLI (v6r2-pre4 and earlier versions).

If I call 'meta get' from the root directory, on any directory more than 1 level down, the CLI crashes as follows:

FC:/>meta get dfc_test/File/psipp/6.5.5/data/all/exp1
Traceback (most recent call last):
File "/panfs/panfs.ihep.ac.cn/home/data/caitriana/dirac/DIRAC/DataManagementSystem/scripts/dirac-dms-filecatalog-cli.py", line 64, in
cli.cmdloop()
File "/panfs/panfs.ihep.ac.cn/home/data/caitriana/dirac/Linux_x86_64_glibc-2.5/lib/python2.6/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/panfs/panfs.ihep.ac.cn/home/data/caitriana/dirac/Linux_x86_64_glibc-2.5/lib/python2.6/cmd.py", line 219, in onecmd
return func(arg)
File "/panfs/panfs.ihep.ac.cn/home/data/caitriana/dirac/DIRAC/DataManagementSystem/Client/FileCatalogClientCLI.py", line 1136, in do_meta
return self.metaGet(argss)
File "/panfs/panfs.ihep.ac.cn/home/data/caitriana/dirac/DIRAC/DataManagementSystem/Client/FileCatalogClientCLI.py", line 1203, in metaGet
dirFlag = not result['Value']['Successful'][path]
KeyError: '//dfc_test/File/psipp/6.5.5/data/all/exp1'

If I first cd into the next-lowest subdirectory and then do the meta get, it's OK:

FC:/> cd dfc_test
FC:/dfc_test>meta get File/psipp/6.5.5/data/all/exp1
!expNum : exp1
!dataType : dst
*eventType : all
*bossVer : 6.5.5
!streamId : stream0
*resonance : psipp

When in the root directory, if a leading / is added to the path, it's OK:

FC:/>meta get /dfc_test/File/psipp/6.5.5/data/all/exp1
!expNum : exp1
!dataType : dst
*eventType : all
*bossVer : 6.5.5
!streamId : stream0
*resonance : psipp

I guess it's something to do with parsing the path when in the root directory?