summaryrefslogtreecommitdiff
path: root/openstack_dashboard/api/neutron.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack_dashboard/api/neutron.py')
-rw-r--r--openstack_dashboard/api/neutron.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/openstack_dashboard/api/neutron.py b/openstack_dashboard/api/neutron.py
index 49e9478..a573500 100644
--- a/openstack_dashboard/api/neutron.py
+++ b/openstack_dashboard/api/neutron.py
@@ -1728,3 +1728,15 @@ def policy_get(request, policy_id, **kwargs):
1728 policy = neutronclient(request).show_qos_policy( 1728 policy = neutronclient(request).show_qos_policy(
1729 policy_id, **kwargs).get('policy') 1729 policy_id, **kwargs).get('policy')
1730 return QoSPolicy(policy) 1730 return QoSPolicy(policy)
1731
1732
1733@profiler.trace
1734def list_availability_zones(request, resource=None, state=None):
1735 az_list = neutronclient(request).list_availability_zones().get(
1736 'availability_zones')
1737 if resource:
1738 az_list = [az for az in az_list if az['resource'] == resource]
1739 if state:
1740 az_list = [az for az in az_list if az['state'] == state]
1741
1742 return sorted(az_list, key=lambda zone: zone['name'])