You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When providing a timestamp formatted string to a parameter that requires Timestamp type, it throws expects a value of type Undef or Timestamp, got String
Expected Behavior
The string should be accepted, then parsed into Timestamp.
(Please note I tried a few different string format, but it always ends up with the same error)
Puppet run output:
Error: Failed to apply catalog: Parameter dsc_starttime failed on Dsc_scheduledtask[my_task]: dsc_scheduledtask.dsc_starttime expects a value of type Undef or Timestamp, got String
Environment
Version puppet 7.23
Platform Windows 2022
Additional Context
So I spent some time trying to debug the issue.
I looked at dsc_base_provider.rb source code and the code added with this PR : #57 is working fine as far as I can tell.
The type comparison seems to be done elsewhere, but I can't find it.
I also tried to force timestamp time with Timestamp.new() but received the error
Error: Failed to apply catalog: Parameter dsc_starttime failed on Dsc_scheduledtask[my_task]: dsc_scheduledtask.dsc_starttime expects a value of type Undef or Timestamp, got Type[Timestamp]
The dsc_starttime parameter is defined as this in the module:
dsc_starttime: {
type: 'Optional[Timestamp]',
desc: 'The time of day this task should start at - defaults to 12:00 AM. Not valid for AtLogon and AtStartup tasks.',
mandatory_for_get: false,
mandatory_for_set: false,
mof_type: 'DateTime',
mof_is_embedded: false,
},
I tried to modify with Optional[String] and Variant[Timestamp, String, Undef] but this raised other issues and seems to be a wrong hack.
So far I do not have much more idea on what to do
The text was updated successfully, but these errors were encountered:
Describe the Bug
When providing a timestamp formatted string to a parameter that requires Timestamp type, it throws
expects a value of type Undef or Timestamp, got String
Expected Behavior
The string should be accepted, then parsed into Timestamp.
Steps to Reproduce
Using the module computermanagementdsc : https://forge.puppet.com/modules/dsc/computermanagementdsc/readme
Using the resource
dsc_scheduledtask
(Please note I tried a few different string format, but it always ends up with the same error)
Puppet run output:
Environment
Additional Context
So I spent some time trying to debug the issue.
I looked at dsc_base_provider.rb source code and the code added with this PR : #57 is working fine as far as I can tell.
The type comparison seems to be done elsewhere, but I can't find it.
I also tried to force timestamp time with
Timestamp.new()
but received the errorThe dsc_starttime parameter is defined as this in the module:
I tried to modify with
Optional[String]
andVariant[Timestamp, String, Undef]
but this raised other issues and seems to be a wrong hack.So far I do not have much more idea on what to do
The text was updated successfully, but these errors were encountered: