URL: https://github.com/SSSD/sssd/pull/48 Title: #48: sssctl: Flags for commadn initialization
lslebodn commented: """ On (17/10/16 09:33), Jakub Hrozek wrote: >I don't know how to unstuck this PR except providing some ideas > * SSS_TOOL_FLAG_NOCONF > * SSS_TOOL_FLAG_STATIC > * SSS_TOOL_FLAG_CONFPARSE_FALSE > Let me explain how I read code of the function tool_cmd_init +static int tool_cmd_init(struct sss_tool_ctx *tool_ctx, + struct sss_route_cmd *command) +{ + int ret; + + if (command->flags & SSS_TOOL_FLAG_NOCONF) { + /* This tool does not need to connect to confdb or + * initialize the domain contexts. Nothing to do. */ + return EOK; The function tool_cmd_init has "init" in a name so I assume it want to do some initialisation. The first action in the function is checking "some flag". If the flag is enabled then the execution is immediatelly finished with success. Based on the name of flag SSS_TOOL_FLAG_NOCONF. It seems that there should be some configuration done in this function which should be skipped. However, this function does not do any configuration. The previous name was SSS_TOOL_CMD_FLAG_NO_CONFDB which looks like just confd shoudl not be initialized. But tool_cmd_init initialize two things and can initialize more things in future. And it isn't important that initialization of domain depends on confdb because it can change in future. If you would like to use the name of option SSS_TOOL_CMD_FLAG_NO_CONFDB The code should look: if ((command->flags & SSS_TOOL_FLAG_NOCONF) == 0) { //initialisation of confdb } //further initialisation. But your code loks like if (command->flags & SSS_TOOL_FLAG_WITH_CONFUSING_NAME) { //immediatelly finish } //initialisation of confdb //initialisation of domains http://martinfowler.com/bliki/TwoHardThings.html """ See the full comment at https://github.com/SSSD/sssd/pull/48#issuecomment-254718848
_______________________________________________ sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org