From e2ae58b62cba22d94666274570f78547bdaa6369 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 4 Aug 2019 17:00:33 -0400 Subject: [PATCH] Add the missing newline to the string compare --- node-daemon/pvcd/NodeInstance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-daemon/pvcd/NodeInstance.py b/node-daemon/pvcd/NodeInstance.py index 73b2520a..6885ab97 100644 --- a/node-daemon/pvcd/NodeInstance.py +++ b/node-daemon/pvcd/NodeInstance.py @@ -306,9 +306,9 @@ class NodeInstance(object): if stdout: self.logger.out('Successfully switched Patroni leader\n{}'.format(stdout), state='o') break - elif stderr == "Error: Switchover target and source are the same.": + elif stderr == "Error: Switchover target and source are the same.\n": self.logger.out('Failed to switch Patroni leader to ourselves; this is fine\n{}'.format(stderr), state='w') - break + break else: self.logger.out('Failed to switch Patroni leader; retrying\n{}'.format(stderr), state='e') time.sleep(2)