Resource parameter order is important on Eoan+

Port of https://github.com/juju/charm-helpers/pull/373 to this
interface for reactive charms. From the ch pull request:

On Eoan we saw errors like:

ERROR: syntax in primitive: Attribute order error: timeout must appear
before any instance attribute parsing 'primitive res_ks_cf9dea1_vip
ocfheartbeatIPaddr2 params ip=10.5.253.30 op monitor depth=0
timeout=20s interval=10s'

It would appear, that ordering matters, update resource config function
to the correct order.

Change-Id: I1f8a440fb0ad62192307946de42b9b176b3ef4c1
Partial-Bug: #1843830
This commit is contained in:
Liam Young 2020-04-22 08:54:02 +00:00
parent ef1f8503f4
commit 67511b3787
3 changed files with 7 additions and 7 deletions

View File

@ -651,7 +651,7 @@ class VirtualIP(ResourceDescriptor):
if self.cidr:
res_params = '{} cidr_netmask="{}"'.format(res_params, self.cidr)
# Monitor the VIP
_op_monitor = 'monitor depth="0" timeout="20s" interval="10s"'
_op_monitor = 'monitor timeout="20s" interval="10s" depth="0"'
_meta = 'migration-threshold="INFINITY" failure-timeout="5s"'
crm.primitive(
vip_key, res_type, params=res_params, op=_op_monitor, meta=_meta)

View File

@ -360,7 +360,7 @@ class TestHAClusterCommonVirtualIP(unittest.TestCase):
crm['resource_params']['res_apache_eth1_vip'],
(' 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 timeout="20s" interval="10s" depth="0"'))
def test_configure_resource_no_nic(self):
crm = common.CRM()
@ -373,7 +373,7 @@ class TestHAClusterCommonVirtualIP(unittest.TestCase):
crm['resource_params']['res_apache_a7815c8_vip'],
(' params ip="10.110.1.1" '
'meta migration-threshold="INFINITY" failure-timeout="5s" '
'op monitor depth="0" timeout="20s" interval="10s"'))
'op monitor timeout="20s" interval="10s" depth="0"'))
class TestHAClusterCommonDNSEntry(unittest.TestCase):

View File

@ -322,8 +322,8 @@ class TestHAClusterRequires(unittest.TestCase):
' params ip="10.110.5.43"'
' meta migration-threshold="INFINITY" '
'failure-timeout="5s"'
' op monitor depth="0" '
'timeout="20s" interval="10s"')},
' op monitor timeout="20s" '
'interval="10s" depth="0"')},
'groups': {},
'ms': {},
'orders': {},
@ -369,8 +369,8 @@ class TestHAClusterRequires(unittest.TestCase):
' params ip="10.120.5.43"'
' meta migration-threshold="INFINITY" '
'failure-timeout="5s"'
' op monitor depth="0" '
'timeout="20s" interval="10s"')},
' op monitor timeout="20s" '
'interval="10s" depth="0"')},
'groups': {
'grp_mysql_vips': ('res_mysql_1993276_vip '
'res_mysql_4b8ce37_vip')},