aboutsummaryrefslogtreecommitdiffstats
path: root/app/discover/fetchers/db
diff options
context:
space:
mode:
Diffstat (limited to 'app/discover/fetchers/db')
-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
3 files changed, 6 insertions, 5 deletions
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