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

K5Realm.__init__'s existing argument is non-obvious #6

Open
cipherboy opened this issue May 11, 2018 · 1 comment
Open

K5Realm.__init__'s existing argument is non-obvious #6

cipherboy opened this issue May 11, 2018 · 1 comment

Comments

@cipherboy
Copy link

In K5Realm's __init__ method, the use case of existing is non-obvious (as it really does two things: the base directory location and whether or not to write new configuration).

If existing is not None then it is treated as a base directory path and K5Realm.tmpdir is updated with its contents and configuration is not written. On the other hand, if existing is None, then K5Realm.tmpdir receives a newly created temporary directory, and later governs the creation of the configuration.

It seems like existing should be a boolean parameter, with tmpdir being renamed to basedir and accepted as an additional argument in __init__. This would allow K5Realm to be used to create krb5 deployments in determanistic locations. However, this is a breaking change.

Looking for public usages of existing being not-None, the only one I can find is in
gssapi-console, which could be updated as it is part of the pythongssapi org.

@cipherboy cipherboy changed the title k5test - K5Realm.__init__'s existing is non-obvious K5Realm.__init__'s existing argument is non-obvious May 11, 2018
@DirectXMan12
Copy link
Member

I'm mostly fine with that. It was mostly intended as being "existing" meaning "here's the path to an existing K5Realm setup". The only issue is that it's probably not entirely obvious that existing=True and tmpdir=None is an invalid combination.

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

No branches or pull requests

2 participants