diff options
Diffstat (limited to 'buildscripts/resmokelib/multiversion/__init__.py')
| -rw-r--r-- | buildscripts/resmokelib/multiversion/__init__.py | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/buildscripts/resmokelib/multiversion/__init__.py b/buildscripts/resmokelib/multiversion/__init__.py index 7160d1ff026..2c9bae45766 100644 --- a/buildscripts/resmokelib/multiversion/__init__.py +++ b/buildscripts/resmokelib/multiversion/__init__.py @@ -1,5 +1,4 @@ """Subcommand for multiversion config.""" -import argparse from typing import List, Optional import yaml @@ -37,19 +36,10 @@ class MultiversionConfig(BaseModel): class MultiversionConfigSubcommand(Subcommand): """Subcommand for discovering multiversion configuration.""" - def __init__(self, options: argparse.Namespace) -> None: - """Initialize the class.""" - self.config_file_output = options.config_file_output - def execute(self): """Execute the subcommand.""" mv_config = self.determine_multiversion_config() - yaml_output = yaml.safe_dump(mv_config.dict()) - print(yaml_output) - - if self.config_file_output: - with open(self.config_file_output, "w") as file: - file.write(yaml_output) + print(yaml.safe_dump(mv_config.dict())) @staticmethod def determine_multiversion_config() -> MultiversionConfig: @@ -59,14 +49,14 @@ class MultiversionConfigSubcommand(Subcommand): mongo_version=MongoVersion.from_yaml_file(multiversionconstants.MONGO_VERSION_YAML), mongo_releases=MongoReleases.from_yaml_file(multiversionconstants.RELEASES_YAML), ) - version_constants = multiversion_service.calculate_version_constants() + fcv_constants = multiversion_service.calculate_fcv_constants() return MultiversionConfig( last_versions=multiversionconstants.OLD_VERSIONS, - requires_fcv_tag=version_constants.get_fcv_tag_list(), - requires_fcv_tag_lts=version_constants.get_lts_fcv_tag_list(), - requires_fcv_tag_continuous=version_constants.get_continuous_fcv_tag_list(), - last_lts_fcv=version_constants.get_last_lts_fcv(), - last_continuous_fcv=version_constants.get_last_continuous_fcv(), + requires_fcv_tag=fcv_constants.get_fcv_tag_list(), + requires_fcv_tag_lts=fcv_constants.get_lts_fcv_tag_list(), + requires_fcv_tag_continuous=fcv_constants.get_continuous_fcv_tag_list(), + last_lts_fcv=fcv_constants.get_last_lts_fcv(), + last_continuous_fcv=fcv_constants.get_last_continuous_fcv(), ) @@ -79,14 +69,10 @@ class MultiversionPlugin(PluginInterface): :param subparsers: argparse subparsers """ - parser = subparsers.add_parser(MULTIVERSION_SUBCOMMAND, - help="Display configuration for multiversion testing") - - parser.add_argument("--config-file-output", '-f', action="store", type=str, default=None, - help="File to write the multiversion config to.") + subparsers.add_parser(MULTIVERSION_SUBCOMMAND, + help="Display configuration for multiversion testing") - def parse(self, subcommand: str, parser: argparse.ArgumentParser, - parsed_args: argparse.Namespace, **kwargs) -> Optional[Subcommand]: + def parse(self, subcommand, parser, parsed_args, **kwargs) -> Optional[Subcommand]: """ Resolve command-line options to a Subcommand or None. @@ -96,8 +82,7 @@ class MultiversionPlugin(PluginInterface): :param kwargs: additional args. :return: None or a Subcommand. """ + configure_resmoke.validate_and_update_config(parser, parsed_args) if subcommand == MULTIVERSION_SUBCOMMAND: - configure_resmoke.detect_evergreen_config(parsed_args) - configure_resmoke.validate_and_update_config(parser, parsed_args) - return MultiversionConfigSubcommand(parsed_args) + return MultiversionConfigSubcommand() return None |
