HomeClusterLabs Projects

Refactor: python: Simplify pattern class instantiation.

Description

Refactor: python: Simplify pattern class instantiation.

  • Add an all to patterns.py to control what gets exported. Turns out it's really only one class we care about.
  • Inheriting from object is no longer necessary.
  • Rename patternvariants to patternVariants and statically declare its contents instead of constructing them at runtime. We really only support a single variant, so the extra complication is not necessary.
  • Rename crm_corosync to Corosync2Patterns and have PatternSelector directly instantiate it instead of instantiating BasePatterns and then through some weird side-effect action call it to set up all the subclass stuff.
  • Stop passing the variant name into all the Corosync2Pattern methods. We already know the name - it's part of the object from when we instantiated it. This then allows getting rid of the get_variant method.
  • Fix up all the users to no longer pass the variant name, either.

Details

Provenance
clumensAuthored on Feb 9 2023, 2:45 PM
Parents
rP6ca19adda417: Refactor: python: Stylistic changes to patterns.py.
Branches
Unknown
Tags
Unknown