Exemplo n.º 1
0
def get_creds_proxy():
    """Get the CredentialsManagement proxy."""
    bus = dbus.SessionBus()
    try:
        obj = bus.get_object(DBUS_BUS_NAME, DBUS_CREDENTIALS_PATH, follow_name_owner_changes=True)
        proxy = dbus.Interface(obj, DBUS_CREDENTIALS_IFACE)
    except:
        logger.exception("get_creds_proxy:")
        raise

    return proxy
Exemplo n.º 2
0
    def _get_sso_proxy(self):
        """Get the SSO dbus proxy."""
        bus = dbus.SessionBus()
        # register signal handlers for each kind of error
        self.sso_match = bus.add_signal_receiver(
            self._signal_handler, member_keyword="member", dbus_interface=ubuntu_sso.DBUS_CREDENTIALS_IFACE
        )
        try:
            obj = bus.get_object(
                ubuntu_sso.DBUS_BUS_NAME, ubuntu_sso.DBUS_CREDENTIALS_PATH, follow_name_owner_changes=True
            )
            proxy = dbus.Interface(obj, ubuntu_sso.DBUS_CREDENTIALS_IFACE)
        except:
            logger.exception("get_sso_proxy:")
            raise

        return proxy