5 months ago
Low: .ocf-shellfuncs: add a test for whether the resource is running in multistate mode
Add ocf_is_ms() to .ocf-shellfuncs, which returns true only if the
resource
- is configured as a multistate resource, not a primitive, and
- its master-max meta attribute is set to >0.
| heartbeat/.ocf-shellfuncs.in | file | annotate | diff | revisions |
1.1 --- a/heartbeat/.ocf-shellfuncs.in Wed Feb 24 11:27:52 2010 +1100 1.2 +++ b/heartbeat/.ocf-shellfuncs.in Thu Feb 25 09:31:38 2010 +0100 1.3 @@ -387,6 +387,13 @@ 1.4 [ "$__OCF_ACTION" = "monitor" -a "$OCF_RESKEY_CRM_meta_interval" = 0 ] 1.5 } 1.6 1.7 +# returns true if the resource is configured as a multistate 1.8 +# (master/slave) resource. This is defined as a resource where the 1.9 +# master-max meta attribute is present, and set to greater than zero. 1.10 +ocf_is_ms() { 1.11 + [ ! -z "${OCF_RESKEY_CRM_meta_master_max}" ] && [ "${OCF_RESKEY_CRM_meta_master_max}" -gt 0 ] 1.12 +} 1.13 + 1.14 # usage: dirname DIR 1.15 dirname() 1.16 {