Skip to content

Fix graph exporter output extension handling and clarify generic exporter text#1179

Merged
adulau merged 1 commit intomainfrom
codex/fix-output-file-format-and-update-comments
Apr 14, 2026
Merged

Fix graph exporter output extension handling and clarify generic exporter text#1179
adulau merged 1 commit intomainfrom
codex/fix-output-file-format-and-update-comments

Conversation

@adulau
Copy link
Copy Markdown
Member

@adulau adulau commented Apr 14, 2026

Motivation

  • Ensure the output file name/extension matches the selected export format so users don't end up with a .graphml file containing DOT or JSON content.
  • Clarify that the script is a generic MISP galaxy graph exporter supporting GraphML, Graphviz DOT and a JSON graph format, not GraphML-only.

Description

  • Updated module docstring and CLI help to describe the tool as a generic MISP galaxy graph exporter supporting graphml, dot, and json-graph formats.
  • Added output_suffix() and resolve_output_path() helpers to map --output-format to the expected file suffix and adjust the requested path accordingly.
  • Changed main() to write to the resolved output_path for all formats and updated the final status message to reference the resolved path.

Testing

  • Ran python3 tools/gen_graphml.py --output-format dot --output /tmp/misp-galaxies.graphml and it succeeded, writing to /tmp/misp-galaxies.dot.
  • Ran python3 tools/gen_graphml.py --output-format json-graph --output /tmp/misp-galaxies.graphml and it succeeded, writing to /tmp/misp-galaxies.json.
  • Ran python3 tools/gen_graphml.py --output-format graphml --output /tmp/misp-galaxies.dot and it succeeded, writing to /tmp/misp-galaxies.graphml.

Codex Task

@adulau adulau merged commit 664de86 into main Apr 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant