Bug 27795 - removing some properties via CLI not possible
removing some properties via CLI not possible
Status: RESOLVED WORKSFORME
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-03 09:18 CEST by Moritz Muehlenhoff
Modified: 2022-06-29 14:57 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Muehlenhoff univentionstaff 2012-07-03 09:18:28 CEST
Tritt auf bei einem univention-backup2master:

Ok, changing location in relativeDomainName=_ldap._tcp,zoneName=jmm302.test,cn=dns,dc=jmm302,dc=test
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 233, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 387, in doit
    out=_doit(arglist)
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 946, in _doit
    out.extend(object_input(module, object, input, append, remove))
  File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 361, in object_input
    object[key]=[val]
UnboundLocalError: local variable 'val' referenced before assignment
Comment 1 Stefan Gohmann univentionstaff 2012-07-03 09:31:55 CEST
Kannst du das Skript einmal mit set -x laufen lassen und die Ausgabe hier anhängen?
Comment 2 Moritz Muehlenhoff univentionstaff 2012-07-03 10:04:26 CEST
(In reply to comment #1)
> Kannst du das Skript einmal mit set -x laufen lassen und die Ausgabe hier
> anhängen?

Der Bug ist doch in dem B2M-Skript, siehe 26211.

Hier könnte hier eine bessere Fehlerbehandlung stattfinden, das muss aber nicht zu 3.0-2 sein.
Comment 3 Stefan Gohmann univentionstaff 2012-07-03 10:06:26 CEST
(In reply to comment #2)
> Hier könnte hier eine bessere Fehlerbehandlung stattfinden, das muss aber nicht
> zu 3.0-2 sein.

OK
Comment 4 Florian Best univentionstaff 2016-09-24 15:53:01 CEST
Happens for "modify" and "add" which makes --set for a property with "complex" syntax and an empty value.

root@xen3:~# udm dns/srv_record modify --dn "relativeDomainName=_domaincontroller_master._tcp,zoneName=school.local,cn=dns,$(ucr get ldap/base)" --set location=
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 222, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 395, in doit
    out=_doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 892, in _doit
    out.extend(object_input(module, object, input, append, remove))
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 369, in object_input
    object[key]=[val]
UnboundLocalError: local variable 'val' referenced before assignment
Comment 5 Florian Best univentionstaff 2016-10-11 16:13:38 CEST
Another example:
# udm dhcp/pool create --superordinate=cn=10.200.27.0,cn=school.local,cn=dhcp,dc=school,dc=local --set name=dhcp_pool --set range=
E: Option local variable 'val' referenced before assignment is not valid
Comment 6 Florian Best univentionstaff 2022-06-29 14:57:51 CEST
Fixed with UCS 5:

(In reply to Florian Best from comment #4)
> # udm dns/srv_record modify --dn
> "relativeDomainName=_domaincontroller_master._tcp,zoneName=school.local,
> cn=dns,$(ucr get ldap/base)" --set location=

Value is required: The property Location is required

(In reply to Florian Best from comment #5)
> Another example:
> # udm dhcp/pool create
> --superordinate=cn=10.200.27.0,cn=school.local,cn=dhcp,dc=school,dc=local
> --set name=dhcp_pool --set range=
Value is required: The property IP range for dynamic assignment is required