/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: Björn Påhlsson
  • Date: 2011-12-03 14:19:48 UTC
  • mfrom: (518.2.10 persistent-state-gpgme)
  • mto: This revision was merged to the branch mainline in revision 524.
  • Revision ID: belorn@recompile.se-20111203141948-jq8899pinnglhcpg
merge

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))
1069
1069
        datetime_to_dbus, "LastApprovalRequest")
1070
1070
    approved_by_default = notifychangeproperty(dbus.Boolean,
1071
1071
                                               "ApprovedByDefault")
1072
 
    approval_delay = notifychangeproperty(dbus.UInt16,
 
1072
    approval_delay = notifychangeproperty(dbus.UInt64,
1073
1073
                                          "ApprovalDelay",
1074
1074
                                          type_func =
1075
1075
                                          timedelta_to_milliseconds)
1076
1076
    approval_duration = notifychangeproperty(
1077
 
        dbus.UInt16, "ApprovalDuration",
 
1077
        dbus.UInt64, "ApprovalDuration",
1078
1078
        type_func = timedelta_to_milliseconds)
1079
1079
    host = notifychangeproperty(dbus.String, "Host")
1080
 
    timeout = notifychangeproperty(dbus.UInt16, "Timeout",
 
1080
    timeout = notifychangeproperty(dbus.UInt64, "Timeout",
1081
1081
                                   type_func =
1082
1082
                                   timedelta_to_milliseconds)
1083
1083
    extended_timeout = notifychangeproperty(
1084
 
        dbus.UInt16, "ExtendedTimeout",
 
1084
        dbus.UInt64, "ExtendedTimeout",
1085
1085
        type_func = timedelta_to_milliseconds)
1086
 
    interval = notifychangeproperty(dbus.UInt16,
 
1086
    interval = notifychangeproperty(dbus.UInt64,
1087
1087
                                    "Interval",
1088
1088
                                    type_func =
1089
1089
                                    timedelta_to_milliseconds)
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",
2236
2236
                    if (name != "secret" and
2237
2237
                        value != old_client_settings[client_name]
2238
2238
                        [name]):
2239
 
                        setattr(client, name, value)
 
2239
                        client[name] = value
2240
2240
                except KeyError:
2241
2241
                    pass
2242
2242
            
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: