MCPcopy Create free account
hub / github.com/ceph/ceph / _parse_args

Function _parse_args

src/cephadm/cephadm.py:5671–5689  ·  view source on GitHub ↗
(av: List[str])

Source from the content-addressed store, hash-verified

5669
5670
5671def _parse_args(av: List[str]) -> argparse.Namespace:
5672 parser = _get_parser()
5673
5674 args = parser.parse_args(av)
5675 if 'command' in args and args.command and args.command[0] == '--':
5676 args.command.pop(0)
5677
5678 # workaround argparse to deprecate the subparser `--container-init` flag
5679 # container_init and no_container_init must always be mutually exclusive
5680 container_init_args = ('--container-init', '--no-container-init')
5681 if set(container_init_args).issubset(av):
5682 parser.error('argument %s: not allowed with argument %s' % (container_init_args))
5683 elif '--container-init' in av:
5684 args.no_container_init = not args.container_init
5685 else:
5686 args.container_init = not args.no_container_init
5687 assert args.container_init is not args.no_container_init
5688
5689 return args
5690
5691
5692def cephadm_init_ctx(args: List[str]) -> CephadmContext:

Callers 1

cephadm_init_ctxFunction · 0.85

Calls 5

_get_parserFunction · 0.85
setFunction · 0.50
parse_argsMethod · 0.45
popMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected