#NEWLINE# def parse_args( self , args ) : #NEWLINE# #INDENT# def print_usage( ) : #NEWLINE# #INDENT# return "\nInstall Mesosophere's Data Center Operating System\n\ndcos_installer [-h] [-f LOG_FILE] [--hash-password HASH_PASSWORD] [-v]\n[--web | --genconf | --preflight | --deploy | --postflight | --uninstall | --validate-config | --test]\n\nEnvironment Settings:\n\n  PORT                  Set the :port to run the web UI\n  CHANNEL_NAME          ADVANCED - Set build channel name\n  BOOTSTRAP_ID          ADVANCED - Set bootstrap ID for build\n\n" #NEWLINE# #UNINDENT# '\n        Parse CLI arguments and return a map of options.\n        ' #NEWLINE# parser = argparse . ArgumentParser ( usage = print_usage ( ) ) #NEWLINE# mutual_exc = parser . add_mutually_exclusive_group ( ) #NEWLINE# parser . add_argument ( '--hash-password' , default = '' , type = str , help = 'Hash a password on the CLI for use in the config.yaml.' ) #NEWLINE# parser . add_argument ( '-v' , '--verbose' , action = 'store_true' , default = False , help = 'Verbose log output (DEBUG).' ) #NEWLINE# parser . add_argument ( '-p' , '--port' , type = int , default = 9000 , help = argparse . SUPPRESS ) #NEWLINE# parser . add_argument ( '--offline' , action = 'store_true' , default = False , help = 'Do not install preflight prerequisites on CentOS7, RHEL7 in web mode' ) #NEWLINE# mutual_exc . add_argument ( '--web' , action = 'store_true' , default = False , help = 'Run the web interface.' ) #NEWLINE# mutual_exc . add_argument ( '--genconf' , action = 'store_true' , default = False , help = 'Execute the configuration generation (genconf).' ) #NEWLINE# mutual_exc . add_argument ( '--preflight' , action = 'store_true' , default = False , help = 'Execute the preflight checks on a series of nodes.' ) #NEWLINE# mutual_exc . add_argument ( '--install-prereqs' , action = 'store_true' , default = False , help = 'Install preflight prerequisites. Works only on CentOS7 and RHEL7.' ) #NEWLINE# mutual_exc . add_argument ( '--deploy' , action = 'store_true' , default = False , help = 'Execute a deploy.' ) #NEWLINE# mutual_exc . add_argument ( '--postflight' , action = 'store_true' , default = False , help = 'Execute postflight checks on a series of nodes.' ) #NEWLINE# mutual_exc . add_argument ( '--uninstall' , action = 'store_true' , default = False , help = 'Execute uninstall on target hosts.' ) #NEWLINE# mutual_exc . add_argument ( '--validate-config' , action = 'store_true' , default = False , help = 'Validate the configuration for executing --genconf and deploy arguments in config.yaml' ) #NEWLINE# mutual_exc . add_argument ( '--test' , action = 'store_true' , default = False , help = 'Performs tests on the dcos_installer application' ) #NEWLINE# options = parser . parse_args ( args ) #NEWLINE# level = 'INFO' #NEWLINE# if options . verbose : #NEWLINE# #INDENT# level = 'DEBUG' #NEWLINE# #UNINDENT# coloredlogs . install ( level = level , level_styles = { #NEWLINE# #INDENT# 'warn' : { #NEWLINE# #INDENT# 'color' : 'yellow' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'error' : { #NEWLINE# #INDENT# 'color' : 'red' , #NEWLINE# 'bold' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , fmt = '%(message)s' , isatty = True ) #NEWLINE# log . debug ( 'Logger set to DEBUG' ) #NEWLINE# return options