Skip to content

Commit

Permalink
refs #14: Result gets the system
Browse files Browse the repository at this point in the history
  • Loading branch information
eFrane committed Dec 9, 2017
1 parent 2aa01eb commit 4ee2698
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def __init__(self, compiled_result = None):
self.oparl_version = '1.0'
self.lock = Lock()

self.system = None

self.compiled_result = compiled_result

def format_severity(self, severity):
Expand Down Expand Up @@ -141,6 +143,8 @@ def compile(self):
'network': self.network,
'oparl_version': self.oparl_version,
'timestamp': timestamp
# TODO: make self.system json serializable
# 'system': self.system
}

def __str__(self):
Expand Down Expand Up @@ -195,7 +199,7 @@ def text(self):

entities += '# {}\n{}\n\nAffected Entities:\n\n{}\n\n'.format(entity, table, entity_list[:-2])

return 'Validation Result:\n\n{}\n{}\n{}\n'.format(totals, network, entities[:-2])
return 'Validation Result:\n\n{}\n{}\n{}'.format(totals, network, entities[:-2])

def json(self):
class DateTimeEncoder(json.JSONEncoder):
Expand Down
2 changes: 2 additions & 0 deletions core/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def validate(self):
result = Result()
check_pool = Pool()

result.system = self.client.system

walker_threads = []
worker_threads = []

Expand Down

0 comments on commit 4ee2698

Please sign in to comment.