Skip to content

Commit

Permalink
control/cli.py: read server-address/port defaults from env
Browse files Browse the repository at this point in the history
"--server-address" defaults to env variable
CEPH_NVMEOF_SERVER_ADDRESS (otherwise "localhost").

"--server-port" defaults to env variable
CEPH_NVMEOF_SERVER_PORT (otherwise 5500).

This is to avoid repetitive inputs. If these
environment variables are set, we can just do:
`ceph-nvmeof gw info`.
(instead of current `ceph-nvmeof --server-address /
$NVMEOF_SERVER_ADDRESS --server-port /
$NVMEOF_SERVER_PORT gw info`)

Signed-off-by: Vallari Agrawal <[email protected]>
  • Loading branch information
VallariAg committed Jul 11, 2024
1 parent 4c5d7a3 commit 58eb615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ def __init__(self):
required=False)
self.parser.add_argument(
"--server-address",
default="localhost",
default=(os.getenv('CEPH_NVMEOF_SERVER_ADDRESS') or "localhost"),
type=str,
help="Server address",
)
self.parser.add_argument(
"--server-port",
default=5500,
default=(os.getenv('CEPH_NVMEOF_SERVER_PORT') or 5500),
type=int,
help="Server port",
)
Expand Down

0 comments on commit 58eb615

Please sign in to comment.