fix conf parsing

This commit is contained in:
Alexey Avramov 2018-12-12 03:14:35 +09:00
parent 158404867f
commit 83c1fd1018
3 changed files with 6 additions and 8 deletions

View File

@ -194,6 +194,7 @@ Please create [issues](https://github.com/hakavlad/nohang/issues). Use cases, fe
- Print in terminal with colors
- Optimize limiting `oom_score_adj`: now it can works without UID=0
- Optimize GUI warnings: find env without run `ps` and `env` (partially implemented)
- Fix conf parsing: use of `line.partition('=')` instead of `line.split('=')`
- Add `oom-sort`
- Add `oom-trigger` (partially implemented)

7
nohang
View File

@ -813,8 +813,8 @@ try:
etc = line.startswith('$ETC')
if not a and not b and not c and not d and not etc:
a = line.split('=')
config_dict[a[0].strip()] = a[1].strip()
a = line.partition('=')
config_dict[a[0].strip()] = a[2].strip()
if etc:
a = line[4:].split('///')
@ -1387,9 +1387,6 @@ if print_config:
print('avoid_re_uid: {}'.format(avoid_re_uid))
print('avoid_uid_factor: {}'.format(avoid_uid_factor))
print('\n5. The execution of a specific command instead of sending the\nSIGTERM signal\n')
print('execute_the_command: {}'.format(execute_the_command))
if execute_the_command:

View File

@ -167,9 +167,9 @@ avoid_factor = 3
# re_match_cmdline = True
# this default pattern for prefer childs of chromium & firefox
prefer_re_cmdline = renderer|childID
prefer_cmd_factor = 10
# this default pattern for prefer
# childs of firefox and chromium
prefer_re_cmdline = -childID|--type=renderer
avoid_re_cmdline = ^/usr/lib/virtualbox
avoid_cmd_factor = 3