Add a more clear error message when we fail to backup cib

Currently people get 'unable to get cib' error messages and assume
that the cluster is in a bad state. This error can be returned
in mainly two cases:
A) When the cluster is down or has issues and pcs is unable to get the CIB
B) pcs is being run from within a container and the pcmk version in the
   container is not compatible with the pcmk version running on the
   host.

Change-Id: I1c74f11b2c0d5e925a3a04de2ecb35c354496c4c
This commit is contained in:
Michele Baldessari 2019-11-06 21:23:11 +01:00
parent 0ebd0344a7
commit 74969a6ce5
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ def backup_cib()
output = `#{cmd} 2>&1`
ret = $?
if not ret.success?
msg = "backup_cib: Running: #{cmd} failed with code: #{ret.exitstatus} -> #{output}"
msg = "backup_cib: Running: #{cmd} failed with code: #{ret.exitstatus} -> #{output}." \
" Either the cluster was not running or the versions of pcmk/pcs between host and container are not matching"
FileUtils.rm(cib, :force => true)
raise Puppet::Error, msg
end