[SCM] build.samba.org - branch master updated

Jelmer Vernooij jelmer at samba.org
Mon Nov 8 02:14:25 MST 2010


The branch, master has been updated
       via  fde3b84 Add convenience function for opening host database.
      from  d520eea Add debug

http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fde3b8486ac056ec125e4ce3e33d882aa6401f32
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Nov 8 08:52:54 2010 +0100

    Add convenience function for opening host database.

-----------------------------------------------------------------------

Summary of changes:
 admin.py              |    7 +++++--
 buildfarm/__init__.py |   24 ++++++++++++++++++++++++
 mail-dead-hosts.py    |    8 +++++---
 web/build.py          |    3 ++-
 4 files changed, 36 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/admin.py b/admin.py
index 731876c..d94b572 100755
--- a/admin.py
+++ b/admin.py
@@ -17,7 +17,10 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-from buildfarm import hostdb
+from buildfarm import (
+    hostdb,
+    open_hostdb,
+    )
 import commands
 import os
 import smtplib
@@ -25,7 +28,7 @@ import sys
 import time
 from email.MIMEText import MIMEText
 
-db = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), "hostdb.sqlite"))
+db = open_hostdb()
 
 dry_run = False
 
diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py
index 8b13789..e133cda 100644
--- a/buildfarm/__init__.py
+++ b/buildfarm/__init__.py
@@ -1 +1,25 @@
+#!/usr/bin/python
+# Simple database query script for the buildfarm
+#
+# Copyright (C) Jelmer Vernooij <jelmer at samba.org>	   2010
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+import os
+
+def open_hostdb():
+    from buildfarm import hostdb
+    return hostdb.HostDatabase(
+        os.path.join(os.path.dirname(__file__), "..", "hostdb.sqlite"))
diff --git a/mail-dead-hosts.py b/mail-dead-hosts.py
index ca42a3b..725baa3 100755
--- a/mail-dead-hosts.py
+++ b/mail-dead-hosts.py
@@ -17,13 +17,15 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-from buildfarm import hostdb
+from buildfarm import (
+    hostdb,
+    open_hostdb,
+    )
 import smtplib
 from email.MIMEText import MIMEText
-import os
 import time
 
-db = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), "hostdb.sqlite"))
+db = open_hostdb()
 dry_run = False
 
 hosts = db.dead_hosts(7 * 86400)
diff --git a/web/build.py b/web/build.py
index 93c6086..b63061b 100755
--- a/web/build.py
+++ b/web/build.py
@@ -33,6 +33,7 @@ from buildfarm import (
     data,
     history,
     hostdb,
+    open_hostdb,
     util,
     )
 
@@ -47,7 +48,7 @@ basedir = os.path.abspath(os.path.join(webdir, ".."))
 
 db = data.BuildResultStore(basedir)
 history = history.History(db)
-hostsdb = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), "..", "hostdb.sqlite"))
+hostsdb = open_hostdb()
 
 compilers = db.compilers
 hosts = dict([(host.name, host) for host in hostsdb.hosts()])


-- 
build.samba.org


More information about the samba-cvs mailing list