TritonDataCenter / python-manta

Python SDK for Manta (community maintained)
MIT License
25 stars 18 forks source link

`mantash find DIR -name NAME` with `-name` option crashes with "global name 'fnmatchcase' is not defined" #54

Closed trentm closed 6 years ago

trentm commented 6 years ago
$ mantash find /trent.mick/stor/tmp -name hi*
mantash: ERROR: global name 'fnmatchcase' is not defined (/Users/trentm/joy/python-manta/bin/mantash:1764 in do_find)

Traceback (most recent call last):
  File "/Users/trentm/joy/python-manta/bin/mantash", line 2153, in <module>
    retval = main(sys.argv)
  File "/Users/trentm/joy/python-manta/bin/mantash", line 2147, in main
    return shell.main(argv, loop=cmdln.LOOP_IF_EMPTY)
  File "/Users/trentm/joy/python-manta/manta/cmdln.py", line 266, in main
    return self.cmd(args)
  File "/Users/trentm/joy/python-manta/manta/cmdln.py", line 284, in cmd
    retval = self.onecmd(argv)
  File "/Users/trentm/joy/python-manta/manta/cmdln.py", line 422, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/Users/trentm/joy/python-manta/manta/cmdln.py", line 1109, in _dispatch_cmd
    return handler(argv)
  File "/Users/trentm/joy/python-manta/bin/mantash", line 1764, in do_find
    if not fnmatchcase(base, opts.name):
NameError: global name 'fnmatchcase' is not defined
trentm commented 6 years ago

With the fix:

$ mantash find /trent.mick/stor/tmp -name hi*
/trent.mick/stor/tmp/hi.txt