Fix get all devices command
This commit is contained in:
parent
326bc6cdb0
commit
403afc3503
|
@ -81,13 +81,18 @@ class WanTcDb(object):
|
||||||
else:
|
else:
|
||||||
LOG.error('Got heartbeat for non-existing device: %s' % host)
|
LOG.error('Got heartbeat for non-existing device: %s' % host)
|
||||||
|
|
||||||
def get_all_devices(self, context):
|
def get_all_devices(self, context, filters=None,
|
||||||
device_list = context.session.query(models.WanTcDevice).all()
|
fields=None,
|
||||||
device_list_dict = []
|
sorts=None, limit=None, marker=None,
|
||||||
for device in device_list:
|
page_reverse=False):
|
||||||
device_list_dict.append(self._device_to_dict(device))
|
marker_obj = self._get_marker_obj(
|
||||||
|
context, 'wan_tc_device', limit, marker)
|
||||||
return device_list_dict
|
return self._get_collection(context, models.WanTcDevice,
|
||||||
|
self._device_to_dict,
|
||||||
|
filters=filters, fields=fields,
|
||||||
|
sorts=sorts, limit=limit,
|
||||||
|
marker_obj=marker_obj,
|
||||||
|
page_reverse=page_reverse)
|
||||||
|
|
||||||
def get_last_class_ext_id(self, context):
|
def get_last_class_ext_id(self, context):
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,8 @@ class WanQosPlugin(wanqos.WanQosPluginBase,
|
||||||
def get_wan_tc_devices(self, context, filters=None, fields=None,
|
def get_wan_tc_devices(self, context, filters=None, fields=None,
|
||||||
sorts=None, limit=None, marker=None,
|
sorts=None, limit=None, marker=None,
|
||||||
page_reverse=False):
|
page_reverse=False):
|
||||||
return self.db.get_all_devices(context)
|
return self.db.get_all_devices(context, filters, fields, sorts, limit,
|
||||||
|
marker, page_reverse)
|
||||||
|
|
||||||
def get_plugin_type(self):
|
def get_plugin_type(self):
|
||||||
"""Get type of the plugin."""
|
"""Get type of the plugin."""
|
||||||
|
|
Loading…
Reference in New Issue