Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-846

lsdir() broken when there is no directory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.3
    • Component/s: Evaluation
    • Labels:
      None
    • Found in version (details):
      3.5.1

      Description

      It should be OK to return (null)/(empty) list when directory doesn't exist, shouldn't it? A fatal cfengine error prevents CFEngine to continue the policy.

      <pre>
      bundle agent test {
      vars:
      "test" slist => lsdir("/tmp/this_directory_does_not_exist", ".*\.list\.tmplt", "false");
      }

      I get this error message:
      2013-08-09T11:29:33+0200 error: Directory '/tmp/this_directory_does_not_exist' could not be accessed in lsdir(), (opendir: No such file or directory)
      2013-08-09T11:29:33+0200 error: Directory '/tmp/this_directory_does_not_exist' could not be accessed in lsdir(), (opendir: No such file or directory)
      2013-08-09T11:29:33+0200 error: Directory '/tmp/this_directory_does_not_exist' could not be accessed in lsdir(), (opendir: No such file or directory)
      2013-08-09T11:29:33+0200 error: Directory '/tmp/this_directory_does_not_exist' could not be accessed in lsdir(), (opendir: No such file or directory)
      2013-08-09T11:29:33+0200 error: /tmp/test.cf:7:0: error: In attribute 'slist', Attempted to give a scalar to a non-scalar type
      2013-08-09T11:29:33+0200 error: Fatal CFEngine error: Cannot continue
      </pre>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10025 Volker Hilsheimer (Inactive)
                Reporter:
                a10005 Nakarin Phooripoom (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel