self.assertEqual(stats['subdirs'], 1)
self.rm_dir('/animal')
+
+ def test_cephfs_clients_get_after_mds_down(self):
+ fs_id = self.get_fs_id()
+ self._get(f"/api/cephfs/{fs_id}/clients")
+ self.assertStatus(200)
+
+ self.fs.fail()
+ params = {'suppress_client_ls_errors': 'False'}
+ self._get(f"/api/cephfs/{fs_id}/clients", params=params)
+ self.assertStatus(500)
+
+ self.fs.set_joinable()
+ self._get(f"/api/cephfs/{fs_id}/clients")
+ self.assertStatus(200)
if (role_r == 0) {
// We got a role, resolve it to a GID
const auto& mdsmap = fsmap->get_filesystem(role.fscid).get_mds_map();
+ if (mdsmap.is_down(role.rank)) {
+ lderr(cct) << __func__ << ": targets rank: " << role.rank
+ << " is down" << dendl;
+ return -CEPHFS_EAGAIN;
+ }
auto& info = mdsmap.get_info(role.rank);
ldout(cct, 10) << __func__ << ": resolved " << mds_spec << " to role '"
<< role << "' aka " << info.human_name() << dendl;
# -*- coding: utf-8 -*-
+# pylint: disable=too-many-lines
import errno
import json
import logging
if flag not in ('True', 'False'):
raise DashboardException(msg='suppress_client_ls_errors value '
'needs to be either True or False '
- f'but provided {flag}',
+ f'but provided "{flag}"',
component='cephfs')
fs_id = self.fs_id_to_int(fs_id)