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

filesexist expression evaluates to true on empty slist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.10.1, 3.10.2, 3.10.3
    • Fix Version/s: 3.12.0, 3.10.4
    • Component/s: Built-in functions
    • Labels:
    • Environment:
      Linux SLES 11
    • Platform:
      Linux

      Description

      test.cf:

      body common control
      {{{}}
        bundlesequence => { "example" };
      }
      bundle agent example
      {{{}}
       vars:
          "mylist" slist => {} ;
       classes:
          "exists" expression => filesexist("@{mylist}");
       reports:
        exists::
          "Case exist!";
        !exists::
          "Case does not exist!";
      }

      Expected outcome:

      Case does not exist

      Produced outcome:

      Case exists!

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10042 Nick Anderson
                Reporter:
                Mattyasovszky Janos
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel