OpenSCAP / oval-graph

Understand OVAL results in a blink of an eye
Apache License 2.0
34 stars 19 forks source link

Traceback in `get_data_form_xml` #6

Closed dahaic closed 5 years ago

dahaic commented 5 years ago

Hello, I am not able to create the graph, can you take a look?

python3 run.py xccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout-comment.fail.sh-xccdf_org.ssgproject.content_profile_ospp-results-initial.txt xccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout

Traceback (most recent call last):
  File "run.py", line 30, in <module>
    arg.func(arg)
  File "run.py", line 22, in run
    oval_tree = graph.oval_graph.build_nodes_form_xml(args.source_filename, args.rule_name)
  File "/home/dahaic/RH/git/upstream/origins/OVAL-visualization-as-graph/graph/oval_graph.py", line 450, in build_nodes_form_xml
    return parser.get_oval_graph(rule_id)
  File "/home/dahaic/RH/git/upstream/origins/OVAL-visualization-as-graph/graph/xml_parser.py", line 103, in get_oval_graph
    return self.xml_dict_of_rule_to_node(self.parse_data_to_dict(rule_id))
  File "/home/dahaic/RH/git/upstream/origins/OVAL-visualization-as-graph/graph/xml_parser.py", line 55, in parse_data_to_dict
    for i in self.get_data_form_xml(used_rules[0]['href']):
  File "/home/dahaic/RH/git/upstream/origins/OVAL-visualization-as-graph/graph/xml_parser.py", line 24, in get_data_form_xml
    for report in reports:
TypeError: 'NoneType' object is not iterable

I am on RHEL7, python 3.6.8 xccdf_org.ssgproject.content_rule_sssd_ssh_known_hosts_timeout-comment.fail.sh-xccdf_org.ssgproject.content_profile_ospp-results-initial.txt

Honny1 commented 5 years ago

Hi, reason why you not able to create the graph is you use xccdf report. You must use arf. Or in arf file missing oval_results.

matejak commented 5 years ago

The issue points out that the feedback towards the user was a traceback, which is not user-friendly. If this is fixed, it is a good custom to reference the PR or commit where the fix happened, so the reporter can retry and close the issue by themselves.

Honny1 commented 5 years ago

The problem has been fixed in #8.