cyberpanel
cyberpanel copied to clipboard
[BUG] cli/cyberPanel.py version is broken
Describe the bug
When trying to run cyberpanel version
, the following error occurs:
Traceback (most recent call last):
File "/usr/bin/cyberpanel", line 1603, in <module>
main()
File "/usr/bin/cyberpanel", line 1357, in main
print(get_cyberpanel_version())
File "/usr/bin/cyberpanel", line 35, in get_cyberpanel_version
version = json.loads(str(version_file))
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 4)
To Reproduce What steps did you take when the issue occurred?
- Run
cyberpanel version
- See the error
Expected behavior For there to not be an error
Operating system: Ubuntu 20.04 LTS
CyberPanel version: Version 2.3 / Build: 4 / Current Commit: https://github.com/usmannasir/cyberpanel/commit/c8da443334b8815ec250a0fba606e75355f641cd
I'll do a commit in a bit, but the fix is
def get_cyberpanel_version():
with open('/usr/local/CyberCP/version.txt') as version:
version_file = version.read().split()
return f"{version_file[0]}.{version_file[1]}"
This seems to be fixed.
This doesn't appear to be completed
@usmannasir What made you believe this was completed?
I can execute cyberpanel version
on my end, you can not ?
Works fine for me also in 2.3.5 - Almalinux 8.9