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

new packages promise: empty list gets still processed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Unconfirmed
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I try to install some debfiles (without repository) with your new packages promise type. If I get an empty list in the promiser, it still tries to process to list with an cf_null value.

      Example below. For a server not within fileservers or mailservers you would get an error message like:

      ********************************

      dpkg-deb: error: failed to read archive `/path/to/debfiles/$(cf_null)': No such file or directory
      error: Error installing package '/path/to/debfiles/$(cf_null)'

      ********************************

      A workaround is to add an ifvarclass with fileexists to the packages promise.

      ********************************

      vars:

      fileservers::
      "pkg[somepkg]" string => "somepkg_0815-1_amd64.deb";

      mailservers::
      "pkg[anotherpkg]" string => "anotherpkg_42.0.0_amd64.deb";

      any::
      "somepath" string => "/path/to/debfiles";
      "pkg_names" slist => getindices("pkg");

      packages:

      "$(somepath)/$(pkg[$(pkg_names)])"
      policy => "present";

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              antubis Martin Karch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: