From 115b3d7b7f3b4cf4149240fc14e374697a7cd6b1 Mon Sep 17 00:00:00 2001 From: Maran Hidskes Date: Mon, 13 Apr 2020 10:20:57 +0200 Subject: [PATCH] cephadm: warn when no valid version arguments are supplied to add-repo Currently add-repo will add a broken repository by default, this commit gives a pretty error to instruct the user to use one of the version arguments. Fixes #45029 Signed-off-by: Maran Hidskes --- src/cephadm/cephadm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 2c34d6e5f2c..33d09cb9f1b 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3975,6 +3975,8 @@ def create_packager(stable=None, version=None, branch=None, commit=None): def command_add_repo(): if args.version and args.release: raise Error('you can specify either --release or --version but not both') + if not args.version and not args.release and not args.dev and not args.dev_commit: + raise Error('please supply a --release, --version, --dev or --dev-commit argument') if args.version: try: (x, y, z) = args.version.split('.')