From: Michael Fritch Date: Wed, 11 Mar 2020 01:28:30 +0000 (-0600) Subject: cephadm: consolidate logic for reading `config-json` X-Git-Tag: v15.1.1~30^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd0fa0c46c716b4b696a05e4d1202ab6528500e4;p=ceph.git cephadm: consolidate logic for reading `config-json` logic for reading `--config-json` from stdin or file was duplicated Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 396f7b3dffe..af2b3ea2419 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1125,15 +1125,7 @@ def get_parm(option): def get_config_and_keyring(): # type: () -> Tuple[str, str] if 'config_json' in args and args.config_json: - if args.config_json == '-': - try: - j = injected_stdin # type: ignore - except NameError: - j = sys.stdin.read() - else: - with open(args.config_json, 'r') as f: - j = f.read() - d = json.loads(j) + d = get_parm(args.config_json) config = d.get('config') keyring = d.get('keyring') else: