Merge "[BugFix] Add 'all_tenants', 'project_id' in attachment-list"
This commit is contained in:
		@@ -133,7 +133,12 @@ class ShellTest(utils.TestCase):
 | 
			
		||||
              {'cmd': '--all-tenants 1',
 | 
			
		||||
               'expected': '?all_tenants=1'},
 | 
			
		||||
              {'cmd': '--all-tenants 1 --volume-id 12345',
 | 
			
		||||
               'expected': '?all_tenants=1&volume_id=12345'}
 | 
			
		||||
               'expected': '?all_tenants=1&volume_id=12345'},
 | 
			
		||||
              {'cmd': '--all-tenants 1 --tenant 12345',
 | 
			
		||||
               'expected': '?all_tenants=1&project_id=12345'},
 | 
			
		||||
              {'cmd': '--tenant 12345',
 | 
			
		||||
               'expected': '?all_tenants=1&project_id=12345'}
 | 
			
		||||
 | 
			
		||||
              )
 | 
			
		||||
    @ddt.unpack
 | 
			
		||||
    def test_attachment_list(self, cmd, expected):
 | 
			
		||||
 
 | 
			
		||||
@@ -1303,6 +1303,7 @@ def do_snapshot_list(cs, args):
 | 
			
		||||
                     ['ID', 'Volume ID', 'Status', 'Name', 'Size'],
 | 
			
		||||
                     sortby_index=sortby_index)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@api_versions.wraps('3.27')
 | 
			
		||||
@utils.arg('--all-tenants',
 | 
			
		||||
           dest='all_tenants',
 | 
			
		||||
@@ -1310,7 +1311,7 @@ def do_snapshot_list(cs, args):
 | 
			
		||||
           nargs='?',
 | 
			
		||||
           type=int,
 | 
			
		||||
           const=1,
 | 
			
		||||
           default=0,
 | 
			
		||||
           default=utils.env('ALL_TENANTS', default=0),
 | 
			
		||||
           help='Shows details for all tenants. Admin only.')
 | 
			
		||||
@utils.arg('--volume-id',
 | 
			
		||||
           metavar='<volume-id>',
 | 
			
		||||
@@ -1346,7 +1347,8 @@ def do_snapshot_list(cs, args):
 | 
			
		||||
def do_attachment_list(cs, args):
 | 
			
		||||
    """Lists all attachments."""
 | 
			
		||||
    search_opts = {
 | 
			
		||||
        'all_tenants': args.all_tenants,
 | 
			
		||||
        'all_tenants': 1 if args.tenant else args.all_tenants,
 | 
			
		||||
        'project_id': args.tenant,
 | 
			
		||||
        'status': args.status,
 | 
			
		||||
        'volume_id': args.volume_id,
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								releasenotes/notes/bug-1675974-34edd5g9870e65b2.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								releasenotes/notes/bug-1675974-34edd5g9870e65b2.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
---
 | 
			
		||||
fixes:
 | 
			
		||||
  - The 'tenant' argument was ignored when listing attachments,
 | 
			
		||||
    and now has been fixed.
 | 
			
		||||
    [Bug `1675974 <https://bugs.launchpad.net/bugs/1675974>`_]
 | 
			
		||||
		Reference in New Issue
	
	Block a user