(av: List[str])
| 5669 | |
| 5670 | |
| 5671 | def _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 | |
| 5692 | def cephadm_init_ctx(args: List[str]) -> CephadmContext: |
no test coverage detected