Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5807

ClassInformationService.classes_per_environment call for non-existent file does not return errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.4.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2016-02-10
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      Not needed part of NC feature / speed improvements.

      Description

      If I pass a path to a manifest file that does not exist to the list of files to be parsed in a call to Puppet::InfoService::ClassInformationService.new.classes_per_environment, the return value just returns an empty array, as opposed to a hash with an :error key/value pair in it.

      For example, running the following code...

      require 'puppet'
      require 'puppet/info_service'
       
      files_to_parse = { "production" => [ "./parse.pp" ] }
       
      puts Puppet::InfoService::ClassInformationService.new.classes_per_environment(files_to_parse)
      

      ... where "./parse.pp" does not exist produces the following output:

      {"production"=>{"./parse.pp"=>[]}}
      

      If instead I have a file that exists at "./parse.pp" which has bad content in it...

      bogus manifest
      

      ... an :error is returned in a hash associated with the file name:

      {"production"=>{"./parse.pp"=>{:error=>"This Name has no effect. A value was produced and then forgotten (one or more preceding expressions may have the wrong form) at ./parse.pp:1:1"}}}
      

      It seems like both cases should result in an :error key being returned.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jeremy.barlow Jeremy Barlow
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support