Don't overwrite drive down reason
Summary
Currently we are facing a situation in production where the reason why cta-taped
put the drive down gets overwritten when the daemon is restarted (Puppet restarts it automatically).
What is the current bug behaviour?
Reason is overwritten
What is the expected correct behaviour?
Reason should not be overwritten
Cause
The problem comes from this part of the code run on the startup of the DriveHandler:
if (!currentDesiredDriveState.reason) {
driveState.setReasonFromLogMsg(logLevel, msg);
} else if (currentDesiredDriveState.reason.value().substr(0, 11) == "[cta-taped]") {
driveState.setReasonFromLogMsg(logLevel, msg);
} else {
driveState.reason = currentDesiredDriveState.reason.value();
}
If the message starts with [cta-taped]
the message is overwritten with the default message.
Edited by Pablo Oliver Cortes