示例#1
0
def deploy_clusters(cluster_hosts):
    """Deploy the given cluster.

    :param cluster_hosts: the cluster and hosts of each cluster to deploy.
    :type cluster_hosts: dict of int to list of int
    """
    deploy.deploy(cluster_hosts)
示例#2
0
def deploy_clusters(cluster_hosts):
    """Deploy the given cluster.

    :param cluster_hosts: the cluster and hosts of each cluster to deploy.
    :type cluster_hosts: dict of int to list of int
    """
    try:
        deploy.deploy(cluster_hosts)
    except Exception as error:
        logging.exception(error)
示例#3
0
def deploy_clusters(cluster_hosts):
    """Deploy the given cluster.

    :param cluster_hosts: the cluster and hosts of each cluster to deploy.
    :type cluster_hosts: dict of int to list of int
    """
    try:
        deploy.deploy(cluster_hosts)
    except Exception as error:
        logging.exception(error)
示例#4
0
def deploy_clusters():
    """Deploy hosts in clusters.

    .. note::
       The hosts are defined in --clusters.
       The clusters flag is as clusterid:hostname1,hostname2,...;...
    """
    cluster_hosts = flags.OPTIONS.clusters
    if flags.OPTIONS.async:
        celery.send_task('compass.tasks.deploy', (cluster_hosts,))
    else:
        deploy.deploy(cluster_hosts)
示例#5
0
def deploy_cluster(deployer_email, cluster_id, clusterhost_ids):
    """Deploy the given cluster.

    :param cluster_id: id of the cluster
    :type cluster_id: int
    :param clusterhost_ids: the id of the hosts in the cluster
    :type clusterhost_ids: list of int
    """
    try:
        deploy.deploy(cluster_id, clusterhost_ids, deployer_email)
    except Exception as error:
        logging.exception(error)
示例#6
0
def deploy_cluster(deployer_email, cluster_id, clusterhost_ids):
    """Deploy the given cluster.

    :param cluster_id: id of the cluster
    :type cluster_id: int
    :param clusterhost_ids: the id of the hosts in the cluster
    :type clusterhost_ids: list of int
    """
    try:
        deploy.deploy(cluster_id, clusterhost_ids, deployer_email)
    except Exception as error:
        logging.exception(error)
示例#7
0
def deploy_clusters():
    """Deploy hosts in clusters.

    .. note::
       The hosts are defined in --clusters.
       The clusters flag is as clusterid:hostname1,hostname2,...;...
    """
    cluster_hosts = flags.OPTIONS.clusters
    if flags.OPTIONS. async:
        celery.send_task('compass.tasks.deploy', (cluster_hosts, ))
    else:
        deploy.deploy(cluster_hosts)
示例#8
0
    def _test(self, config_filename):
        """run the test."""
        full_path = '%s/data/%s' % (os.path.dirname(
            os.path.abspath(__file__)), config_filename)
        config_globals = {}
        config_locals = {}
        execfile(full_path, config_globals, config_locals)
        self._prepare_database(config_locals)
        self._mock_os_installer(config_locals)
        self._mock_package_installer(config_locals)
        cluster_hosts = {}
        with database.session() as session:
            clusters = session.query(Cluster).all()
            for cluster in clusters:
                cluster_hosts[cluster.id] = [host.id for host in cluster.hosts]

        deploy.deploy(cluster_hosts)

        self._check_os_installer(config_locals)
        self._check_package_installer(config_locals)
        self._unmock_os_installer()
        self._unmock_package_installer()
    def _test(self, config_filename):
        """run the test."""
        full_path = '%s/data/%s' % (
            os.path.dirname(os.path.abspath(__file__)),
            config_filename)
        config_globals = {}
        config_locals = {}
        execfile(full_path, config_globals, config_locals)
        self._prepare_database(config_locals)
        self._mock_os_installer(config_locals)
        self._mock_package_installer(config_locals)
        cluster_hosts = {}
        with database.session() as session:
            clusters = session.query(Cluster).all()
            for cluster in clusters:
                cluster_hosts[cluster.id] = [
                    host.id for host in cluster.hosts]

        deploy.deploy(cluster_hosts)

        self._check_os_installer(config_locals)
        self._check_package_installer(config_locals)
        self._unmock_os_installer()
        self._unmock_package_installer()