Skip to content

Commit

Permalink
Merge pull request #283 from puppetlabs/revert_forced_ensurable_prop
Browse files Browse the repository at this point in the history
(REVERT) - Revert forcing of ensurable property on resources
  • Loading branch information
gavindidrichsen authored Feb 9, 2024
2 parents 8f39e7d + d0b6ce2 commit 655d088
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 72 deletions.
50 changes: 0 additions & 50 deletions docs/architecture/decisions/0001-force-ensurable.md

This file was deleted.

18 changes: 0 additions & 18 deletions src/Puppet.Dsc/internal/functions/Get-TypeContent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,6 @@ function Get-TypeContent {
} Else {
$FriendlyName = $Resource.FriendlyName
}
# We add an ensurable property to all DSC resources that don't have an ensure property
$ResourceIsEnsurable = ($Resource.ParameterInfo | Select-Object -ExpandProperty Name).Contains('ensure')
$NotEnsurable = [pscustomobject]@{
Name = 'ensurable'
DefaultValue = 'false'
Type = 'Boolean[false]'
Help = 'Default attribute added to all dsc types without an ensure property. This resource is not ensurable.'
mandatory_for_get = 'false'
mandatory_for_set = 'false'
is_parameter = 'false'
is_namevar = 'false'
mof_is_embedded = 'false'
mof_type = 'String'
}
# We only add the ensurable property if it's not already present
If (!$ResourceIsEnsurable) {
$Resource.ParameterInfo += $NotEnsurable
}
# It is not *currently* possible to reliably programmatically retrieve
# the description information for a DSC Resource via CIM instances or
# Get-DscResource or Get-Help.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ Function Get-TypeParameterContent {

ForEach ($Parameter in $ParameterInfo) {
if (![string]::IsNullOrEmpty($Parameter.name)) {
if ($Parameter.name -ne 'ensurable') {
$Parameter.name = "dsc_$($Parameter.name)"
}
New-Object -TypeName System.String @"
$($Parameter.name): {
dsc_$($Parameter.name): {
type: $(ConvertTo-PuppetRubyString -String ($Parameter.Type -split "`n" -join "`n ")),
$(
If ([string]::IsNullOrEmpty($Parameter.Help)) {
Expand Down

0 comments on commit 655d088

Please sign in to comment.