Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hostcfgd] Add support to enable/disable optional features #3653

Merged
merged 9 commits into from
Nov 26, 2019
4 changes: 3 additions & 1 deletion files/image_config/hostcfgd/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class HostConfigDaemon:
syslog.syslog(syslog.LOG_ERR, "{} - failed: return code - {}, output:\n{}"
.format(err.cmd, err.returncode, err.output))
syslog.syslog(syslog.LOG_INFO, "Feature '{}' is enabled and started".format(key))
if status == "disabled":
elif status == "disabled":
stop_cmds=[]
stop_cmds.append("sudo systemctl stop {}".format(key))
stop_cmds.append("sudo systemctl disable {}".format(key))
Expand All @@ -339,6 +339,8 @@ class HostConfigDaemon:
syslog.syslog(syslog.LOG_ERR, "{} - failed: return code - {}, output:\n{}"
.format(err.cmd, err.returncode, err.output))
syslog.syslog(syslog.LOG_INFO, "Feature '{}' is stopped and disabled".format(key))
else:
syslog.syslog(syslog.LOG_ERR, "Unexpected status value for {}".format(key))
pra-moh marked this conversation as resolved.
Show resolved Hide resolved

def start(self):
self.config_db.subscribe('AAA', lambda table, key, data: self.aaa_handler(key, data))
Expand Down