def discover_controller_nodes(self): endpoints = keystone.list_endpoints(interface='public') addresses = set( parse.urlparse(endpoint.url).hostname for endpoint in endpoints) for address in addresses: try: self.add_node(address=address, group='controller') except _connection.UreachableSSHServer as ex: LOG.debug(f"Unable to SSH to end point address '{address}'. " f"{ex}")
def test_list_endpoints_by_service(self): service = keystone.find_service(name='keystone') endpoints = keystone.list_endpoints(service=service) self.assertTrue(endpoints) self.assertEqual([service.id] * len(endpoints), [e.service_id for e in endpoints])
def discover_controller_nodes(self): endpoints = keystone.list_endpoints(interface='public') addresses = set( parse.urlparse(endpoint.url).hostname for endpoint in endpoints) for address in addresses: self.add_node(address=address, group='controller')
def test_list_endpoints(self): service = keystone.find_service(name='keystone') endpoints = keystone.list_endpoints() self.assertIn(service.id, [e.service_id for e in endpoints])
def test_find_endpoint_by_url(self): url = keystone.list_endpoints()[-1].url endpoint = keystone.find_endpoint(url=url) self.assertEqual(url, endpoint.url)
def test_list_endpoints_by_url(self): url = keystone.list_endpoints()[-1].url endpoints = keystone.list_endpoints(url=url) self.assertTrue(endpoints) for e in endpoints: self.assertEqual(url, e.url)
def test_list_endpoints_by_interface(self): endpoints = keystone.list_endpoints(interface='public') self.assertTrue(endpoints) for e in endpoints: self.assertEqual('public', e.interface)
def test_list_endpoints_by_service_id(self): service = keystone.find_service(name='keystone') endpoints = keystone.list_endpoints(service_id=service.id) self.assertTrue(endpoints) for e in endpoints: self.assertEqual(service.id, e.service_id)