def get_property(name):
"""Retrieve a cluster's property
:param name: property name
:returns: property value
:rtype: str
"""
# crmsh >= 2.3 renamed show-property to get-property, 2.3.x is
# available since zesty
if crm_version() >= StrictVersion('2.3.0'):
output = subprocess.check_output(['crm', 'configure',
'get-property', name],
universal_newlines=True)
elif crm_version() < StrictVersion('2.2.0'):
# before 2.2.0 there is no method to get a property
output = subprocess.check_output(['crm', 'configure', 'show', 'xml'],
universal_newlines=True)
return get_property_from_xml(name, output)
else:
output = subprocess.check_output(['crm', 'configure',
'show-property', name],
universal_newlines=True)
return output
评论列表
文章目录