-
Notifications
You must be signed in to change notification settings - Fork 85
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
[sonic-host-services]: Support GCU and reload #1
Conversation
config apply-patch config checkpoint config delete checkpoint config reload
|
GCU part LGTM. |
if 'Error' in line: | ||
msg = line | ||
break | ||
return result.returncode, msg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Execute command and return error message code seems dupe in multiple places, suggest create a new method.
test_ret = 0 | ||
test_msg = b"Error: this is the test message\nHello world\n" | ||
attrs = {"returncode": test_ret, "stderr": test_msg} | ||
res_mock.configure_mock(**attrs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest create a new method for dupe code.
@bhagatyj Could you or your team help review? |
This pull request introduces 1 alert when merging 8287786 into 6eac2d3 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging be6b250 into 6eac2d3 - view on LGTM.com new alerts:
|
host_modules/config_engine.py
Outdated
def reload(self, config_db_json): | ||
|
||
cmd = ['/usr/local/bin/config', 'reload', '-y'] | ||
config_db_json = config_db_json.strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still have the question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if config_db_json and len(config_db_json.strip()):
Now I use len(config_db_json.strip()) to detect string with only spaces, and config_db_json is still the same.
Statistics -- update added
Signed-off-by: Gang Lv ganglv@microsoft.com
Why I did it
GNMI needs to use host service to invoke generic_config_updater and config reload.
How I did it
Add host_modules for generic_config_updater and config reload.
Add unit test for host modules.
How to verify it
Run unit test for sonic-host-services.