summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-14 16:29:10 -0700
committerSage Weil <sage@inktank.com>2013-06-17 15:47:36 -0700
commit261964adc5a7efe7c0efac2d527bc10a95498e45 (patch)
tree4a93902e2717a4b5e4c115d80fd3916bed254828
parente36fb3267cdbe0ec5bb01f8a012485de1bbf1652 (diff)
downloadceph-261964adc5a7efe7c0efac2d527bc10a95498e45.tar.gz
ceph-disk: clear TERM to avoid libreadline hijinx
The weird output from libreadline users is related to the TERM variable. Signed-off-by: Sage Weil <sage@inktank.com> (cherry picked from commit e538829f16ce19d57d63229921afa01cc687eb86)
-rwxr-xr-xsrc/ceph-disk5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ceph-disk b/src/ceph-disk
index 26097c8e089..3f15a9a1d22 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -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__':