From: Sage Weil Date: Wed, 30 Oct 2019 15:33:52 +0000 (-0500) Subject: ceph-daemon: make StringIO usage py2 compatible X-Git-Tag: v15.1.0~1104^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=749a0bdb61ff8f3ec11119e14e85dfd2ee78ec33;p=ceph.git ceph-daemon: make StringIO usage py2 compatible Otherwise, Traceback (most recent call last): File "../src/ceph-daemon", line 1698, in r = args.func() File "../src/ceph-daemon", line 767, in command_bootstrap with StringIO() as f: AttributeError: StringIO instance has no attribute '__exit__' Signed-off-by: Sage Weil --- diff --git a/src/ceph-daemon b/src/ceph-daemon index 9ac185a47426..292969a80103 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -764,9 +764,9 @@ def command_bootstrap(): cp.add_section('global') cp.set('global', 'fsid', fsid); cp.set('global', 'mon host', addr_arg) - with StringIO() as f: - cp.write(f) - config = f.getvalue() + cpf = StringIO() + cp.write(cpf) + config = cpf.getvalue() if not args.skip_ping_check: logger.info('Verifying we can ping mon IP %s...' % mon_ip)