dirs = []
for i in all_items:
for item in list_items(dir_path):
- d_name = item.d_name.decode('utf-8')
+ d_name = item.d_name
if os.path.basename(i) == d_name:
if item.is_dir():
dirs.append(os.path.join(dir_path, d_name))
except libcephfs.Error:
cephfs.unlink(to_bytes(path))
if not is_pattern and dir_path != os.path.normpath(path):
- cephfs.rmdir(to_bytes(dir_path))
+ try:
+ cephfs.rmdir(to_bytes(dir_path))
+ except:
+ self.poutput('error: no such directory "%s"' % dir_path)
def complete_rm(self, text, line, begidx, endidx):
"""