Closed ShawnHardwick closed 1 year ago
Another interesting one. Thanks @ShawnHardwick
I'm experiencing the same issue. Is there a workaround available?
@Hvid The current workaround I have in place to continue my testing involved converting the class variables to instance variables in the dsc provider in pwshlib
. You can find the exact changes here:
I am not running this in production so use at your own risk. I'll let Puppet develop the correct solution.
@ShawnHardwick nice. Do you want to submit this as a PR on pwshlib?
hi @ShawnHardwick. This is a really good spot, we appreciate the work. I'm going to ticket this up and have a look at it soon. Thanks again for the contributions.
Sorry for the long delay in responding. I am no longer in a role to follow up on this unfortunately so I won't be able to contribute much outside of what I've provided.
Hey @ShawnHardwick - Understand this may be of no help to you now.. But just wanted to shout out that we shipped your fix, so thanks for the help with this one!
Even though I'm not actively working on it, I'm glad this was made available for others. Thanks for following up on it @jordanbreen28
Describe the Bug
Execute both resources in the same Puppet catalog:
Catalog apply fails with below error:
dsc_systemlocale
applies successfullyExpected Behavior
Both resource succeed without failure
Environment
Additional Context
I added some debugging statements to the
get()
function within thedsc_base_provider
provider.It appears that the
@@cached_canonicalized_resource
contains other DSC resources from the catalog when it shouldn't. Due to this line, it grabs the first one. I'm not sure yet if@@cached_canonicalized_resource
contains all defined resources from the catalog or all resources from the catalog for that module (dsc-computermanagementdsc). https://github.com/puppetlabs/ruby-pwsh/blob/main/lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb#L132In the above case, it is comparing the mandatory and namevar attributes against the
dsc_systemlocale
DSC resource which is the wrong one.It incorrectly generates the below DSC script. Notice that the
Invoke-DSCResource
is missing theTimeZone
parameter.