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

packageupdatesmatching() and packagesmatching() should be able to leverege information from new package promise implementation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.9.0, 3.7.4
    • Component/s: None
    • Labels:
      None
    • Story Points:
      8

      Description

      I have observed on a fresh install of 3.7.2 that the packageupdatesmatching() function does not correctly report updates unless a legacy packages promise implementation is used.

      To reproduce bring up a fresh instance that is not fully updated. And without adding any packages promises try use packageupdatesmatching.

      <pre>
      vars:
      "updates_available" data => packageupdatesmatching(".", ".", ".", ".");
      "amount_updates" int => length("updates_available");
      "updates_available_str" string => storejson(updates_available);

      reports:
      "$(updates_available_str)";
      "$(amount_updates) packages can be updated";
      </pre>

      Now, after adding a legacy package promise you should be able to get the package inventory.

      <pre>
      packages:
      "mosh"
      package_policy => "add";
      </pre>

      I think that packageupdatesmatching() should look for inventory from the new inventory implementation and use that if it exists first, if it does not exist then it should fall back to looking at the legacy inventory.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              a10053 Marcin Pasinski
              Reporter:
              a10042 Nick Anderson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 1 day
                  1d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified