Revert "Allow admin user to get all tenant's floating IPs"

This reverts commit 02328d3337.

As per the comments on the support all-tenants in floatingips-list
spec [1], this patch reverts the --all-tenants flag from
python-novaclient since support has been reverted out of Nova more
than a year ago.

[1] https://review.openstack.org/#/c/171389/

Change-Id: I2d6566ecf59d307e3ea117b3b20dc918c758b63e
This commit is contained in:
Artom Lifshitz 2015-06-15 15:25:37 -04:00
parent 7d12815605
commit 3026ea9296
4 changed files with 4 additions and 22 deletions

View File

@ -31,12 +31,6 @@ class FloatingIPsTest(utils.FixturedTestCase):
for fip in fips:
self.assertIsInstance(fip, floating_ips.FloatingIP)
def test_list_floating_ips_all_tenants(self):
fips = self.cs.floating_ips.list(all_tenants=True)
self.assert_called('GET', '/os-floating-ips?all_tenants=1')
for fip in fips:
self.assertIsInstance(fip, floating_ips.FloatingIP)
def test_delete_floating_ip(self):
fl = self.cs.floating_ips.list()[0]
fl.delete()

View File

@ -1277,10 +1277,6 @@ class ShellTest(utils.TestCase):
self.run_command('floating-ip-list')
self.assert_called('GET', '/os-floating-ips')
def test_floating_ip_list_all_tenants(self):
self.run_command('floating-ip-list --all-tenants')
self.assert_called('GET', '/os-floating-ips?all_tenants=1')
def test_floating_ip_create(self):
self.run_command('floating-ip-create')
self.assert_called('GET', '/os-floating-ips/1')

View File

@ -28,14 +28,11 @@ class FloatingIP(base.Resource):
class FloatingIPManager(base.ManagerWithFind):
resource_class = FloatingIP
def list(self, all_tenants=False):
def list(self):
"""
List floating IPs
"""
url = '/os-floating-ips'
if all_tenants:
url += '?all_tenants=1'
return self._list(url, "floating_ips")
return self._list("/os-floating-ips", "floating_ips")
def create(self, pool=None):
"""

View File

@ -2476,14 +2476,9 @@ def do_floating_ip_delete(cs, args):
args.address)
@cliutils.arg(
'--all-tenants',
action='store_true',
default=False,
help=_('Display floatingips from all tenants (Admin only).'))
def do_floating_ip_list(cs, args):
def do_floating_ip_list(cs, _args):
"""List floating IPs."""
_print_floating_ip_list(cs.floating_ips.list(args.all_tenants))
_print_floating_ip_list(cs.floating_ips.list())
def do_floating_ip_pool_list(cs, _args):