Skip to content

Conversation

@glinkinvd
Copy link
Contributor

@glinkinvd glinkinvd commented Apr 16, 2025

Prior to this commit, machine applier applied custom policies due to bad logic in check_enabled() in the applier_frontend.py file.

It used to be like this

def check_enabled(storage, module_name, is_experimental):
    module_enabled = check_module_enabled(storage, module_name)
    exp_enabled = check_experimental_enabled(storage)

    result = False

    if None == module_enabled:
        if is_experimental and exp_enabled:
            result = True
        if not is_experimental:
            result = True
    else:
        result = module_enabled

    return result

If the module is not in dconf, we returned True for some reason and enabled it. This is not a very good approach.
With my commit, the logic got better.

@danila-Skachedubov
Copy link
Collaborator

Regarding the commits with proposed code refactoring: these changes should be submitted as a separate pull request that proposes a consistent style change across the entire project. Such a PR should include thorough testing to ensure functionality is preserved. Code style changes should be isolated from functional changes to make review and testing more straightforward.

@glinkinvd
Copy link
Contributor Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants