From 6d02419ef932b54aca5c60d9d3b1efe67ecfd0f3 Mon Sep 17 00:00:00 2001 From: Christian Schwede Date: Thu, 30 Mar 2017 14:15:28 +0200 Subject: [PATCH] Fix raising an error on rebalance warnings If the ring has been rebalanced recently, the next call to rebalance will not rebalance again if the time passed is shorter than min_part_time. swift-ring-builder returns an exit code of 1 in this case, which is a warning, but not a hard error (errors will use an exit code of 2). It makes sense therefore to expect an exit code of 0 or 1 and only fail if it's different. Closes-Bug: 1677588 Change-Id: I03dd075c590344a920099c57b6a7530f103e0ede (cherry picked from commit c64538ef8387128226dedbb51cac6548570d84e3) --- manifests/ringbuilder/rebalance.pp | 1 + .../notes/rebalance-exit-codes-ee79621190315a5a.yaml | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 releasenotes/notes/rebalance-exit-codes-ee79621190315a5a.yaml diff --git a/manifests/ringbuilder/rebalance.pp b/manifests/ringbuilder/rebalance.pp index 256249e7..5d525fd8 100644 --- a/manifests/ringbuilder/rebalance.pp +++ b/manifests/ringbuilder/rebalance.pp @@ -24,5 +24,6 @@ define swift::ringbuilder::rebalance( path => ['/usr/bin'], refreshonly => true, before => Anchor['swift::config::end'], + returns => [0, 1], } } diff --git a/releasenotes/notes/rebalance-exit-codes-ee79621190315a5a.yaml b/releasenotes/notes/rebalance-exit-codes-ee79621190315a5a.yaml new file mode 100644 index 00000000..30ab7040 --- /dev/null +++ b/releasenotes/notes/rebalance-exit-codes-ee79621190315a5a.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - puppet-swift will no longer raise an error if + swift-ring-builder rebalance returns an exit code of 1. + This is a warning but not an error in + swift-ring-builder; errors use an exit code of 2 in + swift-ring-builder.