这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jstucke
Copy link
Collaborator

@jstucke jstucke commented Oct 2, 2024

  • feat: added CLI script for importing/exporting FW (including unpacked files and analysis results)

resolves #1250, resolves #446

@jstucke jstucke added the feature label Oct 2, 2024
@jstucke jstucke requested a review from dorpvom October 2, 2024 14:50
@jstucke jstucke self-assigned this Oct 2, 2024
@jstucke jstucke closed this Oct 2, 2024
@jstucke jstucke force-pushed the cli-import-export branch from dc9ce3c to adfbfe8 Compare October 2, 2024 14:55
@jstucke jstucke reopened this Oct 2, 2024
def main():
args = _parse_args()
if args.command == 'export':
FwExporter(args.output).export_files(args.uids)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AttributeError: 'Namespace' object has no attribute 'uids'
"uids" is unknown because it is called "UIDs" in line 175. We should use a consistent spelling

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

except json.JSONDecodeError as error:
logging.error(f'Error: data.json is not a valid JSON file: {error}')
return
if not all(k in data for k in ['db_revision', 'files', 'firmware', 'uid']):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should explain in the description that a data.json is mandatory and which keys it must contain. Otherwise, users who want to use the tool to import firmware (which has not been exported before) will have to look at the code to find out which keys are needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an message to the first error that explicitly states that the script is only for importing files that were previously exported by this script

@jstucke jstucke requested a review from euwint October 30, 2024 12:39
@jstucke jstucke merged commit 355762e into master Oct 31, 2024
9 of 10 checks passed
@jstucke jstucke deleted the cli-import-export branch October 31, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to import/export firmware database between FACT instances? Import-Export analysys result

3 participants