/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

  • Committer: Teddy Hogeborn
  • Date: 2011-11-29 19:25:06 UTC
  • mto: (518.1.13 mandos-persistent)
  • mto: This revision was merged to the branch mainline in revision 524.
  • Revision ID: teddy@recompile.se-20111129192506-nifzr9eyvhtjl0ld
* mandos (ClientDBus.Host_dbus_property,
  ClientDBus.Checker_dbus_property): Bug fix: force value to unicode.
  (main): Bug fix: Corrected logic for enabling expired restored
          clients.

Show diffs side-by-side

added added

removed removed

Lines of Context:
576
576
        self.checker_callback_tag = None
577
577
        self.checker = None
578
578
        if os.WIFEXITED(condition):
579
 
            self.last_checker_status =  os.WEXITSTATUS(condition)
 
579
            self.last_checker_status = os.WEXITSTATUS(condition)
580
580
            if self.last_checker_status == 0:
581
581
                logger.info("Checker for %(name)s succeeded",
582
582
                            vars(self))
1280
1280
    def Host_dbus_property(self, value=None):
1281
1281
        if value is None:       # get
1282
1282
            return dbus.String(self.host)
1283
 
        self.host = value
 
1283
        self.host = unicode(value)
1284
1284
    
1285
1285
    # Created - property
1286
1286
    @dbus_service_property(_interface, signature="s", access="read")
1380
1380
    def Checker_dbus_property(self, value=None):
1381
1381
        if value is None:       # get
1382
1382
            return dbus.String(self.checker_command)
1383
 
        self.checker_command = value
 
1383
        self.checker_command = unicode(value)
1384
1384
    
1385
1385
    # CheckerRunning - property
1386
1386
    @dbus_service_property(_interface, signature="b",
2244
2244
            # enabled if its last checker was sucessful.  Clients
2245
2245
            # whose checker failed before we stored its state is
2246
2246
            # assumed to have failed all checkers during downtime.
2247
 
            if client["enabled"] and client["last_checked_ok"]:
2248
 
                if ((datetime.datetime.utcnow()
2249
 
                     - client["last_checked_ok"])
2250
 
                    > client["interval"]):
 
2247
            if client["enabled"]:
 
2248
                if client["expires"] <= (datetime.datetime
 
2249
                                         .utcnow()):
 
2250
                    # Client has expired
2251
2251
                    if client["last_checker_status"] != 0:
2252
2252
                        client["enabled"] = False
2253
2253
                    else: