From 5f6adfbcc5924105a054c9e563202322d0fe516d Mon Sep 17 00:00:00 2001 From: Sachin Bansal Date: Mon, 6 Oct 2014 13:30:04 -0700 Subject: [PATCH] Fixing two issues: 1. If quota is not initialized in api server, while updating quota, we will get None. We need to handle this case. 2. Fixed a typo. Change-Id: Ic9b92792ace6d7e07895ae6dff2a01a34247e87a Closes-Bug: 1378077 --- neutron_plugin_contrail/plugins/opencontrail/quota/driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron_plugin_contrail/plugins/opencontrail/quota/driver.py b/neutron_plugin_contrail/plugins/opencontrail/quota/driver.py index f974ee2..aa28447 100644 --- a/neutron_plugin_contrail/plugins/opencontrail/quota/driver.py +++ b/neutron_plugin_contrail/plugins/opencontrail/quota/driver.py @@ -137,7 +137,7 @@ def get_all_quotas(cls, context, resources): for project in project_list: if default_quota and (project['uuid'] == default_project.uuid): continue - quotas = cls._get_tenant_quotas(context, resources, project['uuid']. + quotas = cls._get_tenant_quotas(context, resources, project['uuid'], default_quota) quotas['tenant_id'] = project['uuid'] ret_list.append(quotas) @@ -166,7 +166,7 @@ def update_quota_limit(cls, context, tenant_id, resource, limit): try: proj_id = str(uuid.UUID(tenant_id)) proj_obj = cls._get_vnc_conn().project_read(id=proj_id) - quota = proj_obj.get_quota() + quota = proj_obj.get_quota() or vnc_api.QuotaType() except vnc_exc.NoIdError: return except Exception as e: