Merge "Never give up on resources"
This commit is contained in:
commit
38590837da
|
@ -599,7 +599,9 @@ class InitService(ResourceDescriptor):
|
||||||
self.service_name.replace('-', '_'),
|
self.service_name.replace('-', '_'),
|
||||||
self.init_service_name.replace('-', '_'))
|
self.init_service_name.replace('-', '_'))
|
||||||
res_type = 'lsb:{}'.format(self.init_service_name)
|
res_type = 'lsb:{}'.format(self.init_service_name)
|
||||||
crm.primitive(res_key, res_type, op='monitor interval="5s"')
|
_meta = 'migration-threshold="INFINITY" failure-timeout="5s"'
|
||||||
|
crm.primitive(
|
||||||
|
res_key, res_type, op='monitor interval="5s"', meta=_meta)
|
||||||
crm.init_services(self.init_service_name)
|
crm.init_services(self.init_service_name)
|
||||||
if self.clone:
|
if self.clone:
|
||||||
clone_key = 'cl_{}'.format(res_key)
|
clone_key = 'cl_{}'.format(res_key)
|
||||||
|
@ -650,7 +652,9 @@ class VirtualIP(ResourceDescriptor):
|
||||||
res_params = '{} cidr_netmask="{}"'.format(res_params, self.cidr)
|
res_params = '{} cidr_netmask="{}"'.format(res_params, self.cidr)
|
||||||
# Monitor the VIP
|
# Monitor the VIP
|
||||||
_op_monitor = 'monitor depth="0" timeout="20s" interval="10s"'
|
_op_monitor = 'monitor depth="0" timeout="20s" interval="10s"'
|
||||||
crm.primitive(vip_key, res_type, params=res_params, op=_op_monitor)
|
_meta = 'migration-threshold="INFINITY" failure-timeout="5s"'
|
||||||
|
crm.primitive(
|
||||||
|
vip_key, res_type, params=res_params, op=_op_monitor, meta=_meta)
|
||||||
|
|
||||||
|
|
||||||
class DNSEntry(ResourceDescriptor):
|
class DNSEntry(ResourceDescriptor):
|
||||||
|
|
|
@ -311,7 +311,8 @@ class TestHAClusterCommonInitService(unittest.TestCase):
|
||||||
'lsb:apache2')
|
'lsb:apache2')
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
crm['resource_params']['res_apache_apache2'],
|
crm['resource_params']['res_apache_apache2'],
|
||||||
(' op monitor interval="5s"'))
|
(' meta migration-threshold="INFINITY" failure-timeout="5s"'
|
||||||
|
' op monitor interval="5s"'))
|
||||||
self.assertEqual(crm['init_services'], ('apache2',))
|
self.assertEqual(crm['init_services'], ('apache2',))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
crm['clones']['cl_res_apache_apache2'],
|
crm['clones']['cl_res_apache_apache2'],
|
||||||
|
@ -326,7 +327,8 @@ class TestHAClusterCommonInitService(unittest.TestCase):
|
||||||
'lsb:apache2')
|
'lsb:apache2')
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
crm['resource_params']['res_apache_apache2'],
|
crm['resource_params']['res_apache_apache2'],
|
||||||
(' op monitor interval="5s"'))
|
(' meta migration-threshold="INFINITY" failure-timeout="5s"'
|
||||||
|
' op monitor interval="5s"'))
|
||||||
self.assertEqual(crm['init_services'], ('apache2',))
|
self.assertEqual(crm['init_services'], ('apache2',))
|
||||||
self.assertFalse(crm['clones'].get('cl_res_apache_apache2'))
|
self.assertFalse(crm['clones'].get('cl_res_apache_apache2'))
|
||||||
|
|
||||||
|
@ -357,6 +359,7 @@ class TestHAClusterCommonVirtualIP(unittest.TestCase):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
crm['resource_params']['res_apache_eth1_vip'],
|
crm['resource_params']['res_apache_eth1_vip'],
|
||||||
(' params ip="10.110.1.1" nic="eth1" cidr_netmask="24" '
|
(' params ip="10.110.1.1" nic="eth1" cidr_netmask="24" '
|
||||||
|
'meta migration-threshold="INFINITY" failure-timeout="5s" '
|
||||||
'op monitor depth="0" timeout="20s" interval="10s"'))
|
'op monitor depth="0" timeout="20s" interval="10s"'))
|
||||||
|
|
||||||
def test_configure_resource_no_nic(self):
|
def test_configure_resource_no_nic(self):
|
||||||
|
@ -369,6 +372,7 @@ class TestHAClusterCommonVirtualIP(unittest.TestCase):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
crm['resource_params']['res_apache_a7815c8_vip'],
|
crm['resource_params']['res_apache_a7815c8_vip'],
|
||||||
(' params ip="10.110.1.1" '
|
(' params ip="10.110.1.1" '
|
||||||
|
'meta migration-threshold="INFINITY" failure-timeout="5s" '
|
||||||
'op monitor depth="0" timeout="20s" interval="10s"'))
|
'op monitor depth="0" timeout="20s" interval="10s"'))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,10 @@ class TestHAClusterRequires(unittest.TestCase):
|
||||||
'delete_resources': [],
|
'delete_resources': [],
|
||||||
'resource_params': {
|
'resource_params': {
|
||||||
'res_mysql_4b8ce37_vip': (
|
'res_mysql_4b8ce37_vip': (
|
||||||
' params ip="10.110.5.43" op monitor depth="0" '
|
' params ip="10.110.5.43"'
|
||||||
|
' meta migration-threshold="INFINITY" '
|
||||||
|
'failure-timeout="5s"'
|
||||||
|
' op monitor depth="0" '
|
||||||
'timeout="20s" interval="10s"')},
|
'timeout="20s" interval="10s"')},
|
||||||
'groups': {},
|
'groups': {},
|
||||||
'ms': {},
|
'ms': {},
|
||||||
|
@ -343,10 +346,14 @@ class TestHAClusterRequires(unittest.TestCase):
|
||||||
'delete_resources': [],
|
'delete_resources': [],
|
||||||
'resource_params': {
|
'resource_params': {
|
||||||
'res_mysql_4b8ce37_vip': (
|
'res_mysql_4b8ce37_vip': (
|
||||||
' params ip="10.110.5.43" op monitor depth="0" '
|
' params ip="10.110.5.43"'
|
||||||
|
' op monitor depth="0" '
|
||||||
'timeout="20s" interval="10s"'),
|
'timeout="20s" interval="10s"'),
|
||||||
'res_mysql_1993276_vip': (
|
'res_mysql_1993276_vip': (
|
||||||
' params ip="10.120.5.43" op monitor depth="0" '
|
' params ip="10.120.5.43"'
|
||||||
|
' meta migration-threshold="INFINITY" '
|
||||||
|
'failure-timeout="5s"'
|
||||||
|
' op monitor depth="0" '
|
||||||
'timeout="20s" interval="10s"')},
|
'timeout="20s" interval="10s"')},
|
||||||
'groups': {
|
'groups': {
|
||||||
'grp_mysql_vips': ('res_mysql_1993276_vip '
|
'grp_mysql_vips': ('res_mysql_1993276_vip '
|
||||||
|
@ -369,7 +376,10 @@ class TestHAClusterRequires(unittest.TestCase):
|
||||||
'res_mysql_telnetd': 'lsb:telnetd'},
|
'res_mysql_telnetd': 'lsb:telnetd'},
|
||||||
'delete_resources': [],
|
'delete_resources': [],
|
||||||
'resource_params': {
|
'resource_params': {
|
||||||
'res_mysql_telnetd': ' op monitor interval="5s"'},
|
'res_mysql_telnetd':
|
||||||
|
(' meta migration-threshold="INFINITY" '
|
||||||
|
'failure-timeout="5s"'
|
||||||
|
' op monitor interval="5s"')},
|
||||||
'groups': {},
|
'groups': {},
|
||||||
'ms': {},
|
'ms': {},
|
||||||
'orders': {},
|
'orders': {},
|
||||||
|
|
Loading…
Reference in New Issue