from cfg_checker.common import logger_cli
# from cfg_checker.common.exception import InvalidReturnException
# from cfg_checker.common.exception import ConfigException
# from cfg_checker.common.exception import KubeException

from cfg_checker.nodes import KubeNodes


class CephBench(object):
    def __info__(
        self,
        config
    ):
        self.env_config = config
        return

    def prepare_pods(self):

        return

    def run_benchmark(self):

        return

    # Create report
    def create_report(self):

        return


class SaltCephBench(CephBench):
    def __init__(
        self,
        config
    ):
        logger_cli.error("ERROR: Not impelented for Sale environment!")

        # self.master = SaltNodes(config)
        super(SaltCephBench, self).__init__(
            config
        )
        return


class KubeCephBench(CephBench):
    def __init__(self, config):
        self.master = KubeNodes(config)
        super(KubeCephBench, self).__init__(config)
