本文整理汇总了Python中nailgun.objects.Cluster.get_default_kernel_params方法的典型用法代码示例。如果您正苦于以下问题:Python Cluster.get_default_kernel_params方法的具体用法?Python Cluster.get_default_kernel_params怎么用?Python Cluster.get_default_kernel_params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.objects.Cluster
的用法示例。
在下文中一共展示了Cluster.get_default_kernel_params方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_kernel_params
# 需要导入模块: from nailgun.objects import Cluster [as 别名]
# 或者: from nailgun.objects.Cluster import get_default_kernel_params [as 别名]
def get_kernel_params(cls, instance):
"""Get kernel params
Return cluster kernel_params if they weren't replaced by custom params.
"""
return (instance.kernel_params or
Cluster.get_default_kernel_params(instance.cluster))
示例2: get_kernel_params
# 需要导入模块: from nailgun.objects import Cluster [as 别名]
# 或者: from nailgun.objects.Cluster import get_default_kernel_params [as 别名]
def get_kernel_params(cls, instance):
"""Return cluster kernel_params if they wasnot replaced by
custom params.
"""
# return (instance.kernel_params or
# Cluster.get_default_kernel_params(instance.cluster))
if instance.cluster:
return (instance.kernel_params or Cluster.get_default_kernel_params(instance.cluster))
else:
return "console=ttyS0,9600 console=tty0 biosdevname=0 crashkernel=none rootdelay=90 nomodeset"
示例3: add_into_cluster
# 需要导入模块: from nailgun.objects import Cluster [as 别名]
# 或者: from nailgun.objects.Cluster import get_default_kernel_params [as 别名]
def add_into_cluster(cls, instance, cluster_id):
"""Adds Node to Cluster by its ID.
Also assigns networks by default for Node.
:param instance: Node instance
:param cluster_id: Cluster ID
:returns: None
"""
instance.cluster_id = cluster_id
db().flush()
db().refresh(instance)
instance.kernel_params = Cluster.get_default_kernel_params(
instance.cluster
)
db().flush()
network_manager = Cluster.get_network_manager(instance.cluster)
network_manager.assign_networks_by_default(instance)
示例4: get_kernel_params
# 需要导入模块: from nailgun.objects import Cluster [as 别名]
# 或者: from nailgun.objects.Cluster import get_default_kernel_params [as 别名]
def get_kernel_params(cls, instance):
"""Return cluster kernel_params if they wasnot replaced by
custom params.
"""
return instance.kernel_params or Cluster.get_default_kernel_params(instance.cluster)