Skip to content

Commit

Permalink
Merge pull request #148 from JordanCHW/required_profiles
Browse files Browse the repository at this point in the history
Add a argument to specify the root folder of require profiles and add all sub directories to the search path
  • Loading branch information
jautor committed Apr 22, 2022
2 parents f5297f4 + 033e7e3 commit 2ed5dd2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ authtype | string | Authorization type (Basic | Session | Token | None)
token | string | Token string for Token authentication

### [Validator]
Variable | Type | Definition
-- |-- |--
payload | string | Option to test a specific payload or resource tree (see below)
logdir | string | Place to save logs and run configs
oemcheck | boolean | Whether to check Oem items on service
online_profiles | boolean | Whether to download online profiles
debugging | boolean | Whether to print debug to log
Variable | Type | Definition
-- |-- |--
payload | string | Option to test a specific payload or resource tree (see below)
logdir | string | Place to save logs and run configs
oemcheck | boolean | Whether to check Oem items on service
online_profiles | boolean | Whether to download online profiles
debugging | boolean | Whether to print debug to log
required_profiles_dir | string | Option to set the root folder of required profiles

### Payload options
The payload option takes two parameters as "option uri"
Expand Down
5 changes: 5 additions & 0 deletions RedfishInteropValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import argparse
import logging
import json
import glob
from datetime import datetime

tool_version = '2.0.6'
Expand Down Expand Up @@ -51,6 +52,7 @@ def main(argslist=None, configfile=None):
argget.add_argument('--logdir', type=str, default='./logs', help='directory for log files')
argget.add_argument('--nooemcheck', action='store_false', dest='oemcheck', help='Don\'t check OEM items')
argget.add_argument('--debugging', action="store_true", help='Output debug statements to text log, otherwise it only uses INFO')
argget.add_argument('--required_profiles_dir', type=str, help='root directory for required profiles')

# Config information unique to Interop Validator
argget.add_argument('profile', type=str, default='sample.json', nargs='+', help='interop profile with which to validate service against')
Expand Down Expand Up @@ -153,6 +155,9 @@ def main(argslist=None, configfile=None):
my_logger.info("Profile {} did not conform to the given schema...".format(name))
return 1, None, 'Profile Did Not Conform'

if args.required_profiles_dir is not None:
my_paths += glob.glob("{}/**/".format(args.required_profiles_dir), recursive=True)

# Combine profiles
all_profiles = []
for name, profile in my_profiles:
Expand Down

0 comments on commit 2ed5dd2

Please sign in to comment.