From adbe969cfaf4ce46c49bd50cd31847a901eaa83d Mon Sep 17 00:00:00 2001 From: Mike Raineri Date: Fri, 2 Mar 2018 13:36:28 -0500 Subject: [PATCH] 1.0.0 Versioning --- AUTHORS.md | 7 +------ CHANGELOG.md | 7 ++++++- README.md | 19 +++++++++---------- RedfishReferenceTool.py | 5 ++++- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 06bf37a..81599c2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,8 +1,3 @@ - # Original Contribution: -* Majec Systems - - -# Other Key Contributions: - +* Majec Systems diff --git a/CHANGELOG.md b/CHANGELOG.md index 988484f..1e42b52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ - # Change Log +## [1.0.0] - 2018-03-02 +- Added tag validation +- Removed restriction on BeautifulSoup version +- Added timeout option +- Added support to alias a file from a local directory + ## [0.9.0] - 2017-04-06 - Initial Public Release diff --git a/README.md b/README.md index 8384728..8e215d4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ -Copyright 2016 Distributed Management Task Force, Inc. All rights reserved. -# Redfish Reference Checker - Version 0.9 +Copyright 2016-2018 Distributed Management Task Force, Inc. All rights reserved. + +# Redfish Reference Checker ## About + RedfishReferenceTool.py is a python3 tool that checks for valid reference URLs in CSDL xml files. ## Pre-requisites + The following requirements may be installed via the command line: pip3 install -r requirements.txt @@ -16,6 +19,7 @@ The requirements for this tool are as follows: * lxml - https://pypi.python.org/pypi/lxml ## Installation + Copy RedfishReferenceTool.py into any tool directory, and requires no extra configuration. Run: python3 RedfishReferenceTool.py [url] [--nochkcert] [--alias file] [--file] [--timeout] @@ -23,18 +27,13 @@ Run: python3 RedfishReferenceTool.py [url] [--nochkcert] [--alias file] [--file] URL includes authority. Note that quotations or an escape must be used for '$' and '#' characters, when using ODATA Uris. ## Execution -Upon execution, attempts to get an XML file at the URL given, and exits with 1 -on bad URLs or non xml formatted files, then dereferences all reference URLs -in the file. + +Upon execution, attempts to get an XML file at the URL given, and exits with 1 on bad URLs or non xml formatted files, then dereferences all reference URLs in the file. Upon specifying --nochkcert, it will not attempt to verify any certification provided. --timeout may be used to increase request timeouts. -Upon specifying --alias, it will read a json-formatted file that provides an alias for URIs or URLs not currently published online, -and instead points to a local file. -For single files, a single URL may be mapped on the left hand side to point to a file stored on the right. -If a URL is appended with /\*, then it may point to a directory appended with /\* on the right, such that each file in the directory will be mapped to its own URL. +Upon specifying --alias, it will read a json-formatted file that provides an alias for URIs or URLs not currently published online, and instead points to a local file. For single files, a single URL may be mapped on the left hand side to point to a file stored on the right. If a URL is appended with /\*, then it may point to a directory appended with /\* on the right, such that each file in the directory will be mapped to its own URL. For a simpler way to test one local file, please use the parameter --file, which will interpret the URL given as a locally stored file relative to the current work directory. This mode will not interpret a "host", and thus will fail if the stored file contains relative references. Exits with success if the amount of missing references is zero. - diff --git a/RedfishReferenceTool.py b/RedfishReferenceTool.py index b5c0046..47d584e 100644 --- a/RedfishReferenceTool.py +++ b/RedfishReferenceTool.py @@ -15,6 +15,7 @@ requests.packages.urllib3.disable_warnings(InsecureRequestWarning) +tool_version = '1.0.0' def generateXmlReferences(reftags): # unused block to write a valid xml file instead of just printing to file @@ -109,7 +110,7 @@ def getAlias(uri, aliasDict): if __name__ == "__main__": - argget = argparse.ArgumentParser(description='Tool that checks if reference contain all valid URLs') + argget = argparse.ArgumentParser(description='Redfish Reference Checker {}: A tool that checks if reference contain all valid URLs'.format(tool_version)) argget.add_argument('url', type=str, help='destination url to test') argget.add_argument('--file', action='store_true', help='use url as filepath to local file') argget.add_argument('--nochkcert', action='store_true', help='ignore check for certificate') @@ -119,6 +120,8 @@ def getAlias(uri, aliasDict): args = argget.parse_args() + print('Redfish Reference Checker {}'.format(tool_version)) + rootURL = args.url chkCert = not args.nochkcert aliasFile = args.alias