def _enable_support_access(url): _validate_support_key_url(url) url_content = _get_url_content(url) _error_if_not_ssh_key(url_content) _add_support_ssh_key(url_content) _record_support_access_enabled() _print_support_access_message(text.success('Enabled'))
def _eject_success_message(): success = text.success('Success!') message_callback = CONFIG.SUPPORT_EJECT_SUCCESS_MESSAGE_CALLBACK appliance_success_message = \ message_callback(appliance_url=config_utils.appliance_url()) return text.join_lines(success, appliance_success_message)
def _record_export_success_message(export_filepath): success = text.success('Success!') export_filename = os.path.basename(export_filepath) download_info = \ 'Your Directory record is available to download at {}.\n'.format( _export_url(export_filename) ) parts = [success, download_info, _auth_details()] if not appliance_cli.utils.in_sandbox(): # As it stands all this functionality is unreachable from within the directory sandbox but # if it were to be re-enabled in the sandbox we may not have access to files on the appliance # so we don't want to show local access info if not currently in the sandbox local_file_info = '\nIt can also be viewed locally at {}.'.format( export_filepath) parts.append(local_file_info) return text.join_lines(*parts)
def _support_coverage_status(): if _support_ejected(): return text.failure('Unavailable') else: return text.success('Available')
def _support_access_status(): if _support_access_enabled(): return text.success('Enabled') else: return text.failure('Disabled')