PEP8: fix E225: missing whitespace around operator
[nivanova/samba-autobuild/.git] / script / autobuild.py
index 19a511398b2f06d35ede013d8e2c6104a12ef578..0847df2643f3ce98922619240cc9666347b7a0d4 100755 (executable)
@@ -24,33 +24,33 @@ os.environ['TDB_NO_FSYNC'] = '1'
 cleanup_list = []
 
 builddirs = {
-    "ctdb"    : "ctdb",
-    "samba"  : ".",
-    "samba-nt4"  : ".",
-    "samba-fileserver"  : ".",
-    "samba-xc" : ".",
-    "samba-o3" : ".",
-    "samba-ctdb" : ".",
-    "samba-libs"  : ".",
-    "samba-static"  : ".",
-    "samba-test-only"  : ".",
-    "samba-none-env"  : ".",
-    "samba-ad-dc"  : ".",
-    "samba-ad-dc-2"  : ".",
-    "samba-systemkrb5"  : ".",
-    "samba-nopython"  : ".",
-    "ldb"     : "lib/ldb",
-    "tdb"     : "lib/tdb",
-    "talloc"  : "lib/talloc",
-    "replace" : "lib/replace",
-    "tevent"  : "lib/tevent",
-    "pidl"    : "pidl",
-    "pass"    : ".",
-    "fail"    : ".",
-    "retry"   : "."
-    }
-
-defaulttasks = [ "ctdb",
+    "ctdb": "ctdb",
+    "samba": ".",
+    "samba-nt4": ".",
+    "samba-fileserver": ".",
+    "samba-xc": ".",
+    "samba-o3": ".",
+    "samba-ctdb": ".",
+    "samba-libs": ".",
+    "samba-static": ".",
+    "samba-test-only": ".",
+    "samba-none-env": ".",
+    "samba-ad-dc": ".",
+    "samba-ad-dc-2": ".",
+    "samba-systemkrb5": ".",
+    "samba-nopython": ".",
+    "ldb": "lib/ldb",
+    "tdb": "lib/tdb",
+    "talloc": "lib/talloc",
+    "replace": "lib/replace",
+    "tevent": "lib/tevent",
+    "pidl": "pidl",
+    "pass": ".",
+    "fail": ".",
+    "retry": "."
+}
+
+defaulttasks = ["ctdb",
                  "samba",
                  "samba-nt4",
                  "samba-fileserver",
@@ -69,7 +69,7 @@ defaulttasks = [ "ctdb",
                  "talloc",
                  "replace",
                  "tevent",
-                 "pidl" ]
+                 "pidl"]
 
 if os.environ.get("AUTOBUILD_SKIP_SAMBA_O3", "0") == "1":
     defaulttasks.remove("samba-o3")
@@ -77,7 +77,7 @@ if os.environ.get("AUTOBUILD_SKIP_SAMBA_O3", "0") == "1":
 ctdb_configure_params = " --enable-developer --picky-developer ${PREFIX}"
 samba_configure_params = " --picky-developer ${PREFIX} ${EXTRA_PYTHON} --with-profiling-data"
 
-samba_libs_envvars =  "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH"
+samba_libs_envvars = "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH"
 samba_libs_envvars += " PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig"
 samba_libs_envvars += " ADDITIONAL_CFLAGS='-Wmissing-prototypes'"
 samba_libs_configure_base = samba_libs_envvars + " ./configure --abi-check --enable-debug --picky-developer -C ${PREFIX}"
