[Samba] generate_parm_table python script bug fix

OPC oota oota at mail.linux.bs1.fc.nec.co.jp
Sat Nov 17 13:19:01 GMT 2007


I found useful scripts generate_parm_table.
This script generate parm_table for python scripts.
But,I noticed what I could utilize as a parameter list 
if I added some processing.
So, I execute it,but some strange data got.
More than one "read only" parameter was indicated a time.

I fixed generate_parm_table like this.

--- generate_parm_table.py      Sat Nov 17 20:36:56 2007
+++ /home2/src/samba/samba-3.0.27/examples/scripts/shares/python/generate_parm_table.py Thu Nov 15 12:15:03 2007
@@ -54,10 +54,10 @@

 """

-FOOTER = """##### end of smbparm.py ##########################################
+FOOTER = """##### end of smbparm.y ##########################################
 #################################################################"""

-TESTPARM = "/usr/local/bin/testparm"
+TESTPARM = "/usr/bin/testparm"

 ## fields in Samba's parameter table
 displayName = 0
@@ -89,7 +89,7 @@
 ## First thing is to build the dictionary of parmeter names  ##
 ## based on the output from testparm                         ##

-cmd = "/usr/local/bin/testparm -s -v /dev/null"
+cmd = "/usr/bin/testparm -s -v /dev/null"
 ( status, testparm_output ) = commands.getstatusoutput( cmd )
 if status:
        sys.stderr.write( "Failed to execute testparm!\n%s\n" % testparm_output )
@@ -184,7 +184,7 @@

                ## just make a copy
                parm_table[key] = parm_table[var_table[var_name]][:]
-               parm_table[key][0] = string.strip(parm[0])[1:-1]
+               # parm_table[key][1] = parm[1]
                parm_table[key][1] = string.strip(parm[1])

 ##                      ##


and example/scripts/shares/python/smbparm.py is too old.
It's version is 3.0.11pre-2.

--
--- Oota Toshiya ---  oota at mail.linux.bs1.fc.nec.co.jp
NEC Computers Software Operations Unit              Shiba,Minato,Tokyo
Open Source Software Platform Development Division  Japan,Earth,Solar system
(samba-jp/ldap-jp Staff,mutt-j admin,analog-jp/samba-jp postmaster)


More information about the samba mailing list