summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins/user.py
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-06-23 19:14:53 +0200
committerMartin Basti <mbasti@redhat.com>2016-07-01 09:37:25 +0200
commit750a392fe22aa8ddcb21077e8c24b96d36ecf20c (patch)
tree54dd24acf6563c9c714a8333d55b7b36b37672b9 /ipaserver/plugins/user.py
parent7e803aa4625869ef6a8e78a09cd99270c4cc77e5 (diff)
downloadfreeipa-750a392fe22aa8ddcb21077e8c24b96d36ecf20c.tar.gz
freeipa-750a392fe22aa8ddcb21077e8c24b96d36ecf20c.tar.xz
freeipa-750a392fe22aa8ddcb21077e8c24b96d36ecf20c.zip
Allow for commands that use positional parameters to add/remove attributes
Commands that modify a single multivalued attribute of an entry should use positional parameters to specify both the primary key and the values to add/remove. Named options are redundant in this case. The `--certificate option` of `*-add/remove-cert` commands was turned mandatory to avoid EmptyModlist when it is omitted. https://fedorahosted.org/freeipa/ticket/3961 https://fedorahosted.org/freeipa/ticket/5413 Reviewed-By: David Kupka <dkupka@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/plugins/user.py')
-rw-r--r--ipaserver/plugins/user.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipaserver/plugins/user.py b/ipaserver/plugins/user.py
index 7c5221c85..c231847d5 100644
--- a/ipaserver/plugins/user.py
+++ b/ipaserver/plugins/user.py
@@ -53,8 +53,8 @@ from .baseldap import (
LDAPSearch,
LDAPQuery,
LDAPMultiQuery,
- LDAPAddAttribute,
- LDAPRemoveAttribute)
+ LDAPAddAttributeViaOption,
+ LDAPRemoveAttributeViaOption)
from . import baseldap
from ipalib.request import context
from ipalib import _, ngettext
@@ -1136,7 +1136,7 @@ class user_status(LDAPQuery):
@register()
-class user_add_cert(LDAPAddAttribute):
+class user_add_cert(LDAPAddAttributeViaOption):
__doc__ = _('Add one or more certificates to the user entry')
msg_summary = _('Added certificates to user "%(value)s"')
attribute = 'usercertificate'
@@ -1158,7 +1158,7 @@ class user_add_cert(LDAPAddAttribute):
@register()
-class user_remove_cert(LDAPRemoveAttribute):
+class user_remove_cert(LDAPRemoveAttributeViaOption):
__doc__ = _('Remove one or more certificates to the user entry')
msg_summary = _('Removed certificates from user "%(value)s"')
attribute = 'usercertificate'