Merge "manage: Do not use set_defaults on parent parsers with py2"

This commit is contained in:
Zuul 2018-11-23 13:59:44 +00:00 committed by Gerrit Code Review
commit 19d9b2b2c5
1 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
import sys
from oslo_config import cfg
@ -43,7 +44,9 @@ def add_db_command_parsers(subparsers):
# help text.
subparsers.required = False
parser = subparsers.add_parser('db')
parser.set_defaults(func=parser.print_help)
# Avoid https://bugs.python.org/issue9351 with cpython < 2.7.9
if not six.PY2:
parser.set_defaults(func=parser.print_help)
db_parser = parser.add_subparsers(description='database commands')
help = _('Sync the datatabse to the current version.')