diff options
| author | Ewan Mellor <ewan.mellor@citrix.com> | 2010-07-24 02:49:20 +0100 |
|---|---|---|
| committer | Ewan Mellor <ewan.mellor@citrix.com> | 2010-07-24 02:49:20 +0100 |
| commit | effbd4b4c7077043c0ff2ddcb91607b4e79796f6 (patch) | |
| tree | a9a4c628533c64211b349c9c3d713ddd9b113c8f /nova/endpoint | |
| parent | 1046fd21fad35fdb9922f667017937ec94774498 (diff) | |
| parent | 809a1fe80b9922a36c64bce948588a5797cae87b (diff) | |
| download | nova-effbd4b4c7077043c0ff2ddcb91607b4e79796f6.tar.gz nova-effbd4b4c7077043c0ff2ddcb91607b4e79796f6.tar.xz nova-effbd4b4c7077043c0ff2ddcb91607b4e79796f6.zip | |
Merged with trunk, since a lot of useful things have gone in there recently.
Diffstat (limited to 'nova/endpoint')
| -rw-r--r-- | nova/endpoint/cloud.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/nova/endpoint/cloud.py b/nova/endpoint/cloud.py index 51f5c859b..48e47018a 100644 --- a/nova/endpoint/cloud.py +++ b/nova/endpoint/cloud.py @@ -454,21 +454,21 @@ class CloudController(object): def format_addresses(self, context): addresses = [] - # TODO(vish): move authorization checking into network.py for address in self.network.host_objs: - #logging.debug(address_record) - address_rv = { - 'public_ip': address['address'], - 'instance_id' : address.get('instance_id', 'free') - } - if context.user.is_admin(): - address_rv['instance_id'] = "%s (%s, %s)" % ( - address['instance_id'], - address['user_id'], - address['project_id'], - ) + # TODO(vish): implement a by_project iterator for addresses + if (context.user.is_admin() or + address['project_id'] == self.project.id): + address_rv = { + 'public_ip': address['address'], + 'instance_id' : address.get('instance_id', 'free') + } + if context.user.is_admin(): + address_rv['instance_id'] = "%s (%s, %s)" % ( + address['instance_id'], + address['user_id'], + address['project_id'], + ) addresses.append(address_rv) - # logging.debug(addresses) return {'addressesSet': addresses} @rbac.allow('netadmin') |
