Merge "Support to list software configs"

This commit is contained in:
Jenkins
2015-06-28 10:36:12 +00:00
committed by Gerrit Code Review
15 changed files with 164 additions and 16 deletions

View File

@@ -306,6 +306,14 @@ def software_config_get(context, config_id):
return IMPL.software_config_get(context, config_id)
def software_config_get_all(context, limit=None, marker=None,
tenant_safe=True):
return IMPL.software_config_get_all(context,
limit=limit,
marker=marker,
tenant_safe=tenant_safe)
def software_config_delete(context, config_id):
return IMPL.software_config_delete(context, config_id)

View File

@@ -873,6 +873,15 @@ def software_config_get(context, config_id):
return result
def software_config_get_all(context, limit=None, marker=None,
tenant_safe=True):
query = model_query(context, models.SoftwareConfig)
if tenant_safe:
query = query.filter_by(tenant=context.tenant_id)
return _paginate_query(context, query, models.SoftwareConfig,
limit=limit, marker=marker).all()
def software_config_delete(context, config_id):
config = software_config_get(context, config_id)
session = orm_session.Session.object_session(config)