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

vdk-control-cli: fix circular import dependecy #1820

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

antoniivanov
Copy link
Collaborator

There is a circular import issue between the
vdk.internal.control.configuration.vdk_config and
vdk.internal.control.command_groups.version_group.version modules. Specifically, vdk_config is importing version and version is importing cli_utils, which is importing vdk_config. This creates a cycle that cannot be resolved, which is causing the ImportError under certain circumstances.

To fix this issue, I need to refactor the code to remove the circular import. I moved the methods for determining verison in version utils which is used by both vdk_config and version_group.version modules.

There is a circular import issue between the
vdk.internal.control.configuration.vdk_config and
vdk.internal.control.command_groups.version_group.version modules.
Specifically, vdk_config is importing version and version is importing
cli_utils, which is importing vdk_config. This creates a cycle that
cannot be resolved, which is causing the ImportError under certain
circumstances.

To fix this issue, I need to refactor the code to remove the circular
import. I moved the methods for determining verison in version utils
which is used by both vdk_config and version_group.version modules.

Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
@antoniivanov antoniivanov merged commit c35841b into main Apr 3, 2023
6 of 7 checks passed
@antoniivanov antoniivanov deleted the person/aivanov/vdk-control-cli-version branch April 3, 2023 09:09
yonitoo pushed a commit that referenced this pull request Apr 4, 2023
There is a circular import issue between the
vdk.internal.control.configuration.vdk_config and
vdk.internal.control.command_groups.version_group.version modules.
Specifically, vdk_config is importing version and version is importing
cli_utils, which is importing vdk_config. This creates a cycle that
cannot be resolved, which is causing the ImportError under certain
circumstances.

To fix this issue, I need to refactor the code to remove the circular
import. I moved the methods for determining verison in version utils
which is used by both vdk_config and version_group.version modules.

---------

Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants