Skip to content

Commit

Permalink
Clean up arg name and remove lying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jul 16, 2019
1 parent d0d479c commit f44354e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions synapse/config/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,36 +266,34 @@ def add_arguments_to_parser(cls, config_parser):
" Defaults to the directory containing the last config file",
)

# We can only invoke `add_arguments` on an actual object, but
# `add_arguments` should be side effect free so this is probably fine.
cls.invoke_all_static("add_arguments", config_parser)

@classmethod
def load_config_with_parser(cls, config_parser, argv):
def load_config_with_parser(cls, parser, argv):
"""Parse the commandline and config files with the given parser
Doesn't support config-file-generation: used by the worker apps.
Used for workers where we want to add extra flags/subcommands.
Args:
config_parser (ArgumentParser)
parser (ArgumentParser)
argv (list[str])
Returns:
tuple[HomeServerConfig, argparse.Namespace]: Returns the parsed
config object and the parsed argparse.Namespace object from
`config_parser.parse_args(..)`
`parser.parse_args(..)`
"""

obj = cls()

config_args = config_parser.parse_args(argv)
config_args = parser.parse_args(argv)

config_files = find_config_files(search_paths=config_args.config_path)

if not config_files:
config_parser.error("Must supply a config file.")
parser.error("Must supply a config file.")

if config_args.keys_directory:
config_dir_path = config_args.keys_directory
Expand Down

0 comments on commit f44354e

Please sign in to comment.