# Path: dcos_launch/util.py
# MOCK_SSH_KEY_DATA = 'ssh_key_data'
# MOCK_KEY_NAME = 'my_key_name'
# MOCK_VPC_ID = 'vpc-foo-bar'
# MOCK_SUBNET_ID = 'subnet-foo-bar'
# MOCK_GATEWAY_ID = 'gateway-foo-bar'
# MOCK_STACK_ID = 'this-is-a-important-test-stack::deadbeefdeadbeef'
# NO_TEST_FLAG = 'NO PRIVATE SSH KEY PROVIDED - CANNOT TEST'
# def write_json(filename, data):
# def json_prettyprint(data):
# def load_json(filename):
# def set_from_env(key):
# def read_file(filename: str):
# def stub(output):
#     def accept_any_args(*args, **kwargs):
# def get_temp_config_path(tmpdir, name, update: dict = None):
#     def __init__(self, error, msg):
#     def __repr__(self):
#     def get_ssh_client(self, user='ssh_user'):
#     def __init__(self, config: dict, env=None):
#     def create(self):
#     def wait(self):
#     def describe(self):
#     def delete(self):
#     def install_dcos(self):
#     def test(self, args: list, env_dict: dict, test_host: str=None, test_port: int=22, details: dict=None) -> int:
# def try_to_output_unbuffered(info, test_host: str, bash_cmd: str, port: int) -> int:
# def convert_host_list(host_list):
# def generate_rsa_keypair(key_size=2048, priv_key_format=serialization.PrivateFormat.PKCS8):
# class DeploymentError(Exception):
# class LauncherError(Exception):
# class AbstractLauncher(metaclass=abc.ABCMeta):


import os
import sys
import dcos_launch
import dcos_launch.config
from dcos_launch import util
from dcos_test_utils import logger
from docopt import docopt
              describe, pytest, and delete calls.
  wait      Block until the cluster is up and running.
  describe  Return additional information about the composition of the cluster.
  pytest    Runs integration test suite on cluster. Can optionally supply
              options and arguments to pytest
  delete    Destroying the provided cluster deployment.

Options:
  -c PATH --config-path=PATH
            Path for config to create cluster from [default: config.yaml].
  -i PATH --info-path=PATH
            JSON file output by create and consumed by wait, describe,
            and delete [default: cluster_info.json].
  -e LIST --env=LIST
            Specifies a comma-delimited list of environment variables to be
            passed from the local environment into the test environment.
  -L LEVEL --log-level=LEVEL
            One of: critical, error, warning, info, debug, and trace
            [default: debug].
"""



def do_main(args):
    logger.setup(args['--log-level'].upper(), noisy_modules=['googleapiclient', 'oauth2client'])

    if args['create']:
        config = dcos_launch.config.get_validated_config_from_path(args['--config-path'])
        info_path = args['--info-path']
        if os.path.exists(info_path):

# Path: dcos_launch/util.py
# MOCK_SSH_KEY_DATA = 'ssh_key_data'
# MOCK_KEY_NAME = 'my_key_name'
# MOCK_VPC_ID = 'vpc-foo-bar'
# MOCK_SUBNET_ID = 'subnet-foo-bar'
# MOCK_GATEWAY_ID = 'gateway-foo-bar'
# MOCK_STACK_ID = 'this-is-a-important-test-stack::deadbeefdeadbeef'
# NO_TEST_FLAG = 'NO PRIVATE SSH KEY PROVIDED - CANNOT TEST'
# def write_json(filename, data):
# def json_prettyprint(data):
# def load_json(filename):
# def set_from_env(key):
# def read_file(filename: str):
# def stub(output):
#     def accept_any_args(*args, **kwargs):
# def get_temp_config_path(tmpdir, name, update: dict = None):
#     def __init__(self, error, msg):
#     def __repr__(self):
#     def get_ssh_client(self, user='ssh_user'):
#     def __init__(self, config: dict, env=None):
#     def create(self):
#     def wait(self):
#     def describe(self):
#     def delete(self):
#     def install_dcos(self):
#     def test(self, args: list, env_dict: dict, test_host: str=None, test_port: int=22, details: dict=None) -> int:
# def try_to_output_unbuffered(info, test_host: str, bash_cmd: str, port: int) -> int:
# def convert_host_list(host_list):
# def generate_rsa_keypair(key_size=2048, priv_key_format=serialization.PrivateFormat.PKCS8):
# class DeploymentError(Exception):
# class LauncherError(Exception):
# class AbstractLauncher(metaclass=abc.ABCMeta):


# Path: dcos_launch/cli.py
import os
import sys
import dcos_launch
import dcos_launch.config
from dcos_launch import util
from dcos_test_utils import logger
from docopt import docopt

              describe, pytest, and delete calls.
  wait      Block until the cluster is up and running.
  describe  Return additional information about the composition of the cluster.
  pytest    Runs integration test suite on cluster. Can optionally supply
              options and arguments to pytest
  delete    Destroying the provided cluster deployment.

Options:
  -c PATH --config-path=PATH
            Path for config to create cluster from [default: config.yaml].
  -i PATH --info-path=PATH
            JSON file output by create and consumed by wait, describe,
            and delete [default: cluster_info.json].
  -e LIST --env=LIST
            Specifies a comma-delimited list of environment variables to be
            passed from the local environment into the test environment.
  -L LEVEL --log-level=LEVEL
            One of: critical, error, warning, info, debug, and trace
            [default: debug].
"""



def do_main(args):
    logger.setup(args['--log-level'].upper(), noisy_modules=['googleapiclient', 'oauth2client'])

    if args['create']:
        config = dcos_launch.config.get_validated_config_from_path(args['--config-path'])
        info_path = args['--info-path']
        if os.path.exists(info_path):

            raise dcos_launch.util.LauncherError(