self.add_host_type(doc, "Compute", az['zoneName'])
return doc
- # fetch more details of network nodes from neutron.agents table
+ # fetch more details of network nodes from neutron DB agents table
def fetch_network_node_details(self, docs):
hosts = {}
for doc in docs:
return otep
def get_udp_port(self, otep):
- table_name = "neutron.ml2_" + otep['overlay_type'] + "_endpoints"
+ table_name = "{}.ml2_{}_endpoints".format(self.neutron_db,
+ otep['overlay_type'])
results = None
try:
results = self.get_objects_list_for_id(
def get(self, id):
query = """
SELECT DISTINCT host, host AS id, configurations
- FROM neutron.agents
+ FROM {}.agents
WHERE agent_type = 'Metadata agent'
- """
+ """.format(self.neutron_db)
results = self.get_objects_list(query, "host")
for r in results:
self.set_host_details(r)
return []
tunnel_type = vedge["configurations"]["tunnel_types"][0]
host_id = vedge["host"]
- table_name = "neutron.ml2_" + tunnel_type + "_endpoints"
+ table_name = "{}.ml2_{}_endpoints".format(self.neutron_db, tunnel_type)
env_config = self.config.get_env_config()
distribution = env_config["distribution"]
if distribution == "Canonical-icehouse":
return result[0]['id'] if result != [] else None
def get_id_by_field(self, id, search=''):
- query = """SELECT id FROM neutron.ports where network_id = %s AND """ + search
+ query = """SELECT id FROM {}.ports where network_id = %s AND {}"""\
+ .format(self.neutron_db, search)
result = self.get_objects_list_for_id(query, "port", id)
- return result[0]['id'] if result != [] else None
\ No newline at end of file
+ return result[0]['id'] if result != [] else None