Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative filter #13

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Commits on Jul 27, 2020

  1. Optimizations and comments added to aci_listify filter.

    Comments/explanations added to the code.
    Optimizations:
    * Use closure for listify function to encapsulate internal vars.
    * Eliminated some intermediate vars.
    * Replaced last loop by direct key lookup.
    velotiger committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    9f0d02a View commit details
    Browse the repository at this point in the history
  2. In filter, omit obsolete check for dict before recursive call.

    MOD: plugins/filter/aci.py
    velotiger committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    0e8e300 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2020

  1. Configuration menu
    Copy the full SHA
    5c56aa6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f1dff0e View commit details
    Browse the repository at this point in the history
  3. Alternative filter aci_listify2 added.

    The original filter needs alternating dicts/lists in the inventory. This
    alternative filter accepts lists and dicts in any order. The result for an
    inventory with alternating dicts/lists is unchanged.
    
    NEW: plugins/filter/aci2.py
    velotiger committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    ad32ff5 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2020

  1. Fix typo in © notice (mail address)

    MOD: plugins/filter/aci2.py
    velotiger committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    b8aecc0 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2020

  1. Bugfix: Evaluate flat key/value-Pairs before dicts and lists

    This fixes a bug in commit ad32ff5:
    Attributes in intermediate items (neither top-level nor bottom) do not
    appear in output. E.g. if you look for keywords «tenant», «vrf», «bd»,
    «subnet» some attributes for «vrf» might be missing because they were
    evaluated after the cache had been transferred to the result list.
    To avoid this, all flat key/value pairs are evaluated before any dict
    or list at the same level.
    
    MOD: plugins/filter/aci2.py
    velotiger committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    b56e385 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2020

  1. Add feature: regex filter for name attribute

    * You can append a regex to each key (separated by an =–sign).
    * Only keys whose name-attribute matches the regex will be included
      in the result.
    * If the regex is omitted, all keys will be included (same
      behavior as before – backwards compatible).
    * Example:
        "{{ aci_topology|aci_listify2('access_policy',
          'interface_policy_profile=.+998',
          'interface_selector') }}"
      All paths in the output match interface policy profiles that
      end in «998».
      E.g. interface selectors below a non-matching interface policy
      profile will be suppressed from the output.
    
    MOD: plugins/filter/aci2.py
    velotiger committed Oct 6, 2020
    Configuration menu
    Copy the full SHA
    fddcc0e View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2020

  1. Add comments to plugins/filter/aci2.py

    MOD: plugins/filter/aci2.py
    velotiger committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    e355fd4 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2020

  1. Use a variable to specify the attribute in regex match

    Do not hard-code the attribute used for regex matching of
    keys. The variable «NameAttr» specifies the name of this
    attribute.
    
    MOD: plugins/filter/aci2.py
    velotiger committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    031995f View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2020

  1. Convert name-attribute's value to str before regex match

    Fixes this issue: Program ended with error if name-attribut's value
    was not a string (used pattern matching on a non-string object).
    
    MOD: plugins/filter/aci2.py
    velotiger committed Oct 15, 2020
    Configuration menu
    Copy the full SHA
    be9ffa6 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2021

  1. Update description and documentation

    * Short description of alternative filter.
    * One more example how to use the alternative filter (dynamically
      specify match pattern for keys at runtime).
    
    MOD: README.md
    MOD: plugins/filter/aci2.py
    velotiger committed Apr 9, 2021
    Configuration menu
    Copy the full SHA
    f560ced View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2021

  1. Reformat code of Ansible filter aci2.py

    No functional changes or fixes.
    
    Add more patterns to .gitignore
    
    MOD: .gitignore
    MOD: plugins/filter/aci2.py
    velotiger committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    57e330e View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2021

  1. Improvement for filter module «aci2.py»

    * Get rid of extra loop that deletes flat key/value pairs
      after copying them to the cache.
    
    MOD: plugins/filter/aci2.py
    velotiger committed Oct 17, 2021
    Configuration menu
    Copy the full SHA
    113a7c8 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2021

  1. Lists or dicts for object instances

    Instances of objects can be organized in lists (as before)
    or dicts (new).
    * This is useful if you need direct lookups by key.
    * This is partly incompatible to previous versions!
      Nested dicts and lists in any order down the object
      tree are not supported any more. This feature was not
      not useful and therefore has been dropped.
    
    MOD: README.md
    MOD: plugins/filter/aci2.py
    velotiger committed Oct 24, 2021
    Configuration menu
    Copy the full SHA
    d941f3a View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2021

  1. Ignore MS Visual Studio Code directory

    MOD: .gitignore
    velotiger committed Nov 1, 2021
    Configuration menu
    Copy the full SHA
    a7b9a4c View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2022

  1. Small optimization for filter module «aci2.py»

    * Use a closure to set fixed values once for all
      (avoid setting them in every new call of the filter).
    velotiger committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    1a361b5 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2022

  1. Do not modify object tree in filter module «aci2.py»

    Previously scalar attributes have been deleted after evaluation.
    This simplified further processing of lists and dicts.
    However, if the object tree uses anchors and aliases, deleting
    attributes invalidates the aliases.
    velotiger committed Mar 20, 2022
    Configuration menu
    Copy the full SHA
    09a5d1f View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2022

  1. Fix mutable default values in function args

    + minor code formatting.
    velotiger committed Dec 3, 2022
    Configuration menu
    Copy the full SHA
    5a66f82 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2023

  1. Configuration menu
    Copy the full SHA
    eed6b9a View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2023

  1. List of scalars as attr value in old listify filter

    * This is a backport of
      commit eed6b9a
      to the old listify filter (aci.py).
    * Add an example for a subnet to the example inventory.
    
    Ref: CiscoDevNet/ansible-aci#517 (comment)
    velotiger committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    d07999d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2298797 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2023

  1. Explicit check for scalar types as attrs in listify filters

    Accetable attribute values: Replace negated check for list or
    dict by explicit check for scalar types.
    velotiger committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    28335fc View commit details
    Browse the repository at this point in the history