~ubuntu-branches/ubuntu/trusty/horizon/trusty-updates

« back to all changes in this revision

Viewing changes to openstack_dashboard/api/lbaas.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-09-06 11:59:43 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20130906115943-h3td0l7tp16mb9oc
Tags: 1:2013.2~b3-0ubuntu1
* New upstream release.
* debian/control: Minimum python-openstack-auth version >= 1.1.1.
* debian/control: Add python-troveclient.
* debian/static: Refresh static assets for 2013.2~b3.
* debian/patches: ubuntu_local_settings.patch -> ubuntu_settings.patch, also
  patch location of secret key in openstack_dashboard/settings.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from __future__ import absolute_import
18
18
 
19
 
from openstack_dashboard.api.neutron import NeutronAPIDictWrapper
20
 
from openstack_dashboard.api.neutron import neutronclient
21
 
from openstack_dashboard.api.neutron import subnet_get
22
 
 
23
 
 
24
 
class Vip(NeutronAPIDictWrapper):
 
19
from openstack_dashboard.api import neutron
 
20
 
 
21
neutronclient = neutron.neutronclient
 
22
 
 
23
 
 
24
class Vip(neutron.NeutronAPIDictWrapper):
25
25
    """Wrapper for neutron load balancer vip"""
26
26
 
27
27
    def __init__(self, apiresource):
28
28
        super(Vip, self).__init__(apiresource)
29
29
 
30
30
 
31
 
class Pool(NeutronAPIDictWrapper):
 
31
class Pool(neutron.NeutronAPIDictWrapper):
32
32
    """Wrapper for neutron load balancer pool"""
33
33
 
34
34
    def __init__(self, apiresource):
49
49
                      'health_monitors': self.health_monitors}
50
50
        try:
51
51
            pFormatted['subnet_id'] = self.subnet_id
52
 
            pFormatted['subnet_name'] = subnet_get(
 
52
            pFormatted['subnet_name'] = neutron.subnet_get(
53
53
                request, self.subnet_id).cidr
54
 
        except:
 
54
        except Exception:
55
55
            pFormatted['subnet_id'] = self.subnet_id
56
56
            pFormatted['subnet_name'] = self.subnet_id
57
57
 
60
60
                pFormatted['vip_id'] = self.vip_id
61
61
                pFormatted['vip_name'] = vip_get(
62
62
                    request, self.vip_id).name
63
 
            except:
 
63
            except Exception:
64
64
                pFormatted['vip_id'] = self.vip_id
65
65
                pFormatted['vip_name'] = self.vip_id
66
66
        else:
70
70
        return self.AttributeDict(pFormatted)
71
71
 
72
72
 
73
 
class Member(NeutronAPIDictWrapper):
 
73
class Member(neutron.NeutronAPIDictWrapper):
74
74
    """Wrapper for neutron load balancer member"""
75
75
 
76
76
    def __init__(self, apiresource):
91
91
            mFormatted['pool_id'] = self.pool_id
92
92
            mFormatted['pool_name'] = pool_get(
93
93
                request, self.pool_id).name
94
 
        except:
 
94
        except Exception:
95
95
            mFormatted['pool_id'] = self.pool_id
96
96
            mFormatted['pool_name'] = self.pool_id
97
97
 
98
98
        return self.AttributeDict(mFormatted)
99
99
 
100
100
 
101
 
class PoolStats(NeutronAPIDictWrapper):
 
101
class PoolStats(neutron.NeutronAPIDictWrapper):
102
102
    """Wrapper for neutron load balancer pool stats"""
103
103
 
104
104
    def __init__(self, apiresource):
105
105
        super(PoolStats, self).__init__(apiresource)
106
106
 
107
107
 
108
 
class PoolMonitor(NeutronAPIDictWrapper):
 
108
class PoolMonitor(neutron.NeutronAPIDictWrapper):
109
109
    """Wrapper for neutron load balancer pool health monitor"""
110
110
 
111
111
    def __init__(self, apiresource):