Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

fortimgr_policy (incorrectly?) saves changes when param "lock" is false but a reference policy/direction and session set #84

@jcsicard

Description

@jcsicard

Fortimgr_policy automatically saves changes even if parameter "lock" is set to false when a session id is provided.

This seems stem from a few instances of

            if module.params["session_id"]:
                self.save()

at lines 1677, 1724 and 1731 of fortimgr_policy.py, in the config_move function.

Is this the intended behaviour?

I'm also not sure what the purpose of saving the fmg workspace at those points is? Seems like it might be a API workaround to sync the FMG's state before looking up reference policy id/name. Is this right and if so actually/still required?

The behavior as it is right now messes up externally managed (through fortimgr_lock) workspace state. For example, when batch updating a policy package through a playbook, I want the whole FMG workspace to revert (unlock without save) if there is an error in a individual policy change.

JC

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