Bug 243438 - dns/dnsviz: dnsviz graph fails with "No such file or directory while opening share/dnsviz/..."
Summary: dns/dnsviz: dnsviz graph fails with "No such file or directory while opening ...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-18 20:54 UTC by John W. O'Brien
Modified: 2020-01-18 20:54 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (pi)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John W. O'Brien 2020-01-18 20:54:13 UTC
Synopsis
========

The graph subcommand is unable to access files in the share directory.


$ dnsviz graph -Thtml -O -r example.json
/usr/local/lib/python3.7/site-packages/pygraphviz/agraph.py:1367: RuntimeWarning: Warning: No such file or directory while opening share/dnsviz/icons/error.png
Error: No or improper image file="share/dnsviz/icons/error.png"
in label of edge RRset-10|example.com|NS -> DNSKEY-3|example.com|8|58821
Warning: No such file or directory while opening share/dnsviz/icons/error.png
Error: No or improper image file="share/dnsviz/icons/error.png"
in label of edge RRset-11|example.com|A -> DNSKEY-3|example.com|8|58821
Warning: No such file or directory while opening share/dnsviz/icons/error.png
Error: No or improper image file="share/dnsviz/icons/error.png"
in label of edge RRset-13|example.com|MX -> DNSKEY-3|example.com|8|58821
Warning: No such file or directory while opening share/dnsviz/icons/error.png
Error: No or improper image file="share/dnsviz/icons/error.png"
in label of edge RRset-14|example.com|AAAA -> DNSKEY-3|example.com|8|58821
Warning: No such file or directory while opening share/dnsviz/icons/error.png
Error: No or improper image file="share/dnsviz/icons/error.png"
in label of edge NSEC-2|fbl5gzdn98.example.com|A -> DNSKEY-3|example.com|8|58821

  warnings.warn(b"".join(errors).decode(self.encoding), RuntimeWarning)
Error reading template file "share/dnsviz/html/dnssec-template.html": No such file or directory


Analysis
========

/usr/local/lib/python3.7/site-packages/dnsviz/config.py sets

    _prefix = ''

instead of

    _prefix = '/usr/local'

During the package building process, it appears that install_data is only populated with the real prefix during the stage target, by which point a copy of config.py has already been generated with the empty prefix.