Tests: avoid adding python options that are functions in the env
authorMatthieu Patou <mat@matws.net>
Thu, 3 Jan 2013 22:34:13 +0000 (14:34 -0800)
committerMatthieu Patou <mat@samba.org>
Mon, 21 Jan 2013 07:21:20 +0000 (08:21 +0100)
This fix errors when running test --testenv --screen

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/wscript

index 4733dc17cd1d4ddd257b4cdcbe914e8baa4365b7..c7637a19ac5837ab6acdc1537316b571f478691d 100644 (file)
@@ -6,6 +6,7 @@
 import Scripting, os, Options, Utils, Environment, optparse, sys
 from samba_utils import *
 from samba_autoconf import *
+import types
 
 def set_options(opt):
 
@@ -114,7 +115,11 @@ def cmd_testonly(opt):
     # put all command line options in the environment as TESTENV_*=*
     for o in dir(Options.options):
         if o[0:1] != '_':
-            os.environ['TESTENV_%s' % o.upper()] = str(getattr(Options.options, o, ''))
+            val = getattr(Options.options, o, '')
+            if not issubclass(type(val), types.FunctionType) \
+                    and not issubclass(type(val), types.MethodType):
+                os.environ['TESTENV_%s' % o.upper()] = str(getattr(Options.options, o, ''))
+
 
     binary_mapping = ('nmblookup3:nmblookup,' +
                       'nmblookup4:nmblookup4,' +