Fix --max-count handling for nova-manage cell_v2 map_instances

Code is added to define destination for cell_uuid and max_count
argument, otherwise specifying --max-count fails with:

TypeError: map_instances() got an unexpected keyword argument 'max-count'

Change-Id: I9328a20b97977bfffa21df55bd4d60e711a406a7
Closes-Bug: #1715533
(cherry picked from commit 87a53cc452)
(cherry picked from commit c3f3f62b09)
(cherry picked from commit f5e8060441)
This commit is contained in:
ejbaek 2017-09-09 11:59:41 +00:00 committed by Matt Riedemann
parent bcc88d4cad
commit 8e0ed9d853
1 changed files with 5 additions and 4 deletions

View File

@ -1323,10 +1323,11 @@ class CellV2Commands(object):
marker = instances[-1].uuid
return marker
@args('--cell_uuid', metavar='<cell_uuid>', required=True,
help='Unmigrated instances will be mapped to the cell with the '
'uuid provided.')
@args('--max-count', metavar='<max_count>',
@args('--cell_uuid', metavar='<cell_uuid>', dest='cell_uuid',
required=True,
help='Unmigrated instances will be mapped to the cell with the '
'uuid provided.')
@args('--max-count', metavar='<max_count>', dest='max_count',
help='Maximum number of instances to map')
def map_instances(self, cell_uuid, max_count=None):
"""Map instances into the provided cell.