# 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
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
+#!/usr/bin/python
+# Simple database query script for the buildfarm
+#
+# Copyright (C) Jelmer Vernooij <jelmer@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"))
# 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)
data,
history,
hostdb,
+ open_hostdb,
util,
)
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()])