[sonic-package-manager] implement blocking feature state change#38
Closed
stepanblyschak wants to merge 4 commits intomasterfrom
Closed
[sonic-package-manager] implement blocking feature state change#38stepanblyschak wants to merge 4 commits intomasterfrom
stepanblyschak wants to merge 4 commits intomasterfrom
Conversation
5 tasks
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
06ce7fb to
c3ad9d4
Compare
stepanblyschak
commented
Jan 17, 2022
Comment on lines
+33
to
+38
| db = swsscommon.DBConnector('STATE_DB', 0) | ||
| tbl = swsscommon.SubscriberStateTable(db, 'FEATURE') | ||
| sel = swsscommon.Select() | ||
|
|
||
| sel.addSelectable(tbl); | ||
|
|
Owner
Author
There was a problem hiding this comment.
move outside of while block to run this code only once.
sonic_package_manager/manager.py
Outdated
| run_command(f'systemctl {action} {name}@{npu}') | ||
| feature_name = package.manifest['service']['name'] | ||
| log.info('{} {}'.format(state.replace('ed', 'ing').capitalize(), feature_name)) | ||
| set_feature_state(Db(), feature_name, state, block) |
Owner
Author
There was a problem hiding this comment.
Db() make member object.
sonic_package_manager/manager.py
Outdated
| service_creator, | ||
| device_info, | ||
| filelock.FileLock(PACKAGE_MANAGER_LOCK_FILE, timeout=0)) | ||
|
|
Owner
Author
There was a problem hiding this comment.
check if not reduntand new line
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
be56bff to
027f294
Compare
volodymyrsamotiy
approved these changes
Jan 18, 2022
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Stepan Blyschak stepanb@nvidia.com
What I did
Implement blocking feature state change for CLI command and sonic-package-manager.
How I did it
Implemented a wait loop that blocks till feature reaches desired state.
How to verify it
Run UT, run on switch.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)