]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
node-proxy: explicitly set NodeProxy's attributes
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 19 Dec 2023 09:14:31 +0000 (09:14 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 16:01:04 +0000 (16:01 +0000)
commita029439a8a56fe88d109c82962ac605a361ef99a
treeb28d7a71a90718858fb5d5632df89a8a9c5918fc
parentf5bd1839365a3cb9466d8745b150f2eeaa1f4b42
node-proxy: explicitly set NodeProxy's attributes

The current logic using `setattr()` makes mypy complain:

"NodeProxy" has no attribute "xxx"

Using `self.__dict['xxx']` addresses this mypy error but the
downside of this is that the code isn't clear and less readable.

Explicitly setting the different attributes makes the code clearer
and more readable.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit e71bf838428c297075df5515c342c0db0a9e31e3)
src/cephadm/cephadmlib/node_proxy/baseredfishsystem.py
src/cephadm/cephadmlib/node_proxy/main.py
src/cephadm/cephadmlib/node_proxy/redfish_client.py
src/cephadm/cephadmlib/node_proxy/reporter.py
src/cephadm/cephadmlib/node_proxy/util.py