Skip to content

Commit

Permalink
cli: Improve server-address/port help message
Browse files Browse the repository at this point in the history
Mention about using "CEPH_NVMEOF_SERVER_ADDRESS"
and "CEPH_NVMEOF_SERVER_PORT" env variables in
help output (ceph-nvmeof --help).

Also fix README instructions for using these in containers.

Signed-off-by: Vallari Agrawal <[email protected]>
  • Loading branch information
VallariAg committed Jul 26, 2024
1 parent 8cbac78 commit ffc8022
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,16 @@ The same configuration can also be manually run:
These can also be run by setting environment variables `CEPH_NVMEOF_SERVER_ADDRESS` and `CEPH_NVMEOF_SERVER_PORT` before running nvmeof-cli commands, example:
```
export CEPH_NVMEOF_SERVER_ADDRESS=x.x.x.x
export CEPH_NVMEOF_SERVER_PORT=5500
cat <<EOF > /etc/ceph/nvmeof-cli.env
CEPH_NVMEOF_SERVER_ADDRESS=x.x.x.x
CEPH_NVMEOF_SERVER_PORT=5500
EOF
// using containers
docker-compose run --it <container_image> subsystem add --subsystem nqn.2016-06.io.spdk:cnode1
docker-compose run --env-file /etc/ceph/nvmeof-cli.env -it <container_image> subsystem add --subsystem nqn.2016-06.io.spdk:cnode1
// using pypi package
source /etc/ceph/nvmeof-cli.env
ceph-nvmeof subsystem add --subsystem nqn.2016-06.io.spdk:cnode1
```
Expand Down
4 changes: 2 additions & 2 deletions control/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ def __init__(self):
"--server-address",
default=(os.getenv('CEPH_NVMEOF_SERVER_ADDRESS') or "localhost"),
type=str,
help="Server address",
help="Server address (default: CEPH_NVMEOF_SERVER_ADDRESS env variable or 'localhost')",
)
self.parser.add_argument(
"--server-port",
default=int(os.getenv('CEPH_NVMEOF_SERVER_PORT') or "5500"),
type=int,
help="Server port",
help="Server port (default: CEPH_NVMEOF_SERVER_PORT env variable or '5500')",
)
self.parser.add_argument(
"--client-key",
Expand Down

0 comments on commit ffc8022

Please sign in to comment.