th3-z / kf2-magicked-admin

:spider: Mutator-free management, statistics, and in-game bot for ranked Killing Floor 2 servers
https://kf2-ma.th3-z.xyz
MIT License
32 stars 7 forks source link

[BUG] Config folders aren't created automatically #154

Closed th3-z closed 4 years ago

th3-z commented 4 years ago

Describe the bug If the folders conf/, conf/scripts, or conf/marquee do not exist when kf2-ma is started kf2-ma will crash during configuration.

To Reproduce Steps to reproduce the behavior:

  1. Delete conf/
  2. Restart KF2-MA
  3. See error

Expected behavior Configuration folders/tree are built automatically.

Desktop (please complete the following information):

Log

the_z@saturn:~/prog/kf2-magicked-admin$ rm -rf magicked_admin/conf/
the_z@saturn:~/prog/kf2-magicked-admin$ python3 magicked_admin/magicked_admin.py
Traceback (most recent call last):
  File "magicked_admin/magicked_admin.py", line 17, in <module>
    from chatbot.chatbot import Chatbot
  File "/media/the_z/data/prog/kf2-magicked-admin/magicked_admin/chatbot/chatbot.py", line 5, in <module>
    from utils import debug, find_data_file
  File "/media/the_z/data/prog/kf2-magicked-admin/magicked_admin/utils/__init__.py", line 34, in <module>
    os.environ.get("LOGFILE", find_data_file("conf/magicked_admin.log"))
  File "/usr/lib/python3.6/logging/handlers.py", line 437, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.6/logging/__init__.py", line 1032, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.6/logging/__init__.py", line 1061, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/media/the_z/data/prog/kf2-magicked-admin/magicked_admin/conf/magicked_admin.log'
th3-z commented 4 years ago

fixed by 5f12bc5e2c40bdce1aaf19ea2e8fbd3ebc3590a8