diff options
Diffstat (limited to 'app/discover/fetchers/db/db_fetch_port.py')
-rw-r--r-- | app/discover/fetchers/db/db_fetch_port.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 |