Exemplo n.º 1
0
 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}")
Exemplo n.º 2
0
 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])
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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])
Exemplo n.º 5
0
 def test_find_endpoint_by_url(self):
     url = keystone.list_endpoints()[-1].url
     endpoint = keystone.find_endpoint(url=url)
     self.assertEqual(url, endpoint.url)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 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)