<s> """<STR_LIT>""" <EOL> import sys <EOL> from oslo_config import cfg <EOL> from ironic . common . i18n import _ <EOL> from ironic . common import service <EOL> from ironic . db import migration <EOL> CONF = cfg . CONF <EOL> class DBCommand ( object ) : <EOL> def upgrade ( self ) : <EOL> migration . upgrade ( CONF . command . revision ) <EOL> def revision ( self ) : <EOL> migration . revision ( CONF . command . message , CONF . command . autogenerate ) <EOL> def stamp ( self ) : <EOL> migration . stamp ( CONF . command . revision ) <EOL> def version ( self ) : <EOL> print ( migration . version ( ) ) <EOL> def create_schema ( self ) : <EOL> migration . create_schema ( ) <EOL> def add_command_parsers ( subparsers ) : <EOL> command_object = DBCommand ( ) <EOL> parser = subparsers . add_parser ( <EOL> '<STR_LIT>' , <EOL> help = _ ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) ) <EOL> parser . set_defaults ( func = command_object . upgrade ) <EOL> parser . add_argument ( '<STR_LIT>' , nargs = '<STR_LIT:?>' ) <EOL> parser = subparsers . add_parser ( '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , nargs = '<STR_LIT:?>' ) <EOL> parser . set_defaults ( func = command_object . stamp ) <EOL> parser = subparsers . add_parser ( <EOL> '<STR_LIT>' , <EOL> help = _ ( "<STR_LIT>" <EOL> "<STR_LIT>" ) ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store_true>' ) <EOL> parser . set_defaults ( func = command_object . revision ) <EOL> parser = subparsers . add_parser ( <EOL> '<STR_LIT:version>' , <EOL> help = _ ( "<STR_LIT>" ) ) <EOL> parser . set_defaults ( func = command_object . version ) <EOL> parser = subparsers . add_parser ( <EOL> '<STR_LIT>' , <EOL> help = _ ( "<STR_LIT>" ) ) <EOL> parser . set_defaults ( func = command_object . create_schema ) <EOL> command_opt = cfg . SubCommandOpt ( '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> help = _ ( '<STR_LIT>' ) , <EOL> handler = add_command_parsers ) <EOL> CONF . register_cli_opt ( command_opt ) <EOL> def main ( ) : <EOL> valid_commands = set ( [ <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT:version>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> ] ) <EOL> if not set ( sys . argv ) & valid_commands : <EOL> sys . argv . append ( '<STR_LIT>' ) <EOL> service . prepare_service ( sys . argv ) <EOL> CONF . command . func ( ) </s>
