Univention Bugzilla – Attachment 7669 Details for
Bug 41172
udm-cli --remove doesn't work with singlevalue attribute name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
41172.patch (text/plain), 1.59 KB, created by
Florian Best
on 2016-05-19 10:21:17 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-05-19 10:21:17 CEST
Size:
1.59 KB
patch
obsolete
>diff --git a/management/univention-directory-manager-modules/modules/univention/admincli/admin.py b/management/univention-directory-manager-modules/modules/univention/admincli/admin.py >index f3ce119..f3b957e 100755 >--- a/management/univention-directory-manager-modules/modules/univention/admincli/admin.py >+++ b/management/univention-directory-manager-modules/modules/univention/admincli/admin.py >@@ -321,17 +321,18 @@ def object_input(module, object, input, append=None, remove=None): > object[key]=[] > > else: >- if type(object[key]) is str: >- object[key] = [ object[key] ] >- vallist = value >- if type(value) is str: >- vallist = [ value ] >+ current_values = [object[key]] if isinstance(object[key], basestring) else list(object[key]) >+ if value is None: >+ current_values = [] >+ else: >+ vallist = [value] if isinstance(value, basestring) else value > >- for val in vallist: >- if val in object[key]: >- object[key].remove(val) >- else: >- out.append("WARNING: cannot remove %s from %s, value does not exist"%(val,key)) >+ for val in vallist: >+ if val in current_values: >+ current_values.remove(val) >+ else: >+ out.append("WARNING: cannot remove %s from %s, value does not exist"%(val,key)) >+ object[key] = current_values > if input: > for key, value in input.items(): > if module.property_descriptions[key].syntax.name == 'binaryfile': >@@ -1258,3 +1259,7 @@ def _doit(arglist): > return out + ["OPERATION FAILED"] > > return out # nearly the only successfull return >+ >+if __name__ == '__main__': >+ import sys >+ print '\n'.join(doit(sys.argv))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41172
:
7633
| 7669 |
7740