Skip to content

getopt: fix debuglevel type in SambaOptions

debuglevel should be int, not str.

In Python2, Objects of different types except numbers are ordered by their type names.

Which means, when you compare a int level to the str debuglevel like 5 < '0', you are actually comparing the type name "int" and "string", which is always true.

This causes debuglevel control in samba Python command line never worked.

The _set_debuglevel callback on this option never worked either, since arg < 0 is always false.

In Python 3, comparing different types will raise TypeError.

Signed-off-by: Joe Guo joeg@catalyst.net.nz

Merge request reports