resulttool: Load results from URL

Adds support for resulttool to load JSON files directly from a http://
or https:// URL

(From OE-Core rev: 3e48404afe27c93fa6ffbd8d66bc52dcd6216005)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Watt
2019-04-18 21:57:17 -05:00
committed by Richard Purdie
parent 47d3b81ad3
commit 35fa3e7e18
5 changed files with 28 additions and 13 deletions

View File

@@ -29,7 +29,7 @@ def store(args, logger):
try:
results = {}
logger.info('Reading files from %s' % args.source)
if os.path.isfile(args.source):
if resultutils.is_url(args.source) or os.path.isfile(args.source):
resultutils.append_resultsdata(results, args.source)
else:
for root, dirs, files in os.walk(args.source):
@@ -92,7 +92,7 @@ def register_commands(subparsers):
group='setup')
parser_build.set_defaults(func=store)
parser_build.add_argument('source',
help='source file or directory that contain the test result files to be stored')
help='source file/directory/URL that contain the test result files to be stored')
parser_build.add_argument('git_dir',
help='the location of the git repository to store the results in')
parser_build.add_argument('-a', '--all', action='store_true',