Skip to content
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

UpdateConfigHdr: Gracefully exit when filepath is None #378

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

Javagedes
Copy link
Contributor

@Javagedes Javagedes commented Jul 9, 2024

Description

GetAbsolutePathOnThisSystemFromEdk2RelativePath will log an error message and return None if absolute path could not be determined. Due to this, file should be checked against None, not os.path.isfile.

You can see that in the GetAbsolutePathOnThisSystemFromEdk2RelativePath that we return a str if the absolute path is found, else None.

Currently, when a path is not found, you get this exception and trace:
image

  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

N/A

Integration Instructions

N/A

`GetAbsolutePathOnThisSystemFromEdk2RelativePath` will log an error
message and return `None` if absolute path could not be determined. Due
to this, file should be checked against `None`, not `os.path.isfile`.
@github-actions github-actions bot added language:python Pull requests that update Python code impact:non-functional Does not have a functional impact labels Jul 9, 2024
@Javagedes Javagedes requested review from os-d and apop5 July 9, 2024 15:57
@Javagedes Javagedes added the type:bug Something isn't working label Jul 9, 2024
@Javagedes Javagedes merged commit e69e758 into microsoft:main Jul 9, 2024
14 checks passed
ProjectMuBot referenced this pull request in microsoft/mu_tiano_platforms Jul 17, 2024
apop5 referenced this pull request in microsoft/mu_tiano_platforms Jul 23, 2024
Bumps Features/CONFIG from `2.0.12` to `2.0.13`


Introduces 4 new commits in
[Features/CONFIG](https://github.com/microsoft/mu_feature_config.git).

<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/microsoft/mu_feature_config/commit/e87f7ca0520eb086357df22b323357d377693bc1">e87f7c</a>
GitHub Action: Bump robinraju/release-downloader from 1.10 to 1.11 (<a
href="https://github.com/microsoft/mu_feature_config/pull/375">#375</a>)</li>
<li><a
href="https://github.com/microsoft/mu_feature_config/commit/e69e758a3ead909a79260666b037899102e4b6a6">e69e75</a>
UpdateConfigHdr: Gracefully exit when filepath is `None` (<a
href="https://github.com/microsoft/mu_feature_config/pull/378">#378</a>)</li>
<li><a
href="https://github.com/microsoft/mu_feature_config/commit/3f520bb761ba428e77e3e06052ba1060aed83b3d">3f520b</a>
pip: bump edk2-pytool-extensions from 0.27.6 to 0.27.8 (<a
href="https://github.com/microsoft/mu_feature_config/pull/376">#376</a>)</li>
<li><a
href="https://github.com/microsoft/mu_feature_config/commit/c781a93b8812ea00609dac71e2f16532a43fe044">c781a9</a>
pip: bump edk2-pytool-extensions from 0.27.8 to 0.27.9 (<a
href="https://github.com/microsoft/mu_feature_config/pull/379">#379</a>)</li>
</ul>
</details>

Signed-off-by: Project Mu Bot <mubot@microsoft.com>

Signed-off-by: Project Mu Bot <mubot@microsoft.com>
Co-authored-by: Aaron <105021049+apop5@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact language:python Pull requests that update Python code type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants