Exemplo n.º 1
0
Arquivo: paictl.py Projeto: mmmika/pai
    def k8s_set_environment(self, args):

        if args.config_path != None:
            args.config_path = os.path.expanduser(args.config_path)
            cluster_object_model_instance = cluster_object_model(args.config_path)
            com = cluster_object_model_instance.run()
        else:
            com = None
        kubectl_install_worker = kubectl_install.kubectl_install(com)
        kubectl_install_worker.run()
Exemplo n.º 2
0
    def k8s_set_environment(self, args):

        if args.config_path != None:
            args.config_path = os.path.expanduser(args.config_path)
            cluster_object_model_k8s = cluster_object_model_generate_k8s(
                args.config_path)
        else:
            cluster_object_model_k8s = None
        kubectl_install_worker = kubectl_install.kubectl_install(
            cluster_object_model_k8s)
        kubectl_install_worker.run()
Exemplo n.º 3
0
def kubectl_env_checking(cluster_object_mode):

    kubectl_conf_ck_worker = kubectl_conf_check.kubectl_conf_check(
        cluster_object_mode)
    if kubectl_conf_ck_worker.check() == False:
        count_input = 0

        while True:
            user_input = raw_input(
                "Do you want to re-install kubectl by paictl? (Y/N) ")

            if user_input == "N":
                count_quit = 0
                while True:
                    quit_or_not = raw_input(
                        "Do you want to quit by this operation? (Y/N) ")
                    if quit_or_not == "Y":
                        return False
                    elif quit_or_not == "N":
                        return True
                    else:
                        print(" Please type Y or N.")
                    count_quit = count_quit + 1
                    if count_quit == 3:
                        logger.warning(
                            "3 Times.........  Sorry,  we will force stopping your operation."
                        )
                        return False

            elif user_input == "Y":
                kubectl_install_worker = kubectl_install.kubectl_install(
                    cluster_object_mode)
                kubectl_install_worker.run()
                return True

            else:
                print(" Please type Y or N.")

            count_input = count_input + 1
            if count_input == 3:
                logger.warning(
                    "3 Times.........  Sorry,  we will force stopping your operation."
                )
                return False
    return True
Exemplo n.º 4
0
 def install_kubectl(self, args):
     cluster_object_model_k8s = cluster_object_model_generate_k8s(args.config_path)
     kubectl_install_worker = kubectl_install.kubectl_install(cluster_object_model_k8s)
     kubectl_install_worker.run()