/mandos/release

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

« back to all changes in this revision

Viewing changes to mandos-monitor

  • Committer: Björn Påhlsson
  • Date: 2010-09-08 19:12:04 UTC
  • mto: (237.7.1 mandos)
  • mto: This revision was merged to the branch mainline in revision 270.
  • Revision ID: belorn@fukt.bsnet.se-20100908191204-svjb4wktrd0unu3m
added approval to mandos-ctl

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