Allow bypassing confirm message for benchmarks

This commit is contained in:
Joshua Boniface 2021-12-23 21:00:42 -05:00
parent d68f6a945e
commit be1b67b8f0
1 changed files with 18 additions and 9 deletions

View File

@ -3178,12 +3178,21 @@ def ceph_benchmark():
# pvc storage benchmark run
###############################################################################
@click.command(name="run", short_help="Run a storage benchmark.")
@click.option(
"-y",
"--yes",
"confirm_flag",
is_flag=True,
default=False,
help="Confirm the run",
)
@click.argument("pool")
@cluster_req
def ceph_benchmark_run(pool):
def ceph_benchmark_run(confirm_flag, pool):
"""
Run a storage benchmark on POOL in the background.
"""
if not confirm_flag and not config["unsafe"]:
try:
click.confirm(
"NOTE: Storage benchmarks take approximately 10 minutes to run and generate significant load on the cluster; they should be run sparingly. Continue",