Bug 35754 - Samba-tool producing traceback when trying to create a user with --upn option
Summary: Samba-tool producing traceback when trying to create a user with --upn option
Status: RESOLVED WONTFIX
Alias: None
Product: UCS
Classification: Unclassified
Component: Samba
Version: UCS 3.2
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Samba maintainers
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-29 15:58 CEST by Dmitry Galkin
Modified: 2014-09-01 10:54 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Galkin univentionstaff 2014-08-29 15:58:59 CEST
Samba-tool producing traceback when trying to create a user with "--upn" option, for instance: 

root@slave2032:~# samba-tool user add test_username test_password --upn=njkandnaskde
ERROR(<type 'exceptions.NameError'>): uncaught exception - global name 'no' is not defined
  File "/usr/lib/python2.6/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/samba/netcmd/user.py", line 139, in run
    if upn is not None and no-upn:
Comment 1 Florian Best univentionstaff 2014-09-01 10:04:24 CEST
The traceback is incomplete.
Comment 2 Dmitry Galkin univentionstaff 2014-09-01 10:18:09 CEST
(In reply to Florian Best from comment #1)
> The traceback is incomplete.

root@slave2032:~# samba-tool user add test_username test_password --upn=njkanawdawd
ERROR(<type 'exceptions.NameError'>): uncaught exception - global name 'no' is not defined
  File "/usr/lib/python2.6/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/samba/netcmd/user.py", line 139, in run
    if upn is not None and no-upn:
root@slave2032:~# 

It's complete. And the problem is that variable can use underscores, but not the '-' sign: http://legacy.python.org/dev/peps/pep-0008/#method-names-and-instance-variables
Comment 3 Arvid Requate univentionstaff 2014-09-01 10:54:07 CEST
The code block has been removed upstream in Samba 4.2.