082c26a27d
1. remove container feature table 2. do not generate feature entry if the feature is not included in the image 3. rename ENABLE_* to INCLUDE_* for better clarity 4. rename feature status to feature state 5. [submodule]: update sonic-utilities * 9700e45 2020-08-03 | [show/config]: combine feature and container feature cli (#1015) (HEAD, origin/master, origin/HEAD) [lguohan] * c9d3550 2020-08-03 | [tests]: fix drops_group_test failure on second run (#1023) [lguohan] * dfaae69 2020-08-03 | [lldpshow]: Fix input device is not a TTY error (#1016) [Arun Saravanan Balachandran] * 216688e 2020-08-02 | [tests]: rename sonic-utilitie-tests to tests (#1022) [lguohan] Signed-off-by: Guohan Lu <lguohan@gmail.com>
14 lines
465 B
Python
Executable File
14 lines
465 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import json
|
|
import subprocess
|
|
|
|
INIT_CFG_FILE_PATH = '/etc/sonic/init_cfg.json'
|
|
|
|
with open(INIT_CFG_FILE_PATH) as init_cfg_file:
|
|
init_cfg = json.load(init_cfg_file)
|
|
if 'FEATURE' in init_cfg:
|
|
for feature_name, feature_props in init_cfg['FEATURE'].items():
|
|
if 'state' in feature_props and feature_props['state'] == 'disabled':
|
|
subprocess.run(['systemctl', 'mask', '{}.service'.format(feature_name)])
|