Example #1
0
            update_required_query(server, package_updates_available_dict, ose_required_packages_list, ssh_connection)
            is_selinux_enabled(server, ssh_connection, selinux_dict)
            systemctl_output = HandleSSHConnections.run_remote_commands(ssh_connection, "systemctl status docker")
            is_docker_enabled(server, systemctl_output, docker_service_check_dict)
            is_docker_running(server, systemctl_output, docker_service_check_dict)
            sub_status = HandleSSHConnections.run_remote_commands(ssh_connection, "subscription-manager status")
            is_host_subscribed(server, subscription_dict, sub_status)
            repo_information = HandleSSHConnections.run_remote_commands(ssh_connection, "subscription-manager repos")
            which_repos_are_enabled(server, repo_dict, repo_information, ose_repos)
            ssh_connection.close_ssh()
        check_forward_dns_lookup(server, forward_lookup_dict)
        check_reverse_dns_lookup(forward_lookup_dict, reverse_lookup_dict)

    ##### Format output and display summary
    print(textColors.HEADER + textColors.BOLD + "\n\nSELinux Checks" + textColors.ENDC)
    DictionaryHandling.format_dictionary_output(selinux_dict)

    print(textColors.HEADER + textColors.BOLD + "\n\nDocker Section (sha256sum below)" + textColors.ENDC)
    if show_sha_sums:
        DictionaryHandling.format_dictionary_output(docker_files_have_been_modified_dict, remote_docker_file_sums_dict,
                                                docker_service_check_dict)
    else:
        DictionaryHandling.format_dictionary_output(docker_files_have_been_modified_dict, docker_service_check_dict)

    print(textColors.HEADER + textColors.BOLD + "\n\nDNS Lookups" + textColors.ENDC)
    DictionaryHandling.format_dictionary_output(forward_lookup_dict, reverse_lookup_dict)

    print(textColors.HEADER + textColors.BOLD + "\n\nPackages and repo information" + textColors.ENDC)
    DictionaryHandling.format_dictionary_output(repo_dict, subscription_dict, ose_package_not_installed_dict,
                                                ose_package_installed_dict, package_updates_available_dict)
            is_docker_running(server, systemctl_output, docker_service_check_dict)
            print(textColors.HEADER + "Running 'subscription-manager status' on %s..." % server + textColors.ENDC)
            sub_status = HandleSSHConnections.run_remote_commands(ssh_connection, "subscription-manager status")
            is_host_subscribed(server, subscription_dict, sub_status)
            print(textColors.HEADER + "Running 'subscription-manager repos' on %s..." % server + textColors.ENDC)
            repo_information = HandleSSHConnections.run_remote_commands(ssh_connection, "subscription-manager repos")
            which_repos_are_enabled(server, repo_dict, repo_information, ose_repos)
            ssh_connection.close_ssh()
        print(textColors.HEADER + "Attempting to forward lookup of %s..." % server + textColors.ENDC)
        check_forward_dns_lookup(server, forward_lookup_dict)
        print(textColors.HEADER + "Attempting to reverse lookup of %s..." % server + textColors.ENDC)
        check_reverse_dns_lookup(forward_lookup_dict, reverse_lookup_dict)

    ##### Format output and display summary
    print(textColors.HEADER + textColors.BOLD + "\n\nSELinux Checks" + textColors.ENDC)
    DictionaryHandling.format_dictionary_output(selinux_dict)

    print(textColors.HEADER + textColors.BOLD + "\n\nDocker Section (sha256sum below)" + textColors.ENDC)
    if show_sha_sums:
        DictionaryHandling.format_dictionary_output(docker_files_have_been_modified_dict, remote_docker_file_sums_dict,
                                                docker_service_check_dict)
    else:
        DictionaryHandling.format_dictionary_output(docker_files_have_been_modified_dict, docker_service_check_dict)

    print(textColors.HEADER + textColors.BOLD + "\n\nDNS Lookups" + textColors.ENDC)
    DictionaryHandling.format_dictionary_output(forward_lookup_dict, reverse_lookup_dict)

    print(textColors.HEADER + textColors.BOLD + "\n\nPackages and repo information" + textColors.ENDC)
    DictionaryHandling.format_dictionary_output(repo_dict, subscription_dict, ose_package_not_installed_dict,
                                                ose_package_installed_dict, package_updates_available_dict)
    print(textColors.HEADER + textColors.BOLD + "\n\nETCD has its own partition" + textColors.ENDC)