/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos-monitor

  • Committer: Björn Påhlsson
  • Date: 2010-09-07 18:48:56 UTC
  • mto: (237.4.3 mandos-release)
  • mto: This revision was merged to the branch mainline in revision 421.
  • Revision ID: belorn@fukt.bsnet.se-20100907184856-waz6cvxbm7ranha2
added the actually plugin file for plymouth

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
        pass
190
190
    
191
191
    def got_secret(self):
192
 
        self.last_checker_failed = False
193
192
        self.logger(u'Client %s received its secret'
194
193
                    % self.properties[u"name"])
195
194
    
239
238
                      % {u"name": self.properties[u"name"]})
240
239
        if not self.properties[u"enabled"]:
241
240
            message = u"DISABLED"
242
 
        elif self.properties[u"approved_pending"]:
243
 
            if self.properties[u"approved_by_default"]:
244
 
                message = u"Connection established to client. (d)eny?"
245
 
            else:
246
 
                message = u"Seeks approval to send secret. (a)pprove?"
247
241
        elif self.last_checker_failed:
248
242
            timeout = datetime.timedelta(milliseconds
249
243
                                         = self.properties[u"timeout"])
252
246
                     or self.properties["created"]),
253
247
                    self.properties[u"last_enabled"]))
254
248
            timer = timeout - (datetime.datetime.utcnow() - last_ok)
 
249
 
255
250
            message = (u'A checker has failed! Time until client gets diabled: %s'
256
 
                           % unicode(timer).rsplit(".", 1)[0])
 
251
                           % unicode(timer))
 
252
        elif self.properties[u"approved_pending"]:
 
253
            if self.properties[u"approved_by_default"]:
 
254
                message = u"Connection established to client. (d)eny?"
 
255
            else:
 
256
                message = u"Seeks approval to send secret. (a)pprove?"
257
257
        else:
258
258
            message = u"enabled"
259
259
        self._text = "%s%s" % (base, message)
663
663
ui = UserInterface()
664
664
try:
665
665
    ui.run()
666
 
except KeyboardInterrupt:
667
 
    ui.screen.stop()
668
666
except Exception, e:
669
667
    ui.log_message(unicode(e))
670
668
    ui.screen.stop()