]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: clear TERM to avoid libreadline hijinx
authorSage Weil <sage@inktank.com>
Fri, 14 Jun 2013 23:29:10 +0000 (16:29 -0700)
committerSage Weil <sage@inktank.com>
Mon, 17 Jun 2013 18:16:42 +0000 (11:16 -0700)
The weird output from libreadline users is related to the TERM variable.

Signed-off-by: Sage Weil <sage@inktank.com>
src/ceph-disk

index 26097c8e0897371950ec8d4f54c7473df30c0a5e..3f15a9a1d220312f449b728e396ad9a99e732345 100755 (executable)
@@ -57,6 +57,11 @@ INIT_SYSTEMS = [
     'auto',
     ]
 
+# Nuke the TERM variable to avoid confusing any subprocesses we call.
+# For example, libreadline will print weird control sequences for some
+# TERM values.
+if 'TERM' in os.environ:
+    del os.environ['TERM']
 
 LOG_NAME = __name__
 if LOG_NAME == '__main__':