/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: 2015-08-10 10:42:52 UTC
  • Revision ID: teddy@recompile.se-20150810104252-1r6yyfwkvh5t60bz
Server Bug fix: Make D-Bus introspection work again.

* mandos (DBusObjectWithObjectManager.Introspect): Bug fix; call
                                                   method Introspect,
                                                   not class
                                                   DBusObjectWithAnnotations.
  (alternate_dbus_interfaces/wrapper/fixscope): Make wrapped D-Bus
                                                signal function look
                                                like a D-Bus signal so
                                                Introspect can see it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1154
1154
    def InterfacesAdded(self, object_path, interfaces_and_properties):
1155
1155
        pass
1156
1156
    
1157
 
    @dbus.service.signal(dbus.OBJECT_MANAGER_IFACE,
1158
 
                         signature = "oas")
 
1157
    @dbus.service.signal(dbus.OBJECT_MANAGER_IFACE, signature = "oas")
1159
1158
    def InterfacesRemoved(self, object_path, interfaces):
1160
1159
        pass
1161
1160
    
1169
1168
        Override return argument name of GetManagedObjects to be
1170
1169
        "objpath_interfaces_and_properties"
1171
1170
        """
1172
 
        xmlstring = DBusObjectWithAnnotations(self, object_path,
1173
 
                                              connection)
 
1171
        xmlstring = DBusObjectWithAnnotations.Introspect(self,
 
1172
                                                         object_path,
 
1173
                                                         connection)
1174
1174
        try:
1175
1175
            document = xml.dom.minidom.parseString(xmlstring)
1176
1176
            
1291
1291
                        func1 and func2 to the "call_both" function
1292
1292
                        outside of its arguments"""
1293
1293
                        
 
1294
                        @functools.wraps(func2)
1294
1295
                        def call_both(*args, **kwargs):
1295
1296
                            """This function will emit two D-Bus
1296
1297
                            signals by calling func1 and func2"""
1297
1298
                            func1(*args, **kwargs)
1298
1299
                            func2(*args, **kwargs)
 
1300
                        # Make wrapper function look like a D-Bus signal
 
1301
                        for name, attr in inspect.getmembers(func2):
 
1302
                            if name.startswith("_dbus_"):
 
1303
                                setattr(call_both, name, attr)
1299
1304
                        
1300
1305
                        return call_both
1301
1306
                    # Create the "call_both" function and add it to