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

Don't commit if not changes #686

Closed
mngan opened this issue Feb 14, 2023 · 0 comments
Closed

Don't commit if not changes #686

mngan opened this issue Feb 14, 2023 · 0 comments
Assignees
Projects

Comments

@mngan
Copy link
Contributor

mngan commented Feb 14, 2023

Peering Manager version

1.7.4

Python version

3.9

Steps to Reproduce

calling set_napalm_configuration(cfg, commit=True) will trigger a commit even if there are no changes.

Expected Behavior

Ideally, no commit should get triggered. Test if changes is not empty before committing in set_napalm_configuration

peering/models/models.py#L1289

                if commit and changes:
                    self.logger.debug(f"commiting configuration on {self.hostname}")
                    device.commit_config()
                else:
                    self.logger.debug(f"discarding configuration on {self.hostname}")
                    device.discard_config()

Observed Behavior

Commit history getting filled with hourly revisions with empty commits

@gmazoyer gmazoyer self-assigned this Feb 14, 2023
@gmazoyer gmazoyer added this to To do in Core via automation Feb 14, 2023
Core automation moved this from To do to Done Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Core
Done
Development

No branches or pull requests

2 participants