import logging
import time
from salt.exceptions import CommandExecutionError

__copyright__ = "Copyright 2019, Mirantis Inc."
__license__ = "Apache 2.0"

try:
    # Trying to import MySQLdb
    import MySQLdb
except ImportError:
    try:
        # MySQLdb import failed, try to import PyMySQL
        import pymysql
        pymysql.install_as_MySQLdb()
        import MySQLdb
    except ImportError:
        MySQLdb = None

def __virtual__():
    '''
    Confirm that a python mysql client is installed.
    '''
    return bool(MySQLdb), 'No python mysql client installed.' if MySQLdb is None else ''

log = logging.getLogger(__name__)

def wait_for_galera_services(cluster_size=3, retries=18, timeout=10):
    """
    Ensure that number of specified nodes with mysql services are alive, otherwise will fail with exception.

    :param timeout:              number of seconds to wait before retries
    :param retries:              number of retries
    """

    for i in range(retries):
        out =  __salt__['mysql.status']()

        if out and int(out['wsrep_cluster_size']) == int(cluster_size) and out['wsrep_evs_state'] == 'OPERATIONAL':
            break
        time.sleep(timeout)
    else:
        raise CommandExecutionError('Galera cluster is not consistent',
                                    info={'wsrep_cluster_size': out['wsrep_cluster_size'],
                                    'wsrep_evs_state': out['wsrep_evs_state']})
    return True
