Skip to content

Commit 2d28e14

Browse files
authored
Merge pull request #59005 from neesingh-rh/wip-67300-squid
squid: pybind/ceph_argparse: Fix error message for ceph tell command
2 parents 5126aa0 + 6d28415 commit 2d28e14

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

qa/tasks/cephfs/test_misc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,11 @@ def test_session_ls(self):
522522
def test_client_ls(self):
523523
self._session_client_ls(['client', 'ls'])
524524

525+
def test_ceph_tell_for_unknown_cephname_type(self):
526+
with self.assertRaises(CommandFailedError) as ce:
527+
self.run_ceph_cmd('tell', 'cephfs.c', 'something')
528+
self.assertEqual(ce.exception.exitstatus, 1)
529+
525530

526531
@classhook('_add_session_client_evictions')
527532
class TestSessionClientEvict(CephFSTestCase):
@@ -601,7 +606,7 @@ def test(self):
601606
setattr(cls, 'test_session' + t, create_test(t, ['session']))
602607
setattr(cls, 'test_client' + t, create_test(t, ['client']))
603608

604-
609+
605610
class TestCacheDrop(CephFSTestCase):
606611
CLIENTS_REQUIRED = 1
607612

src/pybind/ceph_argparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,13 @@ def valid(self, s, partial=False):
502502
try:
503503
poolid = int(poolid_s)
504504
except ValueError:
505-
raise ArgumentFormat('pool {0} not integer'.format(poolid))
505+
raise ArgumentFormat('pool {0} not integer'.format(poolid_s))
506506
if poolid < 0:
507507
raise ArgumentFormat('pool {0} < 0'.format(poolid))
508508
try:
509509
pgnum = int(pgnum_s, 16)
510510
except ValueError:
511-
raise ArgumentFormat('pgnum {0} not hex integer'.format(pgnum))
511+
raise ArgumentFormat('pgnum {0} not hex integer'.format(pgnum_s))
512512
self.val = s
513513

514514
def __str__(self):

0 commit comments

Comments
 (0)