summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ironic/db/sqlalchemy/api.py6
-rw-r--r--ironic/tests/base.py10
2 files changed, 4 insertions, 12 deletions
diff --git a/ironic/db/sqlalchemy/api.py b/ironic/db/sqlalchemy/api.py
index 93a211fc3..31ec9647e 100644
--- a/ironic/db/sqlalchemy/api.py
+++ b/ironic/db/sqlalchemy/api.py
@@ -1379,12 +1379,14 @@ class Connection(api.Connection):
def list_hardware_type_interfaces(self, hardware_types):
with _session_for_read() as session:
- query = (session.query(models.ConductorHardwareInterfaces)
+ query = (session.query(models.ConductorHardwareInterfaces,
+ models.Conductor)
+ .join(models.Conductor)
.filter(models.ConductorHardwareInterfaces.hardware_type
.in_(hardware_types)))
query = _filter_active_conductors(query)
- return query.all()
+ return [row[0] for row in query]
@oslo_db_api.retry_on_deadlock
def register_conductor_hardware_interfaces(self, conductor_id, interfaces):
diff --git a/ironic/tests/base.py b/ironic/tests/base.py
index 348f15c20..1ed6cab70 100644
--- a/ironic/tests/base.py
+++ b/ironic/tests/base.py
@@ -125,16 +125,6 @@ class WarningsFixture(fixtures.Fixture):
category=sqla_exc.SAWarning,
)
- # ...but filter everything out until we get around to fixing them
- # TODO(stephenfin): Fix all of these
-
- warnings.filterwarnings(
- 'ignore',
- module='ironic',
- message='SELECT statement has a cartesian product ',
- category=sqla_exc.SAWarning,
- )
-
# FIXME(stephenfin): We can remove this once oslo.db is fixed
# https://review.opendev.org/c/openstack/oslo.db/+/856453
warnings.filterwarnings(