@@ -91,16 +91,16 @@ else:
     extra_python = "--extra-python=/usr/bin/python3"
 
 tasks = {
-    "ctdb" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
+    "ctdb": [("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
                ("configure", "./configure " + ctdb_configure_params, "text/plain"),
                ("make", "make all", "text/plain"),
                ("install", "make install", "text/plain"),
                ("test", "make autotest", "text/plain"),
                ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
-               ("clean", "make clean", "text/plain") ],
+               ("clean", "make clean", "text/plain")],
 
     # We have 'test' before 'install' because, 'test' should work without 'install (runs ad_dc_ntvfs and all the other envs)'
-    "samba" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
+    "samba": [("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
                 ("make", "make -j", "text/plain"),
                 ("test", "make test FAIL_IMMEDIATELY=1 "
                  "TESTS='--exclude-env=none "
@@ -119,26 +119,26 @@ tasks = {
                  "text/plain"),
                 ("install", "make install", "text/plain"),
                 ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
-                ("clean", "make clean", "text/plain") ],
+                ("clean", "make clean", "text/plain")],
 
     # We split out this so the isolated nt4_dc tests do not wait for ad_dc or ad_dc_ntvfs tests (which are long)
-    "samba-nt4" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+    "samba-nt4": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
                     ("configure", "./configure.developer --without-ads --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
                     ("make", "make -j", "text/plain"),
                     ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=nt4_dc --include-env=nt4_member'", "text/plain"),
                     ("install", "make install", "text/plain"),
                     ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
-                    ("clean", "make clean", "text/plain") ],
+                    ("clean", "make clean", "text/plain")],
 
     # We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long)
-    "samba-fileserver" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
-                      ("configure", "./configure.developer --without-ad-dc --without-ldap --without-ads --without-json-audit --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
-                      ("make", "make -j", "text/plain"),
-                      ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=fileserver'", "text/plain"),
-                      ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")],
+    "samba-fileserver": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+                           ("configure", "./configure.developer --without-ad-dc --without-ldap --without-ads --without-json-audit --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
+                           ("make", "make -j", "text/plain"),
+                           ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=fileserver'", "text/plain"),
+                           ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")],
 
     # We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long)
-    "samba-ad-dc" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+    "samba-ad-dc": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
                       ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
                       ("make", "make -j", "text/plain"),
                       ("test", "make test FAIL_IMMEDIATELY=1 TESTS='"
@@ -151,18 +151,18 @@ tasks = {
                       ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")],
 
     # We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long)
-    "samba-ad-dc-2" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
-                      ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
-                      ("make", "make -j", "text/plain"),
-                      ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=chgdcpass --include-env=vampire_2000_dc --include-env=fl2000dc'", "text/plain"),
-                      ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")],
+    "samba-ad-dc-2": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+                        ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
+                        ("make", "make -j", "text/plain"),
+                        ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=chgdcpass --include-env=vampire_2000_dc --include-env=fl2000dc'", "text/plain"),
+                        ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")],
 
-    "samba-test-only" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab  --abi-check-disable" + samba_configure_params, "text/plain"),
+    "samba-test-only": [("configure", "./configure.developer --with-selftest-prefix=./bin/ab  --abi-check-disable" + samba_configure_params, "text/plain"),
                           ("make", "make -j", "text/plain"),
-                          ("test", 'make test FAIL_IMMEDIATELY=1 TESTS="${TESTS}"',"text/plain") ],
+                          ("test", 'make test FAIL_IMMEDIATELY=1 TESTS="${TESTS}"',"text/plain")],
 
     # Test cross-compile infrastructure
-    "samba-xc" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+    "samba-xc": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
                    ("configure-native", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
                    ("configure-cross-execute", "./configure.developer -b ./bin-xe --cross-compile --cross-execute=script/identity_cc.sh" \
                     " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xe/ab" + samba_configure_params, "text/plain"),
@@ -171,15 +171,15 @@ tasks = {
                    ("compare-results", "script/compare_cc_results.py ./bin/c4che/default.cache.py ./bin-xe/c4che/default.cache.py ./bin-xa/c4che/default.cache.py", "text/plain")],
 
     # test build with -O3 -- catches extra warnings and bugs, tests the ad_dc environments
-    "samba-o3" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+    "samba-o3": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
                    ("configure", "ADDITIONAL_CFLAGS='-O3' ./configure.developer --with-selftest-prefix=./bin/ab --abi-check-disable" + samba_configure_params, "text/plain"),
                    ("make", "make -j", "text/plain"),
                    ("test", "make quicktest FAIL_IMMEDIATELY=1 TESTS='--include-env=ad_dc'", "text/plain"),
                    ("install", "make install", "text/plain"),
                    ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
-                   ("clean", "make clean", "text/plain") ],
+                   ("clean", "make clean", "text/plain")],
 
-    "samba-ctdb" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+    "samba-ctdb": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
 
                      # make sure we have tdb around:
                      ("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
@@ -197,7 +197,7 @@ tasks = {
                      # clean up:
                      ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
                      ("clean", "make clean", "text/plain"),
-                     ("ctdb-clean", "cd ./ctdb && make clean", "text/plain") ],
+                     ("ctdb-clean", "cd ./ctdb && make clean", "text/plain")],
 
     "samba-libs" : [
                       ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
@@ -320,7 +320,7 @@ tasks = {
               ("install-no-lmdb", "make install", "text/plain"),
               ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
               ("distcheck", "make distcheck", "text/plain"),
-              ("clean", "make clean", "text/plain") ],
+              ("clean", "make clean", "text/plain")],
 
     "tdb" : [
               ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
@@ -330,7 +330,7 @@ tasks = {
               ("test", "make test", "text/plain"),
               ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
               ("distcheck", "make distcheck", "text/plain"),
-              ("clean", "make clean", "text/plain") ],
+              ("clean", "make clean", "text/plain")],
 
     "talloc" : [
                  ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
@@ -340,7 +340,7 @@ tasks = {
                  ("test", "make test", "text/plain"),
                  ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
                  ("distcheck", "make distcheck", "text/plain"),
-                 ("clean", "make clean", "text/plain") ],
+                 ("clean", "make clean", "text/plain")],
 
     "replace" : [
                   ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
@@ -350,7 +350,7 @@ tasks = {
                   ("test", "make test", "text/plain"),
                   ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
                   ("distcheck", "make distcheck", "text/plain"),
-                  ("clean", "make clean", "text/plain") ],
+                  ("clean", "make clean", "text/plain")],
 
     "tevent" : [
                  ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
@@ -360,22 +360,22 @@ tasks = {
                  ("test", "make test", "text/plain"),
                  ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
                  ("distcheck", "make distcheck", "text/plain"),
-                 ("clean", "make clean", "text/plain") ],
-
-    "pidl" : [
-               ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
-               ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"),
-               ("touch", "touch *.yp", "text/plain"),
-               ("make", "make", "text/plain"),
-               ("test", "make test", "text/plain"),
-               ("install", "make install", "text/plain"),
-               ("checkout-yapp-generated", "git checkout lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm", "text/plain"),
-               ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
-               ("clean", "make clean", "text/plain") ],
+                 ("clean", "make clean", "text/plain")],
+
+    "pidl": [
+        ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
+        ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"),
+        ("touch", "touch *.yp", "text/plain"),
+        ("make", "make", "text/plain"),
+        ("test", "make test", "text/plain"),
+        ("install", "make install", "text/plain"),
+        ("checkout-yapp-generated", "git checkout lib/Parse/Pidl/IDL.pm lib/Parse/Pidl/Expr.pm", "text/plain"),
+        ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
+        ("clean", "make clean", "text/plain")],
 
     # these are useful for debugging autobuild
-    'pass' : [ ("pass", 'echo passing && /bin/true', "text/plain") ],
-    'fail' : [ ("fail", 'echo failing && /bin/false', "text/plain") ]
+    'pass': [("pass", 'echo passing && /bin/true', "text/plain")],
+    'fail': [("fail", 'echo failing && /bin/false', "text/plain")]
 }
 
 def do_print(msg):
@@ -473,7 +473,7 @@ class buildlist(object):
             self.tlist.append(b)
         if options.retry:
             rebase_remote = "rebaseon"
-            retry_task = [ ("retry",
+            retry_task = [("retry",
                             '''set -e
                             git remote add -t %s %s %s
                             git fetch %s
@@ -485,13 +485,13 @@ class buildlist(object):
                               diff old_remote_branch.desc remote_branch.desc
                             done
                            ''' % (
-                               rebase_branch, rebase_remote, rebase_url,
+                                rebase_branch, rebase_remote, rebase_url,
                                rebase_remote,
                                rebase_remote, rebase_branch,
                                rebase_remote,
                                rebase_remote, rebase_branch
-                           ),
-                           "test/plain" ) ]
+                            ),
+                            "test/plain")]
 
             self.retry = builder('retry', retry_task, cp=False)
             self.need_retry = False
@@ -597,7 +597,7 @@ def cleanup():
 
 def find_git_root():
     '''get to the top of the git repo'''
-    p=os.getcwd()
+    p = os.getcwd()
     while p != '/':
         if os.path.isdir(os.path.join(p, ".git")):
             return p
@@ -656,7 +656,7 @@ def rebase_tree(rebase_url, rebase_branch = "master"):
                    dir=test_master, output=True)
     if diff == '':
         do_print("No differences between HEAD and %s/%s - exiting" %
-              (rebase_remote, rebase_branch))
+                 (rebase_remote, rebase_branch))
         sys.exit(0)
     run_cmd("git describe %s/%s" %
             (rebase_remote, rebase_branch),