Skip to content

fix: use clean authoritative flag before checking it (#138)#162

Open
AloizioMacedo wants to merge 1 commit intocanonical:3.7from
AloizioMacedo:auto-backport-2147570-3.7
Open

fix: use clean authoritative flag before checking it (#138)#162
AloizioMacedo wants to merge 1 commit intocanonical:3.7from
AloizioMacedo:auto-backport-2147570-3.7

Conversation

@AloizioMacedo
Copy link
Copy Markdown
Contributor

The main issue was that the validation was being done before any treatment of the inputs, so self.data.get("authoritative") was returning the string that was used in the CLI command (or the API).

Specifically, for example, setting authoritative=false resulted in the code thinking that there was a violation.

Funnily enough, setting authoritative to an empty string would let things pass through, even though authoritative at the end (in the model) would be True due to its default value there.

Resolves LP:2147570

(cherry picked from commit db29503)

The main issue was that the validation was being done before any
treatment of the inputs, so `self.data.get("authoritative")` was
returning the string that was used in the CLI command (or the API).

Specifically, for example, setting `authoritative=false` resulted in the
code thinking that there was a violation.

Funnily enough, setting `authoritative` to an empty string would let
things pass through, even though authoritative at the end (in the model)
would be True due to its default value there.

Resolves [LP:2147570](https://bugs.launchpad.net/maas/+bug/2147570)

(cherry picked from commit db29503)
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.

1 participant