From 3560f603076df00ddabe88d372f7e862196e0b17 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Tue, 26 Nov 2019 09:44:38 -0700 Subject: [PATCH] ceph-daemon: seek relative to the start of file python3 only allows seeks relative to the start of a text file Signed-off-by: Michael Fritch --- src/ceph-daemon/ceph-daemon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ceph-daemon/ceph-daemon b/src/ceph-daemon/ceph-daemon index 37bb1f9465b..0e592d8223a 100755 --- a/src/ceph-daemon/ceph-daemon +++ b/src/ceph-daemon/ceph-daemon @@ -1145,9 +1145,9 @@ def command_bootstrap(): add_newline = False if os.path.exists(auth_keys_file): with open(auth_keys_file, 'r') as f: - f.seek(0, 2) + f.seek(0, os.SEEK_END) if f.tell() > 0: - f.seek(-1, 2) # go to last character + f.seek(f.tell()-1, os.SEEK_SET) # go to last char if f.read() != '\n': add_newline = True with open(auth_keys_file, 'a') as f: -- 2.47.3