diff options
author | André Erdmann <dywi@mailerd.de> | 2013-09-23 15:11:44 +0200 |
---|---|---|
committer | André Erdmann <dywi@mailerd.de> | 2013-09-23 15:11:44 +0200 |
commit | 0e40ceb1def1dfb66aac5545a53eea27e82f9fe6 (patch) | |
tree | 2a6c8e09d71c7748a3329b8aa489db534ec330ab /roverlay/status.py | |
parent | doc/html/usage.rst: roverlay-setup[-interactive] (diff) | |
download | R_overlay-0e40ceb1def1dfb66aac5545a53eea27e82f9fe6.tar.gz R_overlay-0e40ceb1def1dfb66aac5545a53eea27e82f9fe6.tar.bz2 R_overlay-0e40ceb1def1dfb66aac5545a53eea27e82f9fe6.zip |
roverlay-status: do not fail if db is missing
Diffstat (limited to 'roverlay/status.py')
-rw-r--r-- | roverlay/status.py | 25 |
1 files 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() |