Project

General

Profile

Actions

Bug #40297

closed

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

Added by Varsha Rao almost 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% 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 (v1):
Crash signature (v2):

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
Actions #1

Updated by Varsha Rao almost 5 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 28514
Actions #2

Updated by Patrick Donnelly almost 5 years ago

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

Updated by Varsha Rao over 4 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF