From 3582865772c79f1645b869b8ae4e7fb8de510dad Mon Sep 17 00:00:00 2001 From: Carson Eng Date: Tue, 12 Nov 2024 18:06:08 +0000 Subject: [PATCH] Project import generated by Copybara. PiperOrigin-RevId: 695777455 --- tools/toolkit.py | 6 ++++-- tools/validators/instance_validator/instance_validator.py | 5 +++-- .../instance_validator/validate/generate_universe.py | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/toolkit.py b/tools/toolkit.py index 13fbaa0c6a..19228f53b6 100644 --- a/tools/toolkit.py +++ b/tools/toolkit.py @@ -71,9 +71,10 @@ def _ParseArgs() -> argparse.ArgumentParser: '--modified-ontology-types', dest='modified_types_filepath', required=False, - default=DEFAULT_ONTOLOGY_PATH, + default=None, help='Filepath to modified type filepaths', - metavar='MODIFIED_TYPE_FILEPATHS') + metavar='MODIFIED_TYPE_FILEPATHS', + ) parser.add_argument( '-s', @@ -132,6 +133,7 @@ def _ParseArgs() -> argparse.ArgumentParser: handler.RunValidation( filenames=args.filenames, modified_types_filepath=args.modified_types_filepath, + default_types_filepath=DEFAULT_ONTOLOGY_PATH, subscription=args.subscription, gcp_credential_path=args.gcp_credential, report_directory=args.report_directory, diff --git a/tools/validators/instance_validator/instance_validator.py b/tools/validators/instance_validator/instance_validator.py index 18688d040d..40f078d0a1 100644 --- a/tools/validators/instance_validator/instance_validator.py +++ b/tools/validators/instance_validator/instance_validator.py @@ -91,8 +91,9 @@ def _ParseArgs() -> argparse.ArgumentParser: '--udmi', dest='udmi', required=False, - default='True', - help='Parse messages as UDMI') + default='False', + help='Parse messages as UDMI', + ) return parser diff --git a/tools/validators/instance_validator/validate/generate_universe.py b/tools/validators/instance_validator/validate/generate_universe.py index 043c7a3379..0195a80f18 100644 --- a/tools/validators/instance_validator/validate/generate_universe.py +++ b/tools/validators/instance_validator/validate/generate_universe.py @@ -43,6 +43,7 @@ def BuildUniverse( Generated universe object. """ if use_simplified_universe: + print('Using simplified universe for testing purposes.') yaml_files = None universe = universe_helper.create_simplified_universe() elif modified_types_filepath: @@ -55,6 +56,7 @@ def BuildUniverse( return None modified_types_filepath = path.expanduser(modified_types_filepath) + print(f'Validating modified universe from [{modified_types_filepath}]...') external_file_lib.Validate( filter_text=None, @@ -62,6 +64,7 @@ def BuildUniverse( original_directory=default_types_filepath, interactive=False, ) + print(f'Using modified universe from [{modified_types_filepath}].') yaml_files = external_file_lib.RecursiveDirWalk(modified_types_filepath) else: if default_types_filepath is None: @@ -73,7 +76,7 @@ def BuildUniverse( 'default ontology does not exist.' ) return None - # use default location for ontology files + print(f'Using default universe from [{default_types_filepath}].') yaml_files = external_file_lib.RecursiveDirWalk(default_types_filepath) if yaml_files: