Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
"""
watch_notify_same_primary task
"""
-from cStringIO import StringIO
+from io import BytesIO
import contextlib
import logging
"watch",
obj(n)],
stdin=run.PIPE,
- stdout=StringIO(),
- stderr=StringIO(),
+ stdout=BytesIO(),
+ stderr=BytesIO(),
wait=False)
return proc
for i in range(num):
with safe_while() as proceed:
while proceed():
- proc = remote.run(
- args = [
- "rados",
- "-p", pool,
- "listwatchers",
- obj(i)],
- stdout=StringIO())
- lines = proc.stdout.getvalue()
+ lines = remote.sh(
+ ["rados", "-p", pool, "listwatchers", obj(i)])
num_watchers = lines.count('watcher=')
log.info('i see %d watchers for %s', num_watchers, obj(i))
if num_watchers >= 1: