Closed liayn closed 9 years ago
We hadn't considered that use case. I agree that it shouldn't be a fatal event if this situation is encountered. Thanks for opening the issue!
Good to hear from you. I would really appreciate such a patch.
Generally all software should follow the principle: Only allocate resources that are really needed. That goes for all options and tools, not only for the usecase I mentioned.
In this case the solution would be best, if you would create the directory only when actually writing a file in that directory. If I read the code correctly you're currently trying to create the directory if it does not exist regardless of the type of operation. IMHO there's no need to create the directory for read-operations. If the config-file is not there it will still be missing even though you created the directory for it. ;-)
liayn, thank you again for reporting this issue. The latest release addresses this and doesn't require a .linodecli dir or config.
@jamesottinger Awesome! Waiting for the update to hit the repository.
We're using the linode domain cli tools in web-scripts. The scripts are run as a user with very limited permissions. The user is NOT allowed to create the .linodecli directory in the home directory.
Since the API key is specified via command line arguments, the directory is not necessary at all. If we remove the mkdir() command from Util.pm::check_configs(), the scripts work without problems.
Would it be possible to add a check that skips the creation of this directory when not needed?
Thanks.