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

Packages-type promise verify method fails if is run from nested bundle

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Rejected
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Promise type: packages
    • Labels:
      None
    • Platform:
      Debian, Ubuntu, Linux
    • Steps to reproduce:
      Manual steps provided

      Description

      The beginning of the discussion may be found here: https://groups.google.com/forum/#!topic/help-cfengine/hZSTkfC7j0M

      The complete steps to reproduce:

      outer.cf:
      <pre>
      body common control
      {
      inputs =>

      { "$(sys.local_libdir)/stdlib.cf", "inner.cf" }

      ;
      bundlesequence =>

      { "outer" }

      ;
      }
      bundle agent outer
      {
      methods:
      "inner" usebundle => inner;
      #packages:

      1. "postgresql"
      2. package_policy => "verify",
      3. package_method => apt_get_permissive;
        reports:
        "outer";
        }
        </pre>

      inner.cf:
      <pre>
      bundle agent inner
      {
      packages:
      "postgresql"
      package_policy => "verify",
      package_method => apt_get_permissive;
      }
      </pre>

      Running with verify check uncommented in `outer:
      <pre>
      $ cf-agent -KIf ./outer.cf
      2014-12-16T09:05:04+1300 info: /default/outer/packages/'postgresql'[0]: Package 'postgresql' cannot be verified – no match
      R: outer
      </pre>

      Running with nested verify check:
      <pre>
      cf-agent -KIf ./outer.cf
      2014-12-16T09:05:44+1300 info: /default/outer/methods/'inner'/default/inner/packages/'postgresql'[0]: Package 'postgresql' cannot be verified – no match
      2014-12-16T09:05:44+1300 error: /default/outer/methods/'inner'[0]: Method 'inner' failed in some repairs
      R: outer
      </pre>

      apt-get is fine:
      <pre>
      apt-cache policy postgresql
      postgresql:
      Installed: (none)
      Candidate: 9.1+129ubuntu1
      Version table:
      9.1+129ubuntu1 0
      500 http://nz.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
      9.1+129 0
      500 http://nz.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
      </pre>

      I expect in both cases behaviour like in the first run: only info type message should be logged, not error. Currently behaviour is inconsistent (it relies on where a promise is defined) and it prevents from checking if a package is installed or not.

      It works perfectly fine in 3.5.3 though.

        Attachments

          Activity

            People

            • Assignee:
              a10053 Marcin Pasinski
              Reporter:
              zerkms Ivan Kurnosov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel