Merge PR #51332 into main

* refs/pull/51332/head:
	qa: add test for ceph tell with unknown cephtype
	pybind/ceph_argparse: fixing error message for ceph tell command

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Rishabh Dave <ridave@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Venky Shankar 2024-08-01 12:19:52 +05:30
commit f4b5465815
2 changed files with 8 additions and 3 deletions

View File

@ -522,6 +522,11 @@ class TestMisc(CephFSTestCase):
def test_client_ls(self):
self._session_client_ls(['client', 'ls'])
def test_ceph_tell_for_unknown_cephname_type(self):
with self.assertRaises(CommandFailedError) as ce:
self.run_ceph_cmd('tell', 'cephfs.c', 'something')
self.assertEqual(ce.exception.exitstatus, 1)
@classhook('_add_session_client_evictions')
class TestSessionClientEvict(CephFSTestCase):
@ -599,7 +604,7 @@ class TestSessionClientEvict(CephFSTestCase):
setattr(cls, 'test_session' + t, create_test(t, ['session']))
setattr(cls, 'test_client' + t, create_test(t, ['client']))
class TestCacheDrop(CephFSTestCase):
CLIENTS_REQUIRED = 1

View File

@ -502,13 +502,13 @@ class CephPgid(CephArgtype):
try:
poolid = int(poolid_s)
except ValueError:
raise ArgumentFormat('pool {0} not integer'.format(poolid))
raise ArgumentFormat('pool {0} not integer'.format(poolid_s))
if poolid < 0:
raise ArgumentFormat('pool {0} < 0'.format(poolid))
try:
pgnum = int(pgnum_s, 16)
except ValueError:
raise ArgumentFormat('pgnum {0} not hex integer'.format(pgnum))
raise ArgumentFormat('pgnum {0} not hex integer'.format(pgnum_s))
self.val = s
def __str__(self):