You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/05/08 14:24:37 UTC

cloudstack-cloudmonkey git commit: Fix KeyError: 'TERM' when no TERM exist

Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master 103575583 -> 4a982ddd0


Fix KeyError: 'TERM' when no TERM exist

- There is no TERM variable called from script
  in docker guest.
  It cause KeyError: 'TERM'.

This closes #3

Signed-off-by: Hiroshi Miura <mi...@linux.com>
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/4a982ddd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/4a982ddd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/4a982ddd

Branch: refs/heads/master
Commit: 4a982ddd099417c9f6fa29e55c8d9789a365165c
Parents: 1035755
Author: Hiroshi Miura <mi...@linux.com>
Authored: Fri May 8 06:42:53 2015 +0000
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri May 8 14:24:11 2015 +0200

----------------------------------------------------------------------
 cloudmonkey/cloudmonkey.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/4a982ddd/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index d37b353..b8b4e77 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -57,7 +57,8 @@ except ImportError:
 normal_readline = True
 # Fix terminal env before importing readline
 # Without it, char ESC[?1034h gets printed in output
-if os.environ['TERM'].startswith('xterm'):
+# There is not TERM variable in some environment such as Docker.
+if not 'TERM' in os.environ or os.environ['TERM'].startswith('xterm'):
     os.environ['TERM'] = 'vt100'
 try:
     import readline