open-iscsi / configshell-fb

configshell with additional modifications, see README
Apache License 2.0
28 stars 37 forks source link

configshell-fb raises KeyError: 'TERM' #39

Closed liushaobot closed 7 years ago

liushaobot commented 7 years ago

After the installation of ceph-iscsi-cli, systemctl daemon-reload, systemctl enable rbd-target-api and systemctl start rbd-target-api, I check the status of rbd-target-api daemon. Then, I get the following error:

11月 08 17:08:56 localhost.localdomain rbd-target-api[4770]:   File "/usr/lib/python2.7/site-packages/configshell_fb-1.1.23-py2.7.egg/con
11月 08 17:08:56 localhost.localdomain rbd-target-api[4770]:     from .shell import ConfigShell
11月 08 17:08:56 localhost.localdomain rbd-target-api[4770]:   File "/usr/lib/python2.7/site-packages/configshell_fb-1.1.23-py2.7.egg/con
11月 08 17:08:56 localhost.localdomain rbd-target-api[4770]:     oldTerm = os.environ['TERM']
11月 08 17:08:56 localhost.localdomain rbd-target-api[4770]:   File "/usr/lib64/python2.7/UserDict.py", line 40, in __getitem__
11月 08 17:08:56 localhost.localdomain rbd-target-api[4770]:     raise KeyError(key)
11月 08 17:08:56 localhost.localdomain rbd-target-api[4770]: KeyError: 'TERM'
11月 08 17:08:56 localhost.localdomain systemd[1]: rbd-target-api.service: Main process exited, code=exited, status=1/FAILURE
11月 08 17:08:56 localhost.localdomain systemd[1]: rbd-target-api.service: Unit entered failed state.
11月 08 17:08:56 localhost.localdomain systemd[1]: rbd-target-api.service: Failed with result 'exit-code'.

However, I get xterm after executing printenv Term. And

[root@localhost ceph-iscsi-cli-2.5]# python
Python 2.7.13 (default, Sep  5 2017, 08:53:59)
[GCC 7.1.1 20170622 (Red Hat 7.1.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['TERM']
'xterm'
>>>

What it is? And how could I correct it? Thanks!

liushaobot commented 7 years ago

I solved the problem by dnf install python-configshell. Sorry for this!