本文整理匯總了Python中fuelweb_test.models.nailgun_client.NailgunClient.update_cluster方法的典型用法代碼示例。如果您正苦於以下問題:Python NailgunClient.update_cluster方法的具體用法?Python NailgunClient.update_cluster怎麽用?Python NailgunClient.update_cluster使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fuelweb_test.models.nailgun_client.NailgunClient
的用法示例。
在下文中一共展示了NailgunClient.update_cluster方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: FuelWebClient
# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import update_cluster [as 別名]
#.........這裏部分代碼省略.........
)
self.client.create_cluster(data=data)
cluster_id = self.client.get_cluster_id(name)
logger.info('The cluster id is %s', cluster_id)
logger.info('Set cluster settings to %s', settings)
attributes = self.client.get_cluster_attributes(cluster_id)
for option in settings:
section = False
if option in ('sahara', 'murano', 'ceilometer'):
section = 'additional_components'
if option in ('volumes_ceph', 'images_ceph', 'ephemeral_ceph',
'objects_ceph', 'osd_pool_size', 'volumes_lvm'):
section = 'storage'
if option in ('tenant', 'password', 'user'):
section = 'access'
if section:
attributes['editable'][section][option]['value'] =\
settings[option]
logger.info('Set DEBUG MODE to %s', help_data.DEBUG_MODE)
attributes['editable']['common']['debug']['value'] = \
help_data.DEBUG_MODE
if KVM_USE:
logger.info('Set Hypervisor type to KVM')
hpv_data = attributes['editable']['common']['libvirt_type']
hpv_data['value'] = "kvm"
logger.debug("Try to update cluster "
"with next attributes {0}".format(attributes))
self.client.update_cluster_attributes(cluster_id, attributes)
logger.debug("Attributes of cluster were updated,"
" going to update networks ...")
self.update_network_configuration(cluster_id)
if not cluster_id:
raise Exception("Could not get cluster '%s'" % name)
#TODO: rw105719
#self.client.add_syslog_server(
# cluster_id, self.environment.get_host_node_ip(), port)
return cluster_id
def deploy_cluster_wait(self, cluster_id, is_feature=False,
timeout=50 * 60, interval=30):
if not is_feature:
logger.info('Deploy cluster %s', cluster_id)
task = self.deploy_cluster(cluster_id)
self.assert_task_success(task, interval=interval)
else:
logger.info('Provision nodes of a cluster %s', cluster_id)
task = self.client.provision_nodes(cluster_id)
self.assert_task_success(task, timeout=timeout, interval=interval)
logger.info('Deploy nodes of a cluster %s', cluster_id)
task = self.client.deploy_nodes(cluster_id)
self.assert_task_success(task, timeout=timeout, interval=interval)
def deploy_cluster_wait_progress(self, cluster_id, progress):
task = self.deploy_cluster(cluster_id)
self.assert_task_success(task, interval=30, progress=progress)
@logwrap
def deploy_cluster(self, cluster_id):