-
Notifications
You must be signed in to change notification settings - Fork 817
[fwutil] Add fwutil update all to support the automatic platform component fw updates
#1242
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6d6633f
support
sujinmkang 53ec476
move get_au_status to ComponentStatusProvider
sujinmkang f4574c9
add platform_fw_au_reboot_plugin
sujinmkang 7efd058
review comments
sujinmkang f29a5b4
review comments
sujinmkang 853d276
type_cast
sujinmkang 15cb89d
type_cast2
sujinmkang a2ac11c
review comments
sujinmkang 393fc18
review comments
sujinmkang 68cdb1e
:Merge branch 'master' into fwutil_rebase
sujinmkang f46a3b4
Changes based on hld
sujinmkang 228e47f
update to support the combined platform with modular and non-modular
sujinmkang 4261570
Review comments from dell
sujinmkang da1e4ef
Merge branch 'master' into fwutil_rebase
sujinmkang dd59bea
review comments
sujinmkang ef3ca37
fix lgtm
sujinmkang 9c6436a
Update the ComponentStatusProvider to parse the fw_au_status file cor…
sujinmkang fb538e9
fix lgtm
sujinmkang 0a666fe
Fix review feedback
sujinmkang 1029c54
Fix the after-reboot remaining auto update status issue
sujinmkang a496b82
Ignore VERSION_KEY as a missing_key since some platform can get the a…
sujinmkang be7782a
Remove unnecessary missing key check and add reboot precheck for conf…
sujinmkang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,7 +33,7 @@ | |||||||||||
| NA = "N/A" | ||||||||||||
| NEWLINE = "\n" | ||||||||||||
| PLATFORM_COMPONENTS_FILE = "platform_components.json" | ||||||||||||
| FIRMWARE_UPDATE_DIR = "/tmp/firmwareupdate/" | ||||||||||||
| FIRMWARE_UPDATE_DIR = "/var/platform/" | ||||||||||||
| FWUPDATE_FWPACKAGE_DIR = os.path.join(FIRMWARE_UPDATE_DIR, "fwpackage/") | ||||||||||||
| FW_AU_TASK_FILE_REGEX = "*_fw_au_task" | ||||||||||||
| FW_AU_STATUS_FILE = "fw_au_status" | ||||||||||||
|
|
@@ -843,27 +843,6 @@ def set_firmware_auto_update_status(self, component_path, boot, rt_code): | |||||||||||
| self.update_au_status_file(data, FW_AU_STATUS_FILE_PATH) | ||||||||||||
| return (status, info) | ||||||||||||
|
|
||||||||||||
| def get_au_status(self): | ||||||||||||
| au_status = [] | ||||||||||||
| auto_updated_status_table = [] | ||||||||||||
| data = self.read_au_status_file_if_exists(FW_AU_STATUS_FILE_PATH) | ||||||||||||
|
|
||||||||||||
| if data is None: | ||||||||||||
| return None | ||||||||||||
|
|
||||||||||||
| boot_type = list(data.keys())[0] | ||||||||||||
| click.echo("Firmware auto-update performed for {} reboot".format(boot_type)) | ||||||||||||
|
|
||||||||||||
| au_status = data[boot_type] | ||||||||||||
| for comp_au_status in au_status: | ||||||||||||
| r = [] | ||||||||||||
| r.append(comp_au_status['comp'] if 'comp' in comp_au_status else "") | ||||||||||||
| r.append(comp_au_status['status'] if 'status' in comp_au_status else "") | ||||||||||||
| r.append(comp_au_status['info'] if 'info' in comp_au_status else "") | ||||||||||||
| auto_updated_status_table.append(r) | ||||||||||||
|
|
||||||||||||
| return tabulate(auto_updated_status_table, self.AU_STATUS_HEADER, tablefmt=self.FORMAT) | ||||||||||||
|
|
||||||||||||
| def auto_update_firmware(self, component_au_info, boot): | ||||||||||||
| is_chassis_component = component_au_info[0] | ||||||||||||
| chassis_name = component_au_info[1] | ||||||||||||
|
|
@@ -972,12 +951,19 @@ class ComponentStatusProvider(PlatformDataProvider): | |||||||||||
| ComponentStatusProvider | ||||||||||||
| """ | ||||||||||||
| HEADER = [ "Chassis", "Module", "Component", "Version", "Description" ] | ||||||||||||
| AU_STATUS_HEADER = [ "Component", "Status", "Info", "Boot" ] | ||||||||||||
| AU_STATUS_HEADER = [ "Component", "Version", "Status", "Info" ] | ||||||||||||
| FORMAT = "simple" | ||||||||||||
| INFO_KEY = "info" | ||||||||||||
|
|
||||||||||||
| def __init__(self): | ||||||||||||
| PlatformDataProvider.__init__(self) | ||||||||||||
|
|
||||||||||||
| def __is_dict(self, obj): | ||||||||||||
| return isinstance(obj, dict) | ||||||||||||
|
|
||||||||||||
| def __parser_fail_fw_au_status(self, msg): | ||||||||||||
| raise RuntimeError("Failed to parse \"{}\": {}".format(FW_AU_STATUS_FILE_PATH, msg)) | ||||||||||||
|
|
||||||||||||
| def get_status(self): | ||||||||||||
| status_table = [ ] | ||||||||||||
|
|
||||||||||||
|
|
@@ -1050,13 +1036,22 @@ def get_au_status(self): | |||||||||||
| if data is None: | ||||||||||||
| return None | ||||||||||||
|
|
||||||||||||
| boot_type = list(data.keys())[0] | ||||||||||||
| click.echo("Firmware auto-update performed for {} reboot".format(boot_type)) | ||||||||||||
| for comp_path, comp_au_status in data.items(): | ||||||||||||
| if not self.__is_dict(comp_au_status): | ||||||||||||
|
||||||||||||
| for comp_path, comp_au_status in data.items(): | |
| if not self.__is_dict(comp_au_status): | |
| for comp_path, au_status in data.items(): | |
| for comp_au_status in au_status: | |
| if not self.__is_dict(comp_au_status): |
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.
Uh oh!
There was an error while loading. Please reload this page.