Skip to content

Refactor: Remove redundant for loops and consolidate fmpm commands #1

@ave6192

Description

@ave6192

Proposed Improvements

Proper Exit Code on Failure

The script should exit with code 1 if it fails to fetch Fabric Manager partitions. This ensures downstream processes or users are clearly informed of the failure.

Loop and Logic Refactor

Some for loops are redundant — partitions are listed and iterated over multiple times unnecessarily.

The commands gpus_bdf_to_mod and gpus_mod_to_bdf can be constructed within a single loop, reducing duplication and improving readability.

Rationale

These changes aim to:

Improve clarity and maintainability.

Reduce unnecessary iterations and duplication.

Ensure robust error signaling without altering the intended functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions