Add --replace-touch parameter
This commit is contained in:
parent
b4004e2a0f
commit
e9b1f0f26f
1 changed files with 10 additions and 2 deletions
|
@ -129,6 +129,11 @@ parser.add_option( "--touch",
|
||||||
help="Touch attribute giving in parameter to force resync a this LDAP object from provider. A value '%s' will be add to this attribute and remove after. The user use to connect to the LDAP directory must have write permission on this attribute on each object." % TOUCH_VALUE,
|
help="Touch attribute giving in parameter to force resync a this LDAP object from provider. A value '%s' will be add to this attribute and remove after. The user use to connect to the LDAP directory must have write permission on this attribute on each object." % TOUCH_VALUE,
|
||||||
default=None)
|
default=None)
|
||||||
|
|
||||||
|
parser.add_option( "--replace-touch",
|
||||||
|
dest="replacetouch",
|
||||||
|
action="store_true",
|
||||||
|
help="In touche mode, replace value instead of adding.",
|
||||||
|
default=False)
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
@ -230,6 +235,9 @@ class LdapServer(object):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def touch_object(self,dn,attr,orig_value):
|
def touch_object(self,dn,attr,orig_value):
|
||||||
|
if options.replacetouch:
|
||||||
|
new_value=[new_value]
|
||||||
|
else:
|
||||||
new_value=list(orig_value)
|
new_value=list(orig_value)
|
||||||
new_value.append(TOUCH_VALUE)
|
new_value.append(TOUCH_VALUE)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue