diff --git a/src/www/Bongo.rules b/src/www/Bongo.rules index d02e939..14047b6 100644 --- a/src/www/Bongo.rules +++ b/src/www/Bongo.rules @@ -334,7 +334,6 @@ pkgpythonhawkeye_PYTHON = \ src/www/bongo/hawkeye/__init__.py \ src/www/bongo/hawkeye/AgentView.py \ src/www/bongo/hawkeye/AliasView.py \ - src/www/bongo/hawkeye/Auth.py \ src/www/bongo/hawkeye/BackupView.py \ src/www/bongo/hawkeye/HawkeyeHandler.py \ src/www/bongo/hawkeye/HawkeyePath.py \ @@ -363,6 +362,7 @@ pkgpythoncommonwebdir = $(pkgpythondir)/commonweb pkgpythoncommonweb_PYTHON = \ src/www/bongo/commonweb/__init__.py \ + src/www/bongo/commonweb/Auth.py \ src/www/bongo/commonweb/HttpError.py \ src/www/bongo/commonweb/ApacheLogHandler.py \ src/www/bongo/commonweb/BongoCookie.py \ diff --git a/src/www/bongo-standalone.py b/src/www/bongo-standalone.py index 1deaef8..ceacfdb 100755 --- a/src/www/bongo-standalone.py +++ b/src/www/bongo-standalone.py @@ -25,8 +25,7 @@ from bongo.commonweb.HttpError import HttpError import bongo.dragonfly.Auth import bongo.commonweb.BongoUtil import bongo.commonweb.BongoSession as BongoSession -import bongo.hawkeye.Auth -import bongo.sundial.Auth +import bongo.commonweb.Auth as Auth from bongo.hawkeye.HawkeyePath import HawkeyePath from bongo.sundial.SundialPath import SundialPath from bongo.external.simplejson import loads, dumps @@ -190,7 +189,7 @@ class DragonflyHandler(SimpleHTTPRequestHandler): if handler.NeedsAuth(rp): req.log.debug("Yup!") - auth = bongo.hawkeye.Auth.authenhandler(req) + auth = Auth.authenhandler(req) if auth != bongo.commonweb.HTTP_OK: target = "/admin/login" self.send_response(bongo.commonweb.BongoUtil.redirect(req, target)) @@ -259,7 +258,7 @@ class DragonflyHandler(SimpleHTTPRequestHandler): self.send_error(bongo.commonweb.HTTP_UNAUTHORIZED) return bongo.commonweb.HTTP_UNAUTHORIZED else: - auth = bongo.sundial.Auth.authenhandler(req) + auth = Auth.authenhandler(req) req.log.debug("request for %s (handled by %s)", req.uri, handler) diff --git a/src/www/bongo/hawkeye/Auth.py b/src/www/bongo/commonweb/Auth.py similarity index 98% rename from src/www/bongo/hawkeye/Auth.py rename to src/www/bongo/commonweb/Auth.py index e22ca47..43d93a5 100644 --- a/src/www/bongo/hawkeye/Auth.py +++ b/src/www/bongo/commonweb/Auth.py @@ -1,5 +1,5 @@ -import bongo.dragonfly.Auth from bongo.store.StoreClient import StoreClient +import bongo.commonweb import bongo.commonweb.BongoSession as BongoSession import time diff --git a/src/www/bongo/hawkeye/RootView.py b/src/www/bongo/hawkeye/RootView.py index df7cd4c..e006c9f 100644 --- a/src/www/bongo/hawkeye/RootView.py +++ b/src/www/bongo/hawkeye/RootView.py @@ -2,7 +2,7 @@ import bongo.commonweb import os import bongo.commonweb.BongoUtil from HawkeyeHandler import HawkeyeHandler -import bongo.hawkeye.Auth as Auth +import bongo.commonweb.Auth as Auth from libbongo.libs import msgapi AuthMode = 0 @@ -42,12 +42,12 @@ class RootHandler(HawkeyeHandler): # check ram free cm = self.memory("MemTotal:") used = cm - self.memory("MemFree:") - self.memory("Buffers:") - self.memory("Cached:") - used = used / (1024*1024) - cm = cm / (1024*1024) + used = used / (1024*1024) + cm = cm / (1024*1024) self.SetVariable("mem", str(round(used, 2)) + "MB / " + str(round(cm, 2)) + "MB") # check system load (rqmin1, rqmin5, rqmin15) = os.getloadavg() - recent_av = (rqmin1 + rqmin5) / 2 + recent_av = (rqmin1 + rqmin5) / 2 recent_load = "light" if recent_av > 0.7: recent_load = "moderate" diff --git a/src/www/bongo/hawkeye/Server.py b/src/www/bongo/hawkeye/Server.py index cb11cd3..fad9526 100644 --- a/src/www/bongo/hawkeye/Server.py +++ b/src/www/bongo/hawkeye/Server.py @@ -2,8 +2,8 @@ from bongo.commonweb.ApacheLogHandler import ApacheLogHandler, RequestLogProxy from HawkeyePath import HawkeyePath from bongo.commonweb.HttpError import HttpError -import Auth import bongo.commonweb +import bongo.commonweb.Auth as Auth import bongo.commonweb.BongoFieldStorage as BongoFieldStorage import bongo.commonweb.BongoUtil as BongoUtil import bongo.commonweb.BongoSession as BongoSession @@ -41,7 +41,7 @@ def handler(req): if handler.NeedsAuth(rp): req.log.debug("Yup!") - auth = bongo.hawkeye.Auth.authenhandler(req) + auth = Auth.authenhandler(req) if auth != bongo.commonweb.HTTP_OK: target = "/admin/login" BongoUtil.redirect(req, target)