Skip to content

Commit

Permalink
Merge pull request #1464 from google/copybara
Browse files Browse the repository at this point in the history
Project import generated by Copybara.
  • Loading branch information
mschlaffer authored Nov 14, 2024
2 parents d080383 + 3582865 commit 32b5cee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions tools/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions tools/validators/instance_validator/instance_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -55,13 +56,15 @@ 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,
changed_directory=modified_types_filepath,
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:
Expand All @@ -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:
Expand Down

0 comments on commit 32b5cee

Please sign in to comment.