Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion JsonOutput/JsonOutput.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import yaml
import json
import os
import logging

RMMDIR = './RMMs'
OUTDIR = './ci-output'
OUTFILE = f'{OUTDIR}/rmms.json'

rmms = {}
for filename in os.listdir(RMMDIR):
logging.warning('Processing RMM: %s', filename)
file = os.path.join(RMMDIR, filename)
if os.path.isfile(file):
with open(file, 'r') as f:
Expand All @@ -18,5 +20,5 @@
if not os.path.exists(OUTDIR):
os.mkdir(OUTDIR)
with open(OUTFILE, 'w') as f:
f.write(json.dumps(rmms, indent=2))
f.write(json.dumps(rmms, indent=2, default=str))

8 changes: 8 additions & 0 deletions Validator/_validate_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import os
import datetime
import json

RMMDIR = './RMMs'
OSES = ['Windows','MacOS','Linux']
Expand Down Expand Up @@ -74,6 +75,12 @@ def check_meta(r, meta):
if not isinstance(meta['References'], list):
ERRORS.append(f"References on {r} isn't a list")

def check_serialize(r, rmm_test):
try:
_jout = json.dumps(rmm_test, indent=2, default=str)
except Exception as ex: # pylint: disable=broad-except
ERRORS.append(f'Couldnt JSON serialize RMM: {r}! Exception: {ex}')


IDs = set()
for filename in os.listdir(RMMDIR):
Expand Down Expand Up @@ -107,6 +114,7 @@ def check_meta(r, meta):
check_executables(rmm_name, rmm['Executables'])
check_netconn(rmm_name, rmm['NetConn'])
check_meta(rmm_name, rmm['Meta'])
check_serialize(rmm_name, rmm)
if len(ERRORS) == 0:
sys.exit(0)
else:
Expand Down