def _eject_confirmation_message(): info = text.line_wrap(CONFIG.SUPPORT_EJECT_INFO_MESSAGE) support_warning = text.line_wrap( text.bold('This will opt you out from any obligation for Alces Flight ' "Ltd to provide you with support for your Flight {}.".format( config_utils.appliance_name()))) continue_prompt = text.info('Continue?') return text.join_lines(info, support_warning, continue_prompt)
def _support_eject_success_message(appliance_url=None): cli_info = text.line_wrap( 'You may now log out and in again to gain full command-line access to ' 'the appliance.') freeipa_url = appliance_url + '/ipa/ui' freeipa_info = text.line_wrap( ('You may also visit {} to access your full FreeIPA interface.' ).format(freeipa_url)) return text.join_lines(cli_info, freeipa_info)
def _eject_failure_message(): incorrect_code = text.failure('Incorrect eject code given.') contact_support = text.line_wrap( 'Please contact the Alces Flight Support team at ' '[email protected] if you are encountering difficulty ejecting ' "your Flight {}.".format(config_utils.appliance_name())) return text.join_lines(incorrect_code, contact_support)
def _export_imported_user_passwords(passwords_data): unix_timestamp = math.floor(time.time()) export_filename = 'passwords-{}.tsv'.format(unix_timestamp) export_filepath = os.path.join(CONFIG.EXPORT_DIR, export_filename) with open(export_filepath, 'w', newline='') as export_file: writer = csv.writer(export_file, delimiter='\t') for entry in passwords_data: writer.writerow(entry) download_info = text.line_wrap( 'The temporary passwords are also available to download in TSV format ' 'at {}.'.format(_export_url(export_filename))) + '\n' message = text.join_lines(download_info, _auth_details()) click.echo(message)
def _disable_confirmation_message(): info = text.line_wrap( 'This will disable Alces Flight Support from being able to access ' 'this appliance.') continue_prompt = text.info('Continue?') return text.join_lines(info, continue_prompt)