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

var gets evaluated even if bundle is not used

    XMLWordPrintable

    Details

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

      Description

      ISSUE: a var gets evaluated even if its bundle is not used

      ENVIRONMENT:
      Some of my machines are osx, some are linux.

      To determine which promise get executed, I use methods+usebundle:
      in promises.cf :

      • bundlesequence => "ftiff:root"
      • inputs => all of my files (~ ftiff/*.cf)

      in ftiff-root.cf :

      • bundle agent root -> methods -> linux -> "backup" usebundle => "ftiff:backup";

      in ftiff-backup.cf:

      • bundle agent backup -> methods -> "get_hcp_module" usebundle => ftiff:get_hcp_module;
      • bundle agent get_hcp_module -> vars -> "lsmod" string => execresult("/bin/lsmod", "noshell");
      • bundle agent get_hcp_module -> classes -> "hcp_module_loaded" expression => regcmp(".hcpdriver.", "$(lsmod)");

      ACTUAL RESULTS:
      When executing this on darwin, I get this error :
      2013-08-20T11:57:42+0200 error: Proposed executable file '/bin/lsmod' doesn't exist
      2013-08-20T11:57:42+0200 error: execresult '/bin/lsmod' is assumed to be executable but isn't

      /bin/lsmod doesn't exist on darwin/osx, so it is normal. However I didn't use the bundle in ftiff-root.

      If I put "linux::" after "bundle agent get_hcp_module -> vars, resulting in bundle agent get_hcp_module -> vars -> linux -> "lsmod" string => execresult("/bin/lsmod", "noshell");
      It works and I don't get an error.

      EXPECTED RESULTS:
      Var should not be evaluated, so no error should exist.

      HOW TO REPLICATE:

      • cf-promises -f ./test-working.cf
        <pre>
        acme:~ adminesl$ cf-promises -f ./test-working.cf
        acme:~ adminesl$
        </pre>
      • cf-promises -f ./test-notworking.cf
        <pre>
        acme:~ adminesl$ cf-promises -f ./test-notworking.cf
        2013-08-20T13:36:43+0200 error: Proposed executable file '/bin/donotexist' doesn't exist
        2013-08-20T13:36:43+0200 error: execresult '/bin/donotexist' is assumed to be executable but isn't
        [snip]
        2013-08-20T13:36:43+0200 error: execresult '/bin/donotexist' is assumed to be executable but isn't
        acme:~ adminesl$
        </pre>

      RELEVANT FILES:
      ftiff-backup.cf: https://gist.github.com/anonymous/cec38bbc0dae1cbfce43
      ftiff-root.cf: https://gist.github.com/anonymous/acd7a5fc0b725553aa7b
      promises.cf: https://gist.github.com/anonymous/bcb74d0c4aa8b6ea81b9

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10025 Volker Hilsheimer (Inactive)
                Reporter:
                francois@esl-education.org Francois TIFFREAU
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel