Esempio n. 1
0
    def test_get_trusted_client_domain_name(self):
        self.config.config(**{
            'group': "service_credentials",
            'user_domain_name': "testdomain"
        })

        client = keystone_client.get_trusted_client(self.config.conf,
                                                    "testing")
        self.assertEqual(client.session.auth._user_domain_name, "testdomain")
        self.assertEqual(client.session.auth._user_domain_id, '')
Esempio n. 2
0
    def notify(self, action, alarm_id, alarm_name, severity, previous, current,
               reason, reason_data):
        trust_id = action.username

        client = keystone_client.get_trusted_client(self.conf, trust_id)

        # Remove the fake user
        netloc = action.netloc.split("@")[1]
        # Remove the trust prefix
        scheme = action.scheme[6:]

        action = parse.SplitResult(scheme, netloc, action.path, action.query,
                                   action.fragment)

        headers = {'X-Auth-Token': keystone_client.get_auth_token(client)}
        super(TrustRestAlarmNotifier, self).notify(
            action, alarm_id, alarm_name, severity, previous, current, reason,
            reason_data, headers)
Esempio n. 3
0
    def notify(self, action, alarm_id, alarm_name, severity, previous, current,
               reason, reason_data):
        trust_id = action.username

        client = keystone_client.get_trusted_client(self.conf, trust_id)

        # Remove the fake user
        netloc = action.netloc.split("@")[1]
        # Remove the trust prefix
        scheme = action.scheme[6:]

        action = parse.SplitResult(scheme, netloc, action.path, action.query,
                                   action.fragment)

        headers = {'X-Auth-Token': keystone_client.get_auth_token(client)}
        super(TrustRestAlarmNotifier,
              self).notify(action, alarm_id, alarm_name, severity, previous,
                           current, reason, reason_data, headers)