thatmattlove / hyperglass

hyperglass is the network looking glass that tries to make the internet better.
https://hyperglass.dev
BSD 3-Clause Clear License
626 stars 94 forks source link

Error in hyperglass setup with defined HYPERGLASS_PATH #220

Closed k-akashi closed 4 months ago

k-akashi commented 1 year ago

Bug Description

No error occurs selecting a directory for hyperglass from prompt. But hyperglass setup fails when HYPERGLASS_PATH is defined. The type of app_path when executing hyperglass setup differs depending on whether or not HYPERGLASS_PATH is defined. The error message follows:

  File "/usr/local/lib/python3.8/dist-packages/hyperglass/cli/installer.py", line 74, in _scaffold
    ui_dir = self.app_path / "static" / "ui"
TypeError: unsupported operand type(s) for /: 'str' and 'str'

Possible Solution

When retrieving HYPERGLASS_PATH with os.environ.get in the _get_app_path method of the Installer class, it needs to be converted from a string to a path object using pathlib.Path.

Environment

Server