HomeClusterLabs Projects

Refactor: python, cts: Support membership protocol in Environment.

Description

Refactor: python, cts: Support membership protocol in Environment.

Basically, just rename has_key to contains. We can then use "xyz in
self._env" everywhere instead of making a list out of the keys and then
checking in that.

Also, simplify a block at the end of getitem. We can use get() to
return a default value of None if the key is not present instead of
writing this exact same behavior by hand.

Details

Provenance
clumensAuthored on May 24 2023, 3:16 PM
Parents
rPe5171366b471: Merge pull request #3106 from clumens/cts-tests-initial
Branches
Unknown
Tags
Unknown