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

[SCLabelPolicy] Test method would always return false when the policy existed #2948

Closed
ykuijs opened this issue Feb 28, 2023 · 0 comments · Fixed by #2950 or #2953
Closed

[SCLabelPolicy] Test method would always return false when the policy existed #2948

ykuijs opened this issue Feb 28, 2023 · 0 comments · Fixed by #2950 or #2953
Assignees
Labels

Comments

@ykuijs
Copy link
Member

ykuijs commented Feb 28, 2023

Details of the scenario you tried and the problem that is occurring

The Test method for the SCLabelPolicy resource would always return false when the policy existed and was in the desired state. This was because the value would always be treated as a string but actually was an array.

Verbose logs showing the problem

VERBOSE: [DESKTOP-6JBI6T8]: [[SCLabelPolicy]58adabb3-68ad-40f8-9426-9c6672ad05b0] Test AdvancedSetting
s returns False
VERBOSE: [DESKTOP-6JBI6T8]: LCM: [ End Test ] [[SCLabelPolicy]58adabb3-68ad-40f8-9426-9c6672ad05b0] in 1.7970 seconds.

Suggested solution to the issue

When the parameter only has one value, make sure this is converted into a string before compare.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

        SCLabelPolicy 58adabb3-68ad-40f8-9426-9c6672ad05b0 
        {
            AdvancedSettings     = @(
                MSFT_SCLabelSetting
                {
                    Key   = 'siteandgroupdefaultlabelid'
                    Value = 'Public'
                }

The Public value is a single string, but the code treats this as an array.

The operating system the target node is running

Version of the DSC module that was used ('dev' if using current dev branch)

Dev

@ykuijs ykuijs added Bug Something isn't working Security & Compliance Center labels Feb 28, 2023
@ykuijs ykuijs self-assigned this Feb 28, 2023
ykuijs added a commit that referenced this issue Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant