Пример #1
0
 def setUp(self):
     super(TestRGWAdminClient, self).setUp()
     self.client = RGWAdminClient('http://127.0.0.1:8080/admin', 'abcde',
                                  'secret')
     self.get_resp = mock.MagicMock()
     self.get = mock.patch('requests.get',
                           return_value=self.get_resp).start()
Пример #2
0
    def _get_account_info(self, ksclient, tenants):
        endpoint = self._get_endpoint(ksclient)
        if not endpoint:
            raise StopIteration()

        try:
            from ceilometer.objectstore.rgw_client import RGWAdminClient
            rgw_client = RGWAdminClient(endpoint, self.access_key, self.secret)
        except ImportError:
            raise plugin_base.PollsterPermanentError(tenants)

        for t in tenants:
            api_method = 'get_%s' % self.METHOD
            yield t.id, getattr(rgw_client, api_method)(t.id)