Project

General

Profile

Cleanup #59270

Commands that don't take inbuf should error out gracefully

Added by John Mulligan 12 months ago. Updated 10 months ago.

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

0%

Tags:
backport_processed
Backport:
reef
Reviewed:
Affected Versions:
Pull request ID:

Description

An example of a non-graceful error:

# ceph nfs cluster config reset morbo -i /tmp/g 
Error EINVAL: Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1448, in _handle_command
    return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)
  File "/usr/share/ceph/mgr/mgr_module.py", line 414, in call
    return self.func(mgr, **kwargs)
TypeError: _cmd_nfs_cluster_config_reset() got an unexpected keyword argument 'inbuf'

Also seen at:
https://tracker.ceph.com/issues/48663
https://tracker.ceph.com/issues/49790

This is a generic issue with how the ceph cli command and mgr module argument mapper handles the `-i` option specially. It should not be particularly challenging to convert this into a more pleasant and understandable error such as:
"Invalid command: Input file data (-i) not supported"

mimicking the case where an extra regular arg is passed to a cli:

# ceph nfs cluster create    foobar --quux=yes
Invalid command: Unexpected argument '--quux=yes'
nfs cluster create <cluster_id> [<placement>] [--ingress] [<virtual_ip>] [<port:int>] :  Create an NFS Cluster
Error EINVAL: invalid command


Related issues

Copied to mgr - Backport #59634: reef: Commands that don't take inbuf should error out gracefully Resolved

History

#1 Updated by John Mulligan 12 months ago

  • Pull request ID set to 50976

#2 Updated by Adam King 11 months ago

  • Status changed from New to Pending Backport
  • Backport set to reef

#3 Updated by Backport Bot 11 months ago

  • Copied to Backport #59634: reef: Commands that don't take inbuf should error out gracefully added

#4 Updated by Backport Bot 11 months ago

  • Tags set to backport_processed

#5 Updated by Adam King 10 months ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF