You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the end of the day what is considered to have the exporter installed?
In my understanding reading the code is:
exist a file at /etc/systemd/system/hardware-exporter/.service and /etc/hardware-exporter-config.yaml
This is very easy to check and not CPU intensive by using Path.exists and I don't see the need at all of using self._stored and by consequence those type ignore.
The juju sdk documentation has an interesting section of uses and limitations with StoredState and the problematic solution looks like a lot with what I'm seeing in this project.
I've spotted another possible issue into the install function:
logger.error("Failed to install %s.", EXPORTER_NAME)
returnsuccess
systemd.daemon_reload()
logger.info("%s installed.", EXPORTER_NAME)
returnsuccess
See that if line 137 fails, it will overwrite the result on line 143 meaning that if for some reason the redfish config file fails, but for the service doesn't, you won't notice.
To say the truth I' would refactor those functions of install and uninstall to return nothing and let to bubble in the charm code here
As part of this PR to add smartctl exporter support for the charm, we are removing the usage of Stored State to check whether an exporter is installed.
In the same PR, we're also using separate variables (render_config_success, render_service_success) and so we won't face this issue in the exporter install function. Refer here.
In my understanding reading the code is:
/etc/systemd/system/hardware-exporter/.service
and/etc/hardware-exporter-config.yaml
This is very easy to check and not CPU intensive by using Path.exists and I don't see the need at all of using
self._stored
and by consequence those type ignore.The juju sdk documentation has an interesting section of uses and limitations with StoredState and the problematic solution looks like a lot with what I'm seeing in this project.
I've spotted another possible issue into the install function:
hardware-observer-operator/src/service.py
Lines 132 to 149 in 86f0d7e
See that if line 137 fails, it will overwrite the result on line 143 meaning that if for some reason the redfish config file fails, but for the service doesn't, you won't notice.
To say the truth I' would refactor those functions of
install
anduninstall
to return nothing and let to bubble in the charm code hereOriginally posted by @gabrielcocenza in #192 (comment)
The text was updated successfully, but these errors were encountered: