Project

General

Profile

Bug #40297

cephfs-shell: Produces TypeError on passing '*' pattern to ls, rm or rmdir

Added by Varsha Rao 5 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Source:
Development
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
cephfs-shell
Labels (FS):
Pull request ID:
Crash signature:

Description

CephFS:~/>>> rm *
cannot use a string pattern on a bytes-like object
Traceback (most recent call last):
  File "../src/tools/cephfs/cephfs-shell", line 396, in onecmd
    res = Cmd.onecmd(self, line)
  File "/home/varsha/ceph/build/venv/lib/python3.7/site-packages/cmd2/cmd2.py", line 2050, in onecmd
    stop = func(statement)
  File "/home/varsha/ceph/build/venv/lib/python3.7/site-packages/cmd2/cmd2.py", line 270, in cmd_wrapper
    return func(cmd2_instance, args)
  File "../src/tools/cephfs/cephfs-shell", line 857, in do_rm
    file_path) if is_file_exists(i)])
  File "../src/tools/cephfs/cephfs-shell", line 155, in get_all_possible_paths
    paths.extend(glob(dir_, patterns[0]))
  File "../src/tools/cephfs/cephfs-shell", line 132, in glob
    if fnmatch.fnmatch(i.d_name, pattern):
  File "/home/varsha/ceph/build/venv/lib64/python3.7/fnmatch.py", line 36, in fnmatch
    return fnmatchcase(name, pat)
  File "/home/varsha/ceph/build/venv/lib64/python3.7/fnmatch.py", line 71, in fnmatchcase
    return match(name) is not None
TypeError: cannot use a string pattern on a bytes-like object

History

#1 Updated by Varsha Rao 5 months ago

  • Status changed from New to Need Review
  • Pull request ID set to 28514

#2 Updated by Patrick Donnelly 5 months ago

  • Target version set to v15.0.0
  • Source set to Development
  • Backport set to nautilus

#3 Updated by Varsha Rao 3 months ago

  • Status changed from Need Review to Resolved

Also available in: Atom PDF