Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9482

add index function to return index/key in array/hash/string and other iterables

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.3.0
    • Component/s: None
    • Template:
    • Sub-team:
    • Team:
      Server
    • Release Notes:
      New Feature
    • Release Notes Summary:
      An `index()` function has been added to puppet that can return the index/key in an Array, Hash, String or other iterable value that is either equal to a given value or for which a given lambda returns a truthy value. Earlier this was difficult to do.
    • QA Risk Assessment:
      Needs Assessment

      Description

      add an array_index function which returns the index of a specified element in an array,

      see the solution in: https://ask.puppet.com/question/4763/how-to-get-an-array-index-in-manifest/

      e.g.

      $array = ['a', 'b', 'c']
      array_index($array, 'b') # returns 1
      

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                x2a 0x2A
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support