Project

General

Profile

Bug #40292

ceph-cli missing valid command

Added by Chang Liu 10 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

In this scenario, there are some commands of the same length, one of which has one optional argument. At this time, when the command is invoked via `./bin/ceph` without argument, the command cannot be found.

I constructed an example. I add one optional argument `event_id` to `ceph progress` command.

./bin/ceph progress          

no valid command found; 3 closest matches:
progress clear
progress {<event_id>}
progress json
Error EINVAL: invalid command

Here is verbose info

better match: 0.5 > 0.5: restful delete-key <key_name> 
better match: 1.5 > 0.5: progress clear 
better match: 1.5 > 1.5: progress {<event_id>} 
better match: 1.5 > 1.5: progress json 
bestcmds_sorted: 
[{u'flags': 8,
  u'help': u'Reset progress tracking',
  u'module': u'mgr',
  u'perm': u'rw',
  u'sig': [argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, numseen=0, req=True, n=1, prefix=progress),
           argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, numseen=0, req=True, n=1, prefix=clear)]},
 {u'flags': 8,
  u'help': u'Show progress of recovery operations',
  u'module': u'mgr',
  u'perm': u'r',
  u'sig': [argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, numseen=0, req=True, n=1, prefix=progress),
           argdesc(<class 'ceph_argparse.CephString'>, name=event_id, numseen=0, req=False, n=1)]},
 {u'flags': 8,
  u'help': u'Show machine readable progress information',
  u'module': u'mgr',
  u'perm': u'r',
  u'sig': [argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, numseen=0, req=True, n=1, prefix=progress),
           argdesc(<class 'ceph_argparse.CephPrefix'>, name=prefix, numseen=0, req=True, n=1, prefix=json)]}]
no valid command found; 3 closest matches:
progress clear
progress {<event_id>}
progress json
Error EINVAL: invalid command

History

#1 Updated by Chang Liu 10 months ago

  • Status changed from 12 to Fix Under Review
  • Pull request ID set to 28510

#2 Updated by Kefu Chai 10 months ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF