Skip to content

Commit 5dfaf4c

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove deprecated arguments in db sync command"
2 parents d65d703 + 2c94aa7 commit 5dfaf4c

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

nova/cmd/manage.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
from __future__ import print_function
2525

26-
import argparse
2726
import functools
2827
import re
2928
import sys
@@ -441,20 +440,12 @@ def _print_dict(dct, dict_property="Property", dict_value='Value'):
441440
else:
442441
print(encodeutils.safe_encode(pt.get_string()).decode())
443442

444-
@args('--version', metavar='<version>', help=argparse.SUPPRESS)
445443
@args('--local_cell', action='store_true',
446444
help='Only sync db in the local cell: do not attempt to fan-out '
447445
'to all cells')
448-
@args('version2', metavar='VERSION', nargs='?', help='Database version')
449-
def sync(self, version=None, local_cell=False, version2=None):
446+
@args('version', metavar='VERSION', nargs='?', help='Database version')
447+
def sync(self, version=None, local_cell=False):
450448
"""Sync the database up to the most recent version."""
451-
if version and not version2:
452-
print(_("DEPRECATED: The '--version' parameter was deprecated in "
453-
"the Pike cycle and will not be supported in future "
454-
"versions of nova. Use the 'VERSION' positional argument "
455-
"instead"))
456-
version2 = version
457-
458449
if not local_cell:
459450
ctxt = context.RequestContext()
460451
# NOTE(mdoff): Multiple cells not yet implemented. Currently
@@ -463,7 +454,7 @@ def sync(self, version=None, local_cell=False, version2=None):
463454
cell_mapping = objects.CellMapping.get_by_uuid(ctxt,
464455
objects.CellMapping.CELL0_UUID)
465456
with context.target_cell(ctxt, cell_mapping) as cctxt:
466-
migration.db_sync(version2, context=cctxt)
457+
migration.db_sync(version, context=cctxt)
467458
except exception.CellMappingNotFound:
468459
print(_('WARNING: cell0 mapping not found - not'
469460
' syncing cell0.'))
@@ -874,18 +865,10 @@ class ApiDbCommands(object):
874865
def __init__(self):
875866
pass
876867

877-
@args('--version', metavar='<version>', help=argparse.SUPPRESS)
878-
@args('version2', metavar='VERSION', nargs='?', help='Database version')
879-
def sync(self, version=None, version2=None):
868+
@args('version', metavar='VERSION', nargs='?', help='Database version')
869+
def sync(self, version=None):
880870
"""Sync the database up to the most recent version."""
881-
if version and not version2:
882-
print(_("DEPRECATED: The '--version' parameter was deprecated in "
883-
"the Pike cycle and will not be supported in future "
884-
"versions of nova. Use the 'VERSION' positional argument "
885-
"instead"))
886-
version2 = version
887-
888-
return migration.db_sync(version2, database='api')
871+
return migration.db_sync(version, database='api')
889872

890873
def version(self):
891874
"""Print the current database version."""
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
upgrade:
3+
- |
4+
The ``--version`` argument has been removed in the following commands.
5+
Use the ``VERSION`` positional argument instead.
6+
7+
- ``nova-manage db sync``
8+
- ``nova-manage api_db sync``

0 commit comments

Comments
 (0)