puppetlabs / ruby-pwsh

A ruby gem for interacting with PowerShell
MIT License
15 stars 23 forks source link

(GH-141) Simplify set logic in DSC Base Provider #153

Closed michaeltlombardi closed 3 years ago

michaeltlombardi commented 3 years ago

This commit cleans up and simplifies the logic in the DSC Base Provider; prior to this commit, the set method included handling for nil is and should states in the change hash; with the current implementation, neither of these values can ever be nil without reaching a runtime error prior to this method being called.

This commit therefore removes the complexity for handling cases where is or should are nil and removes the never-called method create_absent as it is not needed.

This commit further simplifies the set method by removing custom handling for retrieving the name hash as the names for Puppetized DSC Resources are always hashes and any extraneous values are stripped in invoke_set_method itself.

Resolves #141