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
PR - Ticket 50151 - lib389 support cli add/replace/delete on objects #3217
Comments
Comment from lkrispen (@elkris) at 2019-01-15 10:36:56 It would be nice to have this possibilty to use ldapmodify easily, but as far as I see the patch only covers a subset of what is possible with ldapmodify. ldapmodify allows multiple values in one ADD/DEL/REPLACE operation, it also allows DEL/REPLACE without a value to completely remove an attribute. |
Comment from firstyear (@Firstyear) at 2019-01-15 23:45:37 So if I'm reading this, I think you are suggesting something like: "add:attribute:value:value:value"? Is that what you mean here? The del/replace with no value to remove an attribute however, is an oversight, so I can fix this to allow "delete:attr:" to remove an attribute completely. |
Comment from firstyear (@Firstyear) at 2019-01-18 00:16:46 @elkris What do you think of the above suggestion for the value list? :) |
Comment from tbordaz (@tbordaz) at 2019-01-18 08:50:38 I will let @elkris comment but he may had in mind something like
Do you want the generic update to cover these kind of update ? |
Comment from firstyear (@Firstyear) at 2019-01-18 09:58:18 @tbordaz I'd ready like to avoid that syntax-style because it's basically "reinventing ldif", and it's a bit awkward. This tool is intended for quick single attribute or a few attribute changes, not large bulk updates like this. Part of the motivation is that asking people to provide a file, and then apply it, is a barrier to entry because the syntax of that file is foreign. But having a cli tool we get something easier and quicker to use, and then admins can "step up" to ldif if they require the complete ability for ldap to express complex changes like that. Does this help explain a bit of my motivation? |
Comment from tbordaz (@tbordaz) at 2019-01-18 10:16:59 @Firstyear, thanks for clarification. Supporting only 'simple' updates looks fine to me as it is likely the vast majority of admins need. |
Comment from firstyear (@Firstyear) at 2019-01-21 00:18:49 rebased onto 90d27f9ac3dd8d45dabdd4c1cec51f0c87848292 |
Comment from firstyear (@Firstyear) at 2019-01-21 00:19:43 Delete now allows deleting all values with "delete:attr:". I think that we can do the multiple value replace with "delete:attr:" "add:attr:value" "add:attr:value2" instead rather than writing a multi-value parser. |
Comment from spichugi (@droideck) at 2019-01-23 15:39:09 I haven't tested but the code looks good. |
Comment from firstyear (@Firstyear) at 2019-01-23 23:56:30 @droideck Great thanks! I'll give @elkris another day to comment, and then I'll merge tomorrow if that's okay :) |
Comment from spichugi (@droideck) at 2019-01-24 00:53:28
I'd like for @mreynolds389 to check it too and leave his opinion... It's a new functionality (which I agree that we'll need someday) but we will have it in master after the merge. And the master is going to the soonest RHEL release. But maybe I am overthinking the thing and Mark will correct me. P.S. sorry if it's too much of a resistance. I really like the thing but we should be careful about what we deliver. |
Comment from mreynolds (@mreynolds389) at 2019-01-24 02:14:47 I'm on the fence about when to merge this. It does make sense to wait for 1.4.1 branch (which I plan to do soon). @Firstyear any objections waiting for 1.4.1? |
Comment from firstyear (@Firstyear) at 2019-01-24 03:13:03 @mreynolds389 Maybe this is a good time to test feature gating by version? We could have a flag for "if defaults. version >= 1.4.1" then to add the arg parse lines? This way we could merge now, and it would only unblock on the future version bump? I think we should consider this gating strategy now since we are running into it. |
Comment from firstyear (@Firstyear) at 2019-01-28 23:38:27 As @mreynolds389 has branched, I'll commit this now. |
Comment from firstyear (@Firstyear) at 2019-01-28 23:41:02 rebased onto 341eeab |
Comment from firstyear (@Firstyear) at 2019-01-28 23:41:36 Pull-Request has been merged by Firstyear |
Patch |
Cloned from Pagure Pull-Request: https://pagure.io/389-ds-base/pull-request/50158
Bug Description: We need a generic way to add/replace/delete on
objects, that is not ldif. Ldif is wildly inaccessible and hard
to use.
Fix Description: Add a "modify" generic to cli_base, that is
used by user. It supports a syntax of:
modify <add|replace|delete>::
An example is:
... user modify demo_user add:objectclass:nsMemberOf
These can have many modifications in a single transaction:
user modify demo_user add:objectclass:nsMemberOf add:description:test
Resolves: #3210
Author: William Brown william@blackhats.net.au
Review by: ???
The text was updated successfully, but these errors were encountered: