Browse Source

neutron-ha-tool: fix monitor return code

When neutron routers need migration, make neutron-ha-tool's monitor
action return OCF_ERR_GENERIC not OCF_NOT_RUNNING.  This is based on the
OCF Resource Agent Developer’s Guide, which says in the section for
OCF_ERR_GENERIC:

    The action returned a generic error. A resource agent should use
    this exit code only when none of the more specific error codes,
    defined below, accurately describes the problem.

    The cluster resource manager interprets this exit code as a soft
    error. This means that unless specifically configured otherwise, the
    resource manager will attempt to recover a resource which failed
    with OCF_ERR_GENERIC in-place — usually by restarting the resource
    on the same node.

      -- http://www.linux-ha.org/doc/dev-guides/_literal_ocf_err_generic_literal_1.html

and also in the section for OCF_NOT_RUNNING:

    If the resource is not running due to an error condition, the
    monitor action should instead return one of the OCF_ERR_ exit codes
    or OCF_FAILED_MASTER.

      -- http://www.linux-ha.org/doc/dev-guides/_literal_ocf_not_running_literal_7.html

Change-Id: I55f78a5c341a8a552e06a252a9c6836877c0cf77
Adam Spiers 3 years ago
parent
commit
fff75c5eb4
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      ocf/neutron-ha-tool

+ 1
- 1
ocf/neutron-ha-tool View File

@@ -229,7 +229,7 @@ neutron_ha_tool_monitor() {
229 229
     rc=$?
230 230
     if [ $rc -eq 2 ]; then
231 231
         ocf_log err "Some Neutron routers need migration."
232
-        return $OCF_NOT_RUNNING
232
+        return $OCF_ERR_GENERIC
233 233
     fi
234 234
 
235 235
     ocf_log debug "Neutron HA Tool (neutron-ha-tool) monitor succeeded"

Loading…
Cancel
Save