Bug #62693
openUpdate nvme gw cli usage with proper entities
0%
Description
Currently, nvme-cli usage reports "python3 -m control.cli" in it and also help [-h] command reports the same. this is incorrect incase of container/orchestration support.
This is applicable to all creation/deletion of NVMeOFGW components like bdev, NS, subsystem
# podman run quay.io/ceph/nvmeof-cli:0.0.2 --server-address 10.0.209.219 --server-port 5500 add_namespace -h
usage: python3 -m control.cli add_namespace [-h] -n SUBNQN -b BDEV [-i NSID]Adds a namespace to a subsystem.optional arguments: -h, --help show this help message and exit -n SUBNQN, --subnqn SUBNQN Subsystem NQN -b BDEV, --bdev BDEV Bdev name -i NSID, --nsid NSID Namespace ID
[root@ceph-nvmf1-g4htpa-node5 cephuser]# podman run -it quay.io/ceph/nvmeof-cli:0.0.2 --server-address 10.0.209.219 --server-port 5500 get_subsystems -h
usage: python3 -m control.cli get_subsystems [-h]
Gets subsystems.
optional arguments:
-h, --help show this help message and exit
[root@ceph-nvmf1-g4htpa-node5 cephuser]# podman run -it quay.io/ceph/nvmeof-cli:0.0.2 --server-address 10.0.209.219 --server-port 5500 create_bdev
usage: python3 -m control.cli create_bdev [-h] -i IMAGE -p POOL [-b BDEV] [-s BLOCK_SIZE]python3 -m control.cli create_bdev: error: the following arguments are required: -i/--image, -p/--pool
[root@ceph-2sunilkumar-ebqdit-node6 ~]# podman run -it quay.io/ceph/nvmeof-cli:0.0.2 sh
usage: python3 -m control.cli [-h] [--server-address SERVER_ADDRESS] [--server-port SERVER_PORT] [--client-key CLIENT_KEY] [--client-cert CLIENT_CERT] [--server-cert SERVER_CERT]
{create_bdev,delete_bdev,create_subsystem,delete_subsystem,add_namespace,remove_namespace,add_host,remove_host,create_listener,delete_listener,get_subsystems} ...python3 -m control.cli: error: argument subcommand: invalid choice: 'sh' (choose from 'create_bdev', 'delete_bdev', 'create_subsystem', 'delete_subsystem', 'add_namespace', 'remove_namespace', 'add_host', 'remove_host', 'create_listener', 'delete_listener', 'get_subsystems')
Expectation is like - usage should not report "control" module with "python3 -m control.cli"
Updated by Rahul Lepakshi 8 months ago
github issue for dealing nvmeof cli issues - https://github.com/ceph/ceph-nvmeof/issues/212
Updated by Ernesto Puerta 5 months ago
Hey Rahul,
What's the issue here? Containers usually wrap the main command under the ENTRYPOINT, and the arguments as CMD. You can see that here:
CMD []
ENTRYPOINT ["python3" "-m" "control.cli"]
That way, users of the container don't have to write the whole podman run ... python3 -m control.cli --server-address ...
, but just pass the arguments. This was made this way for the sake of user-friendliness, but if that's too counterintuitive, we can simply force users to specify the whole python3 -m control.cli
line. Would that address your concern?