Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7179

dsc_lite: Change the dsc change_to_s message from "created" to "invoked" since invoking DSC resources may either create, modify or destroy actual resources

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dsc_lite
    • Labels:
    • Template:
    • Acceptance Criteria:
      Hide
      • A message like Notice: /Stage[main]/Main/Dsc[FooFile]/ensure: created becomes Notice: /Stage[main]/Main/Dsc[FooFile]/ensure: invoked
      • Verify that no message is emitted when DSC performs no action
      Show
      A message like Notice: /Stage [main] /Main/Dsc [FooFile] /ensure: created becomes Notice: /Stage [main] /Main/Dsc [FooFile] /ensure: invoked Verify that no message is emitted when DSC performs no action
    • Epic Link:
    • Team:
      Windows
    • Story Points:
      1
    • Sprint:
      Windows 2018-07-05, Windows 2018-07-11
    • QA Risk Assessment:
      Needs Assessment

      Description

      During MODULES-5970 it was found that the messages created when dsc_lite resources inaccurately report "created" when resources are created/removed/updated

      Current behaviour:

      Given a manifest of;

      dsc {'FooFile':
        dsc_resource_name        => 'File',
        dsc_resource_module      => 'PSDesiredStateConfiguration',
        dsc_resource_properties  => {
          ensure          => 'present',
          destinationpath => 'C:\\temp\\dscfile.txt',
          contents        => 'TestFile',
        }
      }
       
      dsc {'FooFile2':
        dsc_resource_name        => 'File',
        dsc_resource_module      => 'PSDesiredStateConfiguration',
        dsc_resource_properties  => {
          ensure          => 'present',
          destinationpath => 'C:\\temp\\dscfile2.txt',
          contents        => 'TestFile',
        }
      }
      

      And the files C:\Temp\dscfile.txt and C:\Temp\dscfile2.txt already exist but with empty content

      Puppet outputs;

      ...
      Notice: Compiled catalog for glenn.sarti-c7s9ph2 in environment workstation_production in 9.23 seconds
      Notice: /Stage[main]/Main/Dsc[FooFile]/ensure: created
      Notice: /Stage[main]/Main/Dsc[FooFile2]/ensure: created
      Notice: Applied catalog in 6.42 seconds
      

       

      The "created" message is misleading / inaccurate in this case and should better reflect that we invoked a DSC resource, but don't know what it did. Doing this should require implementing the change_to_s method for the ensure property. See the https://github.com/puppetlabs/puppet/blob/5aef613f148ff19435cb48ab76c6b9b72b2d9143/lib/puppet/property/ensure.rb#L50-L64 definition.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              erick Erick Banks
              Reporter:
              glenn.sarti Glenn Sarti
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support

                    Time Tracking

                    Estimated:
                    Original Estimate - 1 minute
                    1m
                    Remaining:
                    Remaining Estimate - 1 minute
                    1m
                    Logged:
                    Time Spent - Not Specified
                    Not Specified