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

sys.interfaces docs should not indicate an inability to iterate over foreign lists

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: 3.10.6, 3.14.0, 3.12.2
    • Fix Version/s: 3.10.7, 3.12.3, 3.15.0
    • Component/s: None
    • Labels:
      None

      Description

      sys.interfaces docs should not indicate an inability to iterate over foreign lists

      Currently the example shown says

      To use this list in a policy, you will need a local copy since only local variables can be iterated.

          bundle agent test
          {
          vars:
      
           # To iterate, we need a local copy
      
           "i1" slist => { @(sys.ip_addresses)} ;
           "i2" slist => { @(sys.interfaces)} ;
      
          reports:
      
              "Addresses: $(i1)";
              "Interfaces: $(i2)";
              "Addresses of the interfaces: $(sys.ipv4[$(i2)])";
          }
      

      But this is not true now, it is possible to iterate over foreign lists.

        Attachments

          Activity

            People

            • Assignee:
              a10042 Nick Anderson
              Reporter:
              a10042 Nick Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel