X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=monitor%2Fdatabase%2Finfo%2Finterface.py;h=ef7d51097c3e4d2634de434ec5f2d4ef9b727b28;hp=d37ab2ee6261d349fcbf6c8cabfac464a4e600a2;hb=57fc3f2c580971f7a31c708764557d6273b83216;hpb=ab835ed0e99bc4c57728c8cfa61856d15dfc34f5 diff --git a/monitor/database/info/interface.py b/monitor/database/info/interface.py index d37ab2e..ef7d510 100644 --- a/monitor/database/info/interface.py +++ b/monitor/database/info/interface.py @@ -1,11 +1,13 @@ -from monitor import reboot from monitor.common import * from monitor.model import * from monitor.wrapper import plc from monitor.wrapper import plccache from monitor.wrapper.emailTxt import mailtxt from monitor.database.info.model import * +# NOTE: must import this after monitor.database.info.model b/c that imports +# pcucontro.reboot and blocks this version, if it comes last. +from monitor import reboot class SiteInterface(HistorySiteRecord): @classmethod @@ -183,7 +185,7 @@ class SiteInterface(HistorySiteRecord): def runBootManager(self, hostname): from monitor import bootman print "attempting BM reboot of %s" % hostname - ret = "" + ret = "error" try: ret = bootman.restore(self, hostname) err = "" @@ -191,10 +193,18 @@ class SiteInterface(HistorySiteRecord): err = traceback.format_exc() print err + # TODO: keep this record so that the policy.py can identify all + # bootmanager_* actions without explicitly listing every kind. act = ActionRecord(loginbase=self.db.loginbase, hostname=hostname, action='reboot', action_type='bootmanager_restore', + error_string="") + + act = ActionRecord(loginbase=self.db.loginbase, + hostname=hostname, + action='reboot', + action_type='bootmanager_' + ret, error_string=err) return ret