summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStamatis Katsaounis <mokats@intracom-telecom.com>2018-10-12 10:09:06 +0300
committerStamatis Katsaounis <mokats@intracom-telecom.com>2018-11-01 16:28:12 +0200
commit5f3157c897eaa5ef538d716e905f55085654a6c5 (patch)
tree38946c9f5771ce93a4e53cb8541289f9623d219b
parent72eb4c28889c56340c7ae222c8199e564ba46e41 (diff)
Fix error on querying neutron quota
JIRA: SDNVPN-237 JIRA: SDNVPN-233 This patch fixes the bug which exists when trying to query neutron quota with openstacksdk. Change-Id: Iead824ca44f381ba314f38933cf48fe7932f74f3 Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com> (cherry picked from commit edd6cfe15ecd4e2bf608c23c6ca4612334df044b)
-rw-r--r--sdnvpn/lib/utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py
index 693a407..9a5e181 100644
--- a/sdnvpn/lib/utils.py
+++ b/sdnvpn/lib/utils.py
@@ -15,6 +15,7 @@ import requests
import re
import subprocess
from concurrent.futures import ThreadPoolExecutor
+from openstack.exceptions import ResourceNotFound
from requests.auth import HTTPBasicAuth
from opnfv.deployment.factory import Factory as DeploymentFactory
@@ -833,8 +834,8 @@ def update_instance_quota_class(cloud, instances_quota):
def get_neutron_quota(conn, tenant_id):
try:
- return conn.network.quotas(project_id=tenant_id).next()
- except Exception as e:
+ return conn.network.get_quota(tenant_id)
+ except ResourceNotFound as e:
logger.error("Error in getting network quota for tenant "
" '%s' )]: %s" % (tenant_id, e))
raise