Merge "manage: Do not use set_defaults on parent parsers with py2"
This commit is contained in:
commit
19d9b2b2c5
@ -10,6 +10,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import six
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
@ -43,6 +44,8 @@ def add_db_command_parsers(subparsers):
|
|||||||
# help text.
|
# help text.
|
||||||
subparsers.required = False
|
subparsers.required = False
|
||||||
parser = subparsers.add_parser('db')
|
parser = subparsers.add_parser('db')
|
||||||
|
# Avoid https://bugs.python.org/issue9351 with cpython < 2.7.9
|
||||||
|
if not six.PY2:
|
||||||
parser.set_defaults(func=parser.print_help)
|
parser.set_defaults(func=parser.print_help)
|
||||||
db_parser = parser.add_subparsers(description='database commands')
|
db_parser = parser.add_subparsers(description='database commands')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user