HomeClusterLabs Projects

Refactor: cts: Drop Corosync2.__init__()
9bcf667ffc93Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Refactor: cts: Drop Corosync2.init()

We can get rid of self._components by building it each time in the
components() method.

  1. We don't need a dict because we never access the values by key. We only need the list of Process instances.
  2. Technically something could modify the Corosync2 instance's components list if we return the list itself. Ideally it would be treated as constant after creation.
  3. If components() returns a copy, then by default it's a shallow copy, and we run into the same issue with the Process instances within the list.
  4. We could turn the Process members into properties, but that feels like overkill. Since performance isn't an concern here, we can just build and return the list each time in the Corosync2.components() method.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Wed, Aug 20, 5:21 PM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.