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

$(this.promiser) doesn't expand properly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.1
    • Component/s: Evaluation
    • Labels:
      None

      Description

      Regarding the reference manual, it said "Current promise types that define $(this.promiser) are: files, processes, commands." so I tried to create promises to use that variable. It turned out that it didn't work as expected.

      Here is my test policy.
      <pre>
      body common control
      {
      bundlesequence =>

      { "test" }

      ;
      inputs =>

      { "/var/cfengine/inputs/libraries/cfengine_stdlib.cf" }

      ;
      host_licenses_paid => "25";
      }

      bundle agent test
      {
      files:
      any::
      "/var/cfengine/masterfiles/promises.cf"
      copy_from => local_cp("/tmp$(this.promiser)");

      processes:
      any::
      "cf-monitord" restart_class => canonify("restart_$(this.promiser)");

      commands:
      any::
      "/bin/echo"
      args => "Nakarin $(this.promiser)";

      "/bin/echo"
      args => "--> Restart a service", ifvarclass => "restart_cf_monitord";
      }
      </pre>

      <pre>

      1. /var/cfengine/bin/cf-promises -V

      @@@
      @@@ cf-promises

      @ @@@ @ CFEngine Core 3.4.0b3.4b24c8aac3612ae4ecf0dc2b2b540d3f3bccbeae
      @ @@@ @ CFEngine Nova 3.0.0a1.366236c3e429c549d3e3245621ff7299b1558f8d
      @ @@@ @
      @ @
      @@@
      @ @
      @ @
      @ @

      Copyright (C) CFEngine AS 2008-2012
      See Licensing at http://cfengine.com/3rdpartylicenses
      </pre>

      Out put on screen.
      <pre>

      1. /var/cfengine/bin/cf-agent -f /tmp/xxx.cf -IK
        !! No commercial license file found - falling back on internal expiry
        Can't stat /tmp$(this.promiser) in files.copyfrom promise
        -> Executing '/bin/echo Nakarin $(this.promiser)' ... (no timeout)
        Q: ".../bin/echo Nakar": Nakarin $(this.promiser)
        I: Last 1 quoted lines were generated by promiser "/bin/echo Nakarin $(this.promiser)"
        -> Completed execution of /bin/echo Nakarin $(this.promiser)
        </pre>

      Nothing worked for me.

        Attachments

          Release management

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: