[Mariadb] Initialize variable
There are scenarios where the wsrep_rec_pos variable is being returned without it being first initialized when the .communicate() method returns a blank. This patchset sets up a default initialization, so the readiness check does not error out with an exception. Change-Id: Ifea922f446bf3cbc9220f39a41dffc2763e6a5f3 Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
parent
af9ac277e8
commit
df4cc7827d
@ -549,11 +549,14 @@ def update_grastate_on_restart():
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
out, err = wsrep_recover.communicate()
|
||||
wsrep_rec_pos = '-1'
|
||||
for item in err.split("\n"):
|
||||
logger.info("Recovering wsrep position: {0}".format(item))
|
||||
if "WSREP: Recovered position:" in item:
|
||||
line = item.strip().split()
|
||||
wsrep_rec_pos = line[-1].split(':')[-1]
|
||||
if wsrep_rec_pos == '-1':
|
||||
logger.info("Setting wsrep position to -1.")
|
||||
return wsrep_rec_pos
|
||||
|
||||
set_grastate_val(key='seqno', value=recover_wsrep_position())
|
||||
|
Loading…
Reference in New Issue
Block a user