summaryrefslogtreecommitdiff
path: root/ironic/db/sqlalchemy/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'ironic/db/sqlalchemy/api.py')
-rw-r--r--ironic/db/sqlalchemy/api.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/ironic/db/sqlalchemy/api.py b/ironic/db/sqlalchemy/api.py
index 297a81d76..e702a38ad 100644
--- a/ironic/db/sqlalchemy/api.py
+++ b/ironic/db/sqlalchemy/api.py
@@ -792,11 +792,17 @@ class Connection(api.Connection):
'online': True})
return ref
- def get_conductor(self, hostname):
+ def get_conductor_list(self, limit=None, marker=None,
+ sort_key=None, sort_dir=None):
+ return _paginate_query(models.Conductor, limit, marker,
+ sort_key, sort_dir)
+
+ def get_conductor(self, hostname, online=True):
try:
- return (model_query(models.Conductor)
- .filter_by(hostname=hostname, online=True)
- .one())
+ query = model_query(models.Conductor).filter_by(hostname=hostname)
+ if online is not None:
+ query = query.filter_by(online=online)
+ return query.one()
except NoResultFound:
raise exception.ConductorNotFound(conductor=hostname)