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 c64538ef83)
This commit is contained in:
Christian Schwede 2017-03-30 14:15:28 +02:00
parent d24b7af259
commit 9ffca830e5
2 changed files with 8 additions and 0 deletions

View File

@ -24,5 +24,6 @@ define swift::ringbuilder::rebalance(
path => ['/usr/bin'],
refreshonly => true,
before => Anchor['swift::config::end'],
returns => [0, 1],
}
}

View File

@ -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.