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

dsc_lite : 'isrequired' validation does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dsc_lite
    • Labels:
    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      Hide
      • New spec tests that demonstrate required fields
      • PE console delivers the error Failed to apply catalog: Validation of Dsc[sample_file2] failed: dsc: resource_name is required when the dsc resource_name instead of other errors
      Show
      New spec tests that demonstrate required fields PE console delivers the error Failed to apply catalog: Validation of Dsc [sample_file2] failed: dsc: resource_name is required when the dsc resource_name instead of other errors
    • Epic Link:
    • Team:
      Windows
    • Story Points:
      1
    • Sprint:
      Windows 2018-07-25
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      There are 3 parameters that are required for the dsc_lite module - module, resource_name and properties.

       

      In their implementations they each currently call isrequired - https://github.com/puppetlabs/puppetlabs-dsc_lite/blob/75e0fce3d1194706ef4dab295af617e84bb58fcc/lib/puppet/type/dsc.rb#L43-L85

       

      However, isrequired doesn't work ( see https://projects.puppetlabs.com/issues/4049 / https://tickets.puppetlabs.com/browse/PUP-1591 ), so this validation is never called. Instead a new top-level validator should be added like:

      validate do
        raise ArgumentError, 'dsc: module is required' unless self[:module]
        raise ArgumentError, 'dsc: resource_name is required' unless self[:resource_name]
        raise ArgumentError, 'dsc: properties is required' unless self[:properties]
      end 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.lombardi Michael Lombardi
              Reporter:
              ethan Ethan Brown
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support