def main(**kwargs):
    """
    获取系统及配置 安装 操作系统 返回 ip port user password
    :param kwargs: is dict type
    :return: <bool> , <message> ,(ip port user password)
    """
    logging.info("start install os")
    logging.warning("ok")
    logging.info("test")
    print("**kwargs")
    print("test module is running...")
    print(connect_short("good"))
    print("kwargs", kwargs)
    print(kwargs["os"])
    print(kwargs["cpu_num"])
    print(kwargs["mem_gb"])
    print(kwargs["disk_gb"])
    connect_short("good")
    # get install os result
    ip = "127.0.0.1"
    port = 22
    user = "******"
    passwd = "test"
    ret_dict_data = {"ip": ip, "port": port, "user": user, "passwd": passwd}
    logging.info("end install os")
    return True, "ok", ret_dict_data
def test_main(**kwargs):
    kwargs["ip"] = "127.0.0.1"
    kwargs["port"] = 22
    kwargs["user"] = "******"
    kwargs["password"] = "******"

    ########################################
    print("kwargs", kwargs)
    print(kwargs["ip"])
    print(kwargs["port"])
    print(kwargs["user"])
    print(kwargs["password"])
    print("ssh server")
    connect_short("good")
    print("config data")
    print("install monitor script")
    print("change root password to random")
    return True
def test_main(**kwargs):
    kwargs["os"] = "centos 8.0"
    kwargs["cpu_num"] = 8
    kwargs["mem_gb"] = 24
    kwargs["disk_gb"] = 100
    print("kwargs", kwargs)
    print(kwargs["os"])
    print(kwargs["cpu_num"])
    print(kwargs["mem_gb"])
    print(kwargs["disk_gb"])
    connect_short("good")
    # get install os result
    ip = "127.0.0.1"
    port = 22
    user = "******"
    passwd = "test"
    ret_dict_data = {"ip": ip, "port": port, "user": user, "passwd": passwd}
    return True, "ok", ret_dict_data
def main(**kwargs):
    """
    获取系统及配置 安装 操作系统 返回 ip port user password
    :param kwargs: is dict type
    :return: <bool> , <message> ,(ip port user password)
    """
    logging.info("start init os config")
    print("kwargs", kwargs)
    print(kwargs["ip"])
    print(kwargs["port"])
    print(kwargs["user"])
    print(kwargs["password"])
    print("ssh server")
    connect_short("good")
    print("config data")
    print("install monitor script")
    print("change root password to random")
    logging.info("end init os config")
    return True
def main(**kwargs):
    """
    run test method
    :param kwargs: is dict type
    :return: <bool> , <message>
    """
    logging.info("demo start")
    logging.warning("ok")
    logging.info("test")
    print("**kwargs")
    print(kwargs["id"])
    print("test module is running...")
    print(connect_short("good"))
    logging.info("demo end")
    return True, "ok"
def test_main(**kwargs):
    """
    仅仅用于测试的方式运行
    :param kwargs:
    :return:
    """
    kwargs["id"] = 8
    print("kwargs data:", kwargs)
    logging.warning("ok")
    logging.info("test")
    print("**kwargs")
    print(kwargs["id"])
    print("test module is running...")
    print(connect_short("good"))
    return True, "ok"