s4:upgrade_from_s3 - restore "get_testparm_var" method
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 12 Sep 2011 18:57:10 +0000 (20:57 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 13 Sep 2011 12:53:24 +0000 (14:53 +0200)
This has accidentally been removed by commit 8268c2d4e231b05b439bc70331b75342b35daa4e.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/python/samba/netcmd/domain.py

index 94900014041fb5010172ccdd105b81ad54c7bb4b..4211b0680278e5d15e29c95e3930d976dc364865 100644 (file)
@@ -54,7 +54,10 @@ from samba.dsdb import (
     DS_DOMAIN_FUNCTION_2008_R2,
     )
 
-
+def get_testparm_var(testparm, varname):
+    cmd = "%s -s -l --parameter-name='%s' 2>/dev/null" % (testparm, varname)
+    output = os.popen(cmd, 'r').readline()
+    return output.strip()
 
 class cmd_domain_export_keytab(Command):
     """Dumps kerberos keys of the domain into a keytab"""