peer.py: we can't assume pg query state will match mon pg state

The pg state could easily have changed in the mean time,
for example, from recovery_wait to recovering.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Samuel Just 2013-04-12 15:01:04 -07:00
parent 35e6db72a1
commit 2c7b1f3d62

View File

@ -23,11 +23,6 @@ def rados(ctx, remote, cmd):
)
return proc.exitstatus
def normalize_state(r):
r = r.replace('+scrubbing', '')
r = r.replace('+deep', '')
return r
def task(ctx, config):
"""
Test peering.
@ -90,7 +85,6 @@ def task(ctx, config):
log.debug("out string %s",out)
j = json.loads('\n'.join(out.split('\n')[1:]))
log.info("pg is %s, query json is %s", pg, j)
assert normalize_state(j['state']) == normalize_state(pg['state'])
if pg['state'].count('down'):
num_down_pgs += 1