summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authoryayogev <yaronyogev@gmail.com>2017-08-28 13:45:07 +0300
committeryayogev <yaronyogev@gmail.com>2017-08-28 13:45:07 +0300
commit7928f7a3130d6c490258cd7086b663dc15bcd633 (patch)
treeae2ff7743a6c70ec9c5979d7e03864191198ef1e /app
parent834c0f5899a7823ce77453aae4add76245b794c6 (diff)
use neutron DB name, not always 'neutron'
Change-Id: I971f22473d4132bde17e0a44ada3b6a8330522b4 Signed-off-by: yayogev <yaronyogev@gmail.com>
Diffstat (limited to 'app')
-rw-r--r--app/discover/fetchers/api/api_fetch_project_hosts.py2
-rw-r--r--app/discover/fetchers/cli/cli_fetch_oteps_lxb.py3
-rw-r--r--app/discover/fetchers/db/db_fetch_az_network_hosts.py4
-rw-r--r--app/discover/fetchers/db/db_fetch_oteps.py2
-rw-r--r--app/discover/fetchers/db/db_fetch_port.py5
5 files changed, 9 insertions, 7 deletions
diff --git a/app/discover/fetchers/api/api_fetch_project_hosts.py b/app/discover/fetchers/api/api_fetch_project_hosts.py
index 7dc262e..5b911f5 100644
--- a/app/discover/fetchers/api/api_fetch_project_hosts.py
+++ b/app/discover/fetchers/api/api_fetch_project_hosts.py
@@ -109,7 +109,7 @@ class ApiFetchProjectHosts(ApiAccess, DbAccess):
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:
diff --git a/app/discover/fetchers/cli/cli_fetch_oteps_lxb.py b/app/discover/fetchers/cli/cli_fetch_oteps_lxb.py
index 1e65a14..0b425f6 100644
--- a/app/discover/fetchers/cli/cli_fetch_oteps_lxb.py
+++ b/app/discover/fetchers/cli/cli_fetch_oteps_lxb.py
@@ -69,7 +69,8 @@ class CliFetchOtepsLxb(CliAccess, DbAccess):
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(
diff --git a/app/discover/fetchers/db/db_fetch_az_network_hosts.py b/app/discover/fetchers/db/db_fetch_az_network_hosts.py
index 09043ea..700b1cd 100644
--- a/app/discover/fetchers/db/db_fetch_az_network_hosts.py
+++ b/app/discover/fetchers/db/db_fetch_az_network_hosts.py
@@ -17,9 +17,9 @@ class DbFetchAZNetworkHosts(DbAccess):
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)
diff --git a/app/discover/fetchers/db/db_fetch_oteps.py b/app/discover/fetchers/db/db_fetch_oteps.py
index 9055c11..3e3f4e1 100644
--- a/app/discover/fetchers/db/db_fetch_oteps.py
+++ b/app/discover/fetchers/db/db_fetch_oteps.py
@@ -32,7 +32,7 @@ class DbFetchOteps(DbAccess, CliAccess, metaclass=Singleton):
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":
diff --git a/app/discover/fetchers/db/db_fetch_port.py b/app/discover/fetchers/db/db_fetch_port.py
index 2cb814a..2b83fa0 100644
--- a/app/discover/fetchers/db/db_fetch_port.py
+++ b/app/discover/fetchers/db/db_fetch_port.py
@@ -29,6 +29,7 @@ class DbFetchPort(DbAccess):
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