#NEWLINE# def error_if_missing_info( oo_cfg ) : #NEWLINE# #INDENT# missing_info = False #NEWLINE# if ( not oo_cfg . hosts ) : #NEWLINE# #INDENT# missing_info = True #NEWLINE# click . echo ( ( 'For unattended installs, hosts must be specified on the command line or in the config file: %s' % oo_cfg . config_path ) ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# if ( 'ansible_ssh_user' not in oo_cfg . settings ) : #NEWLINE# #INDENT# click . echo ( 'Must specify ansible_ssh_user in configuration file.' ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# if ( not oo_cfg . settings [ 'variant' ] ) : #NEWLINE# #INDENT# click . echo ( 'No variant specified in configuration file.' ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# ver = None #NEWLINE# if ( 'variant_version' in oo_cfg . settings ) : #NEWLINE# #INDENT# ver = oo_cfg . settings [ 'variant_version' ] #NEWLINE# #UNINDENT# ( variant , version ) = find_variant ( oo_cfg . settings [ 'variant' ] , version = ver ) #NEWLINE# if ( ( variant is None ) or ( version is None ) ) : #NEWLINE# #INDENT# err_variant_name = oo_cfg . settings [ 'variant' ] #NEWLINE# if ver : #NEWLINE# #INDENT# err_variant_name = ( '%s %s' % ( err_variant_name , ver ) ) #NEWLINE# #UNINDENT# click . echo ( ( '%s is not an installable variant.' % err_variant_name ) ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# oo_cfg . settings [ 'variant_version' ] = version . name #NEWLINE# missing_facts = oo_cfg . calc_missing_facts ( ) #NEWLINE# if ( len ( missing_facts ) > 0 ) : #NEWLINE# #INDENT# missing_info = True #NEWLINE# click . echo ( 'For unattended installs, facts must be provided for all masters/nodes:' ) #NEWLINE# for host in missing_facts : #NEWLINE# #INDENT# click . echo ( ( 'Host "%s" missing facts: %s' % ( host , ', ' . join ( missing_facts [ host ] ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if missing_info : #NEWLINE# #INDENT# sys . exit ( 1 )