-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added suit-generator payload_extract command #147
Added suit-generator payload_extract command #147
Conversation
+ "If not provided, the payload will not be stored to a file.") | ||
|
||
cmd_payload_extract_arg_parser.add_argument( | ||
"--payload-replace-name", |
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.
should not that be path
not name
?
I find it difficult to understand this arg description.
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.
You're absolutely right, should be path, changed this
pytest coverage results
Note: This message is automatically posted and updated by the CI (latest/test-sdk-dfu/master/204) |
:param payload_replace_name: name of the integrated payload to replace the extracted payload with. | ||
None if the payload should be removed from the envelope. | ||
""" | ||
envelope = None |
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.
The envelope
value is immediately assigned in line 56 as envelope = cbor2.load(fh)
, so the initial assignment is redundant and could be removed
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.
Fixed
envelope = cbor2.load(fh) | ||
extracted_payload = envelope.value.pop(payload_name, None) | ||
|
||
if extracted_payload == None: |
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 extracted_payload == None: | |
if extracted_payload is None: |
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.
Fixed
if extracted_payload == None: | ||
log.log(logging.ERROR, 'Payload "%s" not found in envelope', payload_name) | ||
|
||
if payload_replace_name != None: |
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 payload_replace_name != None: | |
if payload_replace_name is not None: |
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.
Fixed
|
||
with open(output_envelope, "wb") as fh: | ||
cbor2.dump(envelope, fh) | ||
if output_payload_file != None: |
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 output_payload_file != None: | |
if output_payload_file is not None: |
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.
Fixed
52d1ead
to
82b6cce
Compare
The payload allows for extracting/removing/replacing integrated payloads in the envelope. Ref: NCSDK-29708 Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
82b6cce
to
44ee5bd
Compare
The payload allows for extracting/removing/replacing integrated payloads in the envelope.
Ref: NCSDK-29708