From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7BDBE1381F3 for ; Mon, 23 Sep 2013 15:30:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F26ADE0AA3; Mon, 23 Sep 2013 15:30:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8E85EE0AA3 for ; Mon, 23 Sep 2013 15:30:24 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 597FB33DA71 for ; Mon, 23 Sep 2013 15:30:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 050B5E468F for ; Mon, 23 Sep 2013 15:30:22 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1379941904.0e40ceb1def1dfb66aac5545a53eea27e82f9fe6.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/status.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 0e40ceb1def1dfb66aac5545a53eea27e82f9fe6 X-VCS-Branch: master Date: Mon, 23 Sep 2013 15:30:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b69223f5-c9a6-4326-b1a2-936058005a8c X-Archives-Hash: 57e1e9cf13f1bf38a7848f4ab1ab4ea5 commit: 0e40ceb1def1dfb66aac5545a53eea27e82f9fe6 Author: André Erdmann mailerd de> AuthorDate: Mon Sep 23 13:11:44 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Sep 23 13:11:44 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=0e40ceb1 roverlay-status: do not fail if db is missing --- roverlay/status.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/roverlay/status.py b/roverlay/status.py index cb25edb..9ab00a3 100644 --- a/roverlay/status.py +++ b/roverlay/status.py @@ -322,18 +322,19 @@ class StatusRuntimeEnvironment ( roverlay.runtime.RuntimeEnvironmentBase ): # rrd_db=self.stats_db, # ) - - # transfer db cache to template_vars - # * copy lastupdate - # * import values - # - self.set_template_vars ( - self.stats_db.cache ['values'], - lastupdate=self.stats_db.cache ['lastupdate'], - STATS_DB_FILE=stats_db_file, - STATS_DB=DBStats ( self.stats_db.cache ), - ) - + if self.stats_db.cache: + # transfer db cache to template_vars + # * copy lastupdate + # * import values + # + self.set_template_vars ( + self.stats_db.cache ['values'], + lastupdate=self.stats_db.cache ['lastupdate'], + STATS_DB_FILE=stats_db_file, + STATS_DB=DBStats ( self.stats_db.cache ), + ) + else: + self.stats_db = None # -- end if self.do_setup_mako()