-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add a parameter to disable configuration file automatic creation #45
Conversation
I have a bug with my pelican install (docker related), I can't test if the IsNotExist error handling works. |
Tested it and now it works, the error handling and the not creation of the file |
UP |
?? |
This now conflicts with this: #34 and is there anyone realy needing this? |
Hi, sorry haven't really been able to check github for a while. |
I finally took the time to fix the conflicts |
@superdarki |
Hi @parkervcp, |
You can cancel on that. I read it as an egg feature and not part of the file json. This doesn't need a panel side change. |
Ok, perfect then. |
Changes
Why
In very specific cases, configuration files should not be created by the daemon before the server first startup as they have not been created during the installation process.
This new flag enables egg creators to specify (default true) if the file should be created or not when the daemon tries to parse it.
What it add
(This is just an example on the Vanilla Minecraft egg, this is not where I think the flag would be useful)
How
When the daemon tries to open the file to parse it, changing the function to Open instead of Touch makes it return an error instead of creating the file. If the error is "IsNotExist" and "create_file" is false just return without logging an error.
Config parser file open function edition :
![{AC38805D-4F4F-41D7-9B60-2084BE086CC4}](https://private-user-images.githubusercontent.com/52256277/375373720-7077ecd1-7ef3-447e-8959-4a2a854be452.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDgxNTgsIm5iZiI6MTczOTY0Nzg1OCwicGF0aCI6Ii81MjI1NjI3Ny8zNzUzNzM3MjAtNzA3N2VjZDEtN2VmMy00NDdlLTg5NTktNGEyYTg1NGJlNDUyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE5MzA1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYxNTdjMGJjOTVlZGExODFkODhmMDY0MjNmNjkzZDcxODFkZTQxNzFiNmNmYjgxYjE5YjQ3MDVhZWY2NTllZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ekc17YSa-QJIC-d3b4egagB3L51ivCn_VTHcxvXtcsQ)
![{E02BC110-3581-4054-A64D-61F0EECFCCDB}](https://private-user-images.githubusercontent.com/52256277/374963289-c7256333-700c-452d-bd22-c9be960de3f4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDgxNTgsIm5iZiI6MTczOTY0Nzg1OCwicGF0aCI6Ii81MjI1NjI3Ny8zNzQ5NjMyODktYzcyNTYzMzMtNzAwYy00NTJkLWJkMjItYzliZTk2MGRlM2Y0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE5MzA1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFlNTBjODdmMzlkZjA3NGY1YzA1ODIwMmIzMzMyMDg4NjdhMDEwMmYyOWQzN2M0ZWVjYTU2NTliOGNkY2YwYjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ftwEcer4gFqMnzIKJ02AwVZdAzxYR3lu5nrm6xh_izQ)
![{67C5CD79-627D-4A2E-A03E-2724037B8D74}](https://private-user-images.githubusercontent.com/52256277/374957916-e23a4107-3f63-4d20-a884-fefde6fed85f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDgxNTgsIm5iZiI6MTczOTY0Nzg1OCwicGF0aCI6Ii81MjI1NjI3Ny8zNzQ5NTc5MTYtZTIzYTQxMDctM2Y2My00ZDIwLWE4ODQtZmVmZGU2ZmVkODVmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE5MzA1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVjMjYxOTllZjAwMjEwNWY2Nzg0MjA1NDQxMjNhZDBkYjI4YWY0MzIwYmJkNzY5ODFmMzA1YWY0YTkyNDIwOWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1c7a6L0pKah6b7tcd_q7d7KrA-OigRo3ffkLu2okjX0)
Add the flag to the ConfigurationFile struct :
UnmarshalJSON function addition :