iambus/xunlei-lixian — pull request #389 by lovewilliam (2014-03-20 16:44:35+00:00)
Title: fix HOME directory detection in lixian_config.py when using sudo.

billd / # sudo -u lovewilliam /opt/bin/node /opt/bin/lixian-portal
portal ready on http://*:3000/
Command failed: Traceback (most recent call last):
File "/opt/xunlei/lixian-portal/xunlei-lixian/lixian_cli.py", line 63,
in
execute_command()
File "/opt/xunlei/lixian-portal/xunlei-lixian/lixian_cli.py", line 60,
in execute_command
commands[command](args[1:])
File "/opt/xunlei/lixian-portal/xunlei-lixian/lixian_cli_parser.py",
line 165, in parse
return f(parser(args_list, *args, **kwargs))
File
"/opt/xunlei/lixian-portal/xunlei-lixian/lixian_commands/config.py",
line 36, in lx_config
put_config(*args)
File "/opt/xunlei/lixian-portal/xunlei-lixian/lixian_config.py", line
78, in put_config
global_config.put(k, v)
File "/opt/xunlei/lixian-portal/xunlei-lixian/lixian_config.py", line
58, in put
dump_config(self.path, self.values)
File "/opt/xunlei/lixian-portal/xunlei-lixian/lixian_config.py", line
42, in dump_config
with open(path, 'w') as x:
IOError: [Errno 13] Permission denied:
'/.xunlei.lixian.config'