diff --git a/compass/db/api/cluster.py b/compass/db/api/cluster.py index c13041b2..16e06157 100644 --- a/compass/db/api/cluster.py +++ b/compass/db/api/cluster.py @@ -40,8 +40,9 @@ RESP_FIELDS = [ ] RESP_CLUSTERHOST_FIELDS = [ 'id', 'host_id', 'machine_id', 'name', 'hostname', - 'cluster_id', 'clustername', - 'mac', 'os_installed', 'distributed_system_installed', + 'cluster_id', 'clustername', 'location', 'tag', + 'networks', 'mac', + 'os_installed', 'distributed_system_installed', 'os_name', 'distributed_system_name', 'reinstall_os', 'reinstall_distributed_system', 'owner', 'cluster_id', @@ -1023,15 +1024,15 @@ def review_cluster(session, reviewer, cluster_id, review={}, **kwargs): session, models.Cluster, id=cluster_id ) is_cluster_editable(session, cluster, reviewer) + host_ids = review.get('hosts', []) clusterhost_ids = review.get('clusterhosts', []) - filters = { - 'cluster_id': cluster_id - } - if clusterhost_ids: - filters['id'] = clusterhost_ids - clusterhosts = utils.list_db_objects( - session, models.ClusterHost, **filters - ) + clusterhosts = [] + for clusterhost in cluster.clusterhosts: + if ( + clusterhost.id in clusterhost_ids or + clusterhost.host_id in host_ids + ): + clusterhosts.append(clusterhost) os_config = cluster.os_config if os_config: metadata_api.validate_os_config( @@ -1074,7 +1075,7 @@ def review_cluster(session, reviewer, cluster_id, review={}, **kwargs): utils.update_db_object(session, cluster, config_validated=True) return { 'cluster': cluster, - 'clusterhosts': cluster.clusterhosts + 'clusterhosts': clusterhosts } @@ -1097,15 +1098,15 @@ def deploy_cluster( cluster = utils.get_db_object( session, models.Cluster, id=cluster_id ) + host_ids = deploy.get('hosts', []) clusterhost_ids = deploy.get('clusterhosts', []) - filters = { - 'cluster_id': cluster_id - } - if clusterhost_ids: - filters['id'] = clusterhost_ids - clusterhosts = utils.list_db_objects( - session, models.ClusterHost, **filters - ) + clusterhosts = [] + for clusterhost in cluster.clusterhosts: + if ( + clusterhost.id in clusterhost_ids or + clusterhost.host_id in host_ids + ): + clusterhosts.append(clusterhost) is_cluster_editable(session, cluster, deployer) is_cluster_validated(session, cluster) utils.update_db_object(session, cluster.state, state='INITIALIZED') @@ -1127,12 +1128,15 @@ def deploy_cluster( celery_client.celery.send_task( 'compass.tasks.deploy_cluster', - (deployer.email, cluster_id, deploy.get('clusterhosts', [])) + ( + deployer.email, cluster_id, + [clusterhost.id for clusterhost in clusterhosts] + ) ) return { 'status': 'deploy action sent', 'cluster': cluster, - 'clusterhosts': cluster.clusterhosts + 'clusterhosts': clusterhosts } diff --git a/conf/os_metadata/general.conf b/conf/os_metadata/general.conf index f67217df..a945f5fe 100644 --- a/conf/os_metadata/general.conf +++ b/conf/os_metadata/general.conf @@ -17,13 +17,12 @@ METADATA = { 'field': 'general', 'default_value': 'UTC', 'options': [ - 'GMT -12:00', 'GMT -11:00', 'GMT -10:00', 'GMT -9:00', - 'GMT -8:00', 'GMT -7:00', 'GMT -6:00', 'GMT -5:00', - 'GMT -4:00', 'GMT -3:00', 'GMT -2:00', 'GMT -1:00', - 'GMT 0:00', 'GMT +1:00', 'GMT +2:00', 'GMT +3:00', - 'GMT +4:00', 'GMT +5:00', 'GMT +6:00', 'GMT +7:00', - 'GMT +8:00', 'GMT +9:00', 'GMT +10:00', 'GMT +11:00', - 'GMT +12:00', 'UTC' + 'America/New_York', 'America/Chicago', + 'America/Los_Angeles', 'Asia/Shanghai', + 'Asia/Tokyo', 'Europe/Paris', + 'Europe/London', 'Europe/Moscow', + 'Europe/Rome', 'Europe/Madrid', + 'Europe/Berlin', 'UTC' ], 'mapping_to': 'timezone' } diff --git a/conf/role/openstack_chef.conf b/conf/role/openstack_chef.conf index 9d45dd5f..245f4cea 100644 --- a/conf/role/openstack_chef.conf +++ b/conf/role/openstack_chef.conf @@ -1,4 +1,4 @@ -ADAPTER_NAME = 'openstack(chef)' +ADAPTER_NAME = 'openstack_icehouse' ROLES = [{ 'role': 'os-compute-worker', 'display_name': 'compute node',