Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabilities_file doesn't get created or throw an error #112

Closed
deeTEEcee opened this issue May 18, 2023 · 3 comments
Closed

disabilities_file doesn't get created or throw an error #112

deeTEEcee opened this issue May 18, 2023 · 3 comments
Assignees
Milestone

Comments

@deeTEEcee
Copy link

From what I can tell, the disabilities_file only gets generated once we run enable or disable but I noticed the full directory needs to also exist. Otherwise, it never gets created but it also doesn't throw an error.

@deeTEEcee deeTEEcee changed the title disabilities_file doesn't get created if parent directory is missing disabilities_file doesn't get created or throw an error May 18, 2023
@julien6387 julien6387 modified the milestones: 0.11, 0.17 May 18, 2023
@julien6387
Copy link
Owner

True. At the moment, the file is serialized only subsequently to a call to enable or disable.
However, there is an initial check at startup and there should be an error raised if the folder does not exist.
You should get something like this in the log traces:

2023-05-18 18:53:20,764;ERRO;SupvisorsOptions.get_value: The directory named as part of the path /dummy_path/disabilities.json does not exist

When it happens, the path is not stored, so calls to enable or disable would work but nothing would be persisted afterwards.

Supvisors will be updated so that:

  1. the file gets written when entering the OPERATIONAL state ;
  2. the file path is re-evaluated every time the file needs to be written, providing eventually the above error, and allowing the user to create it on-the-fly if missing.
    The folder will not be created if it does not exist to keep consistency with Supervisor behavior.

@deeTEEcee
Copy link
Author

thanks for the clear description! that makes sense to me. i was just curious, is there any reason why we can't just auto-create the full path in supvisor if it doesn't exist?

@julien6387
Copy link
Owner

While implementing it, I've changed my mind a bit.
The default file is written down at startup. No re-evaluation of the path after the options have been loaded but the folder tree will be created if missing (unless write permission is denied, which will provide an ERROR log trace).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants