Project

General

Profile

Actions

Bug #40292

closed

ceph-cli missing valid command

Added by Chang Liu almost 5 years ago. Updated almost 5 years 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 (v1):
Crash signature (v2):

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

Actions #1

Updated by Chang Liu almost 5 years ago

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

Updated by Kefu Chai almost 5 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF