Skip to content

Added configurable empty_compliance_behavior setting to `GoldenConf…#1105

Open
itdependsnetworks wants to merge 2 commits intonautobot:developfrom
itdependsnetworks:add-na
Open

Added configurable empty_compliance_behavior setting to `GoldenConf…#1105
itdependsnetworks wants to merge 2 commits intonautobot:developfrom
itdependsnetworks:add-na

Conversation

@itdependsnetworks
Copy link
Copy Markdown
Contributor

…igSetting` to control how compliance is evaluated when configurations are empty.

Fixes: #421 and potentially solution for #518

…igSetting` to control how compliance is evaluated when configurations are empty.
@github-actions
Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  nautobot_golden_config
  choices.py
  models.py 159, 164-165
  tables.py
  views.py 438-440
Project Total  

This report was generated by python-coverage-comment-action

Comment thread nautobot_golden_config/metrics.py
Comment thread nautobot_golden_config/models.py Outdated
device = models.ForeignKey(to="dcim.Device", on_delete=models.CASCADE, help_text="The device")
rule = models.ForeignKey(to="ComplianceRule", on_delete=models.CASCADE, related_name="rule")
compliance = models.BooleanField(blank=True)
compliance = models.BooleanField(blank=True, null=True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a default= here too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to me, no. We want the caller to be explicit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, thought there was considerations on default= when changing null=True, for existing rows in the DB.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the boolean must have been set, so there is nothing to migrate, we are are only adding a nullable value.

Comment thread nautobot_golden_config/tables.py
Comment thread nautobot_golden_config/template_content.py
Comment thread nautobot_golden_config/template_content.py
Comment thread nautobot_golden_config/views.py
Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>
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.

Configurable Output When Nothing to Compare

3 participants