canonical / mysql-k8s-operator

A Charmed Operator for running MySQL on Kubernetes
https://charmhub.io/mysql-k8s
Apache License 2.0
8 stars 16 forks source link

[DPE-5481] Ensure that uninitialized variable not referenced in _is_cluster_blocked helper #507

Closed shayancanonical closed 2 months ago

shayancanonical commented 2 months ago

Issue

In a debug statement, we are possibly referencing the member_state variable which may not be initialized if a MySQLNoMemberStateError exception is raised

Solution

Ensure that the member_state and member_state_exists variables (both logged) are always initialized if the code execution gets to the logger statement