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

package module API: cf-agent uses default_options instead of options

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: 3.15.2
    • Fix Version/s: None
    • Component/s: cf-agent
    • Labels:
      None

      Description

      I've modified the FreeBSD 'pkg' package module for allowing installing
      packages inside jails using the options attribute, but the integration
      with cfengine doesn't work because the promise-provided options aren't
      always passed to the package module.

      This is the script of the actions performed by cfengine while trying to
      install a fictional test-pkg package:

      CMD: supports-api-version

      CMD: get-package-data
      INPUT: options=package options (promise)
      INPUT: File=test-pkg

      CMD: list-installed
      INPUT: options=default options (body package_module)

      CMD: list-updates
      INPUT: options=default options (body package_module)

      CMD: repo-install
      INPUT: options=package options (promise)
      INPUT: Name=test-pkg

      CMD: list-installed
      INPUT: options=package options (promise)

      CMD: list-updates-local
      INPUT: options=package options (promise)

       

      During the first invocation of list-installed/list-updates, the options
      passed are the default ones from the package module body, not the ones
      provided within the promise.

      From https://docs.cfengine.com/docs/3.15/reference-package_modules.html :

      All the API commands listed below, except supports-api-version, support the options attribute. This attribute will contain the contents from the options attribute in the promise, or the default_options in the package module body, if the former is unspecified.

      If I've read it correctly, it should always use the options attribute if provided, not hte default_options.

      Also, if I have understood it correctly, this should be the cause also for CFE-2959 :

      The reason for this is simple: CFEngine caches its list of available software updates as part of system discovery. This system discovery does not use the "enablerepo" option.

        Attachments

        1. test.cf
          0.3 kB
        2. package_module_test
          0.3 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gpiero Gian Piero Carrubba
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